Commit Graph

45 Commits

Author SHA1 Message Date
Panu Matilainen 12f9b3f9e6 Add --noclean and --nocheck options to rpmbuild
- Ability to skip %clean build stage was requested as RhBug:756531,
  --nocheck seems otherwise useful to have as %check can take a lot of
  time, time you might not want to spend for a trivial spec change or such.
2012-08-02 12:10:39 +03:00
Panu Matilainen e76ba6f332 rpmSetTables() call in rpmbuild has been dying long enough by now
- The call to rpmSetTables() from rpmbuild is simply redundant for
  all I can tell, it gets called from inside rpmrc/config processing
  with the same values and the extra call here never changes anything
  as the tables have already been set through rpmReadConfigFiles()
  whether building for several targets or not.
2012-03-09 13:05:38 +02:00
Panu Matilainen 75cea7a534 Make --pipe command failures reflect our exit codes (RhBug:735481) 2011-09-05 08:38:31 +03:00
Panu Matilainen f67c47b856 Eliminate bunch of dead assignments on ts vsflags
- The common pattern here is grabbing current flags to a local
  variable, modifying them for an operation and then restoring,
  which is fine... but we dont care about the previous flags
  when we're restoring them.
2011-05-30 15:50:29 +03:00
Panu Matilainen 5b2c322887 Eliminate dead NULL-assignments at scope-end in main cli utils 2011-05-30 09:36:03 +03:00
Panu Matilainen 0b36a1f18e Eliminate bogus ferror() checks
- fopen() returns NULL on errors, never an opened stream with error
  flag set. These are leftovers from past where rpmio fd was used
  instead of FILE and probably the checks were bogus even back then too.
2011-05-18 10:59:54 +03:00
Aron Griffis 4846346c18 Use the right variable for absolute path (ticket #137)
- Fix the problem where rpm attempts to use the tarball as the specfile
2010-10-06 10:55:09 +03:00
Panu Matilainen df960a66cf void stepping on toes of relatives, part 5
- Eliminate remaining (hopefully) C++ reserved keywords in rpmbuild cli tool
2010-09-21 15:11:04 +03:00
Panu Matilainen 61432eb771 Use the common rpmcliQueryFlags for signature verify options in rpmbuild
- The various --nosignature etc verification switches are common to
  everything, and have been available through rpmcliQueryFlags via
  the common popt table since 2002. Might as well finally use it
  to limit the amount of duplicate popt goo.
2010-09-03 07:49:37 +03:00
Panu Matilainen 4505fb312d Swap rpmSpecBuild() arguments for consistency with other APIs
- What we're building comes first, /how/ we're building comes second
- Update the sole caller, doesn't matter as this is a new interface...
2010-09-02 14:39:11 +03:00
Panu Matilainen 56bb5c89ef Move build dependency checking from cli tool to librpmbuild
- Add new public rpmSpecCheckDeps() function which can be used for
  checking build dependencies of a spec against a transaction set.
- Change checkSpec() in rpmbuild cli to use the new interface
- rpmbuild.c is now free of direct spec structure accesses
2010-09-02 14:13:28 +03:00
Panu Matilainen 65aa56b443 Eliminate specFlags from rpmBuildArguments
- Spec parse flags are specific to parsing a spec, not building it.
  This could be relevant again if a higher level build API is added
  to the library but not ATM.
2010-09-02 14:08:08 +03:00
Panu Matilainen b7dae17747 Eliminate targets from rpmBuildArguments
- Targets are obviously relevant for building but not in the
  context of rpmSpecBuild which expects the environment to be set up
  already. If/when we add a higher level build interface to librpmbuild
  this comes relevant again, until then bury inside the cli-tool.
- Simplify the target parsery by using argvSplit() and friends.
2010-09-02 13:31:44 +03:00
Panu Matilainen 9eb5473272 Eliminate buildMode and buildChar from rpmBuildArguments
- The mode letters are only relevant for the rpmbuild cli tool. If/when
  some of the related build logic is moved from the cli tool to the
  library, we'll need a better way of expressing these combinations
  than letters.
2010-09-02 13:07:01 +03:00
Panu Matilainen 746012eb74 Eliminate verify flags from rpmBuildArguments
- Transaction set verification bits are not relevant to building,
  bury inside the rpmbuild cli utility.
- Also the type was wrong, its rpmVerifyFlags, not rpmQueryFlags, duh
2010-09-02 13:04:08 +03:00
Panu Matilainen 6b0d371f4a Eliminate noDeps and shortCircuit from rpmBuildArguments struct
- Both of these are only relevant to the rpmbuild cli utility,
  eg checking for build-requires is up to caller, not librpmbuild.
2010-09-02 13:02:11 +03:00
Panu Matilainen 05547d1f30 Eliminate popt goo from librpmbuild
- Move the cli-switch manouvering into rpmbuild.c cli utility where
  it belongs.
2010-09-02 12:31:39 +03:00
Panu Matilainen fb81dee4c6 Eliminate freeNames() from librpmbuild ABI
- Call freeNames() at end of buildSpec() instead of requiring API
  users to clean up after us. This does mean losing some of the
  supposed caching advantage when building on more than one spec,
  but hardly matters, one spec at a time is the typical build usage
  anyway.
2010-09-02 11:19:46 +03:00
Panu Matilainen 8f65a6bd9a Handle spec flags parse option figuring in popt callback already 2010-09-01 18:18:10 +03:00
Panu Matilainen 2c4976a528 Rename freeSpec() -> rpmSpecFree() for namespacing
- librpmbuild actually now has what remotely resembles an API, after
  we broke every single thing there was ;)
2010-09-01 17:29:27 +03:00
Panu Matilainen cbd5d98a84 Update callers to use the new rpmSpecParse() interface 2010-09-01 16:59:22 +03:00
Panu Matilainen f9740318a8 Spec rootDir is only relevant for building, eliminate from parseSpec()
- The whole rootDir seems dubious for build purposes, but in any case its
  only relevant during the actual build process, not for spec parsing.
  Set spec->rootDir from buildSpec() for the duration of the
  build to avoid having to refactor doScript() and all right now.
2010-09-01 14:31:49 +03:00
Panu Matilainen 4acb8866ef Eliminate cookie from spec structure
- Cookies are not a property of spec but a given build, handle this
  internally to buildSpec() except for --rebuild which passes the
  srpm identifier cookie through buildArgs
2010-09-01 14:00:54 +03:00
Panu Matilainen bd9e1b9d9b Replace buildSpec() with a new interface in the API
- Accept the entire build arguments structure along with a spec, these
  contain everything that we'll need
- Just a convenience wrapper for buildSpec() for now, more things
  to follow...
- Update the sole existing caller accordingly
2010-09-01 13:37:37 +03:00
Panu Matilainen 555f699f11 Mass eviction of remaining internal helpers in librpmbuild API
- Yank everything qualifying as "internal helper function" into
  internal-only headers, loosely grouped as follows:
  1) Everything involving spec-manipulation goes into rpmbuild_internal.h
  2) All other miscellaneous helpers go into rpmbuild_misc.h
- This leaves us a rather minimal, and nearly useful API into librpmbuild:
  Users need to be able to parse a spec, query or build (parts of) it
  and free up the spec structure when done. This is what we have now,
  various still exposed structures not counting.
2010-08-25 15:41:09 +03:00
Panu Matilainen aafd1d217d Initialize source header from parseSpec() instead of caller(s)
- This is where it logically seems to belong to, after all parseSpec()
  similarly populates all other metadata of the binaries etc too.
  No point requiring callers to do this obscure extra call.
2010-08-25 13:33:15 +03:00
Panu Matilainen fd893bf69e Fix RhBug:452477 differently to avoid doRmSource() 2010-08-25 11:03:26 +03:00
Panu Matilainen 1d7f4dd6ed Remove ancient autohelp-handling related leftovers 2010-08-24 11:40:25 +03:00
Panu Matilainen 51a05e7a9f Remove signing support from (lib)rpmbuild
- Signing is better done in an environment completely separated from
  the process of actually building packages. This is how its generally
  done anyway by distros, this change just forces the issue.
- While signing on build seems handy and saves some io-churn, this
  is very insecure as your precious secret passphrase remains unencrypted
  in memory for the entire duration of the build where it's accessible
  to whatever happens to be building. This change doesn't
  affect fix the issue of unencrypted passphrase residing in memory
  and potentially getting swapped out, it only limits the exposure
  to the actual signing process which isn't subject to unknown scripts
  poking around.
- Minimally preserve rpmbuild's --sign functionality via popt --pipe hack
  to call rpm --addsign when build completes
2010-08-20 18:04:11 +03:00
Panu Matilainen fbd92df754 Argh. Realize we already have equivalents of initCli() and finishCli()
- rpmcliInit() and rpmcliFini() do almost exactly the same as our
  newborn cli-helpers, but they've been almost unused until now.
  Use them and lose the new ones.. doh.
- The downside is that popt aliases are now broken when running commands
  from the build tree due to lt-foo in argv[0], whereas initCli() took
  and explicit popt context name argument. Oh well...
- rpmcliFini() was missing several necessary memory cleanup calls,
  add them there while at it.
2010-08-20 15:23:48 +03:00
Panu Matilainen 3c5c19747b Kludge to get rid of ugly lone --quiet on usage message 2010-08-20 14:31:16 +03:00
Panu Matilainen 2c2faa299e Move --pipe handling to cliutils helpers 2010-08-20 13:52:47 +03:00
Panu Matilainen 03a8511e3b Lump much of the common cli-init + finish tasks into cliutils helpers 2010-08-20 13:50:48 +03:00
Panu Matilainen b217529967 Add a convenience library for stuff common cli-bits into 2010-08-20 13:49:18 +03:00
Panu Matilainen 04b1816f00 If MiNT can't cope, frankly my dear, I dont give a damn 2010-08-20 13:48:42 +03:00
Panu Matilainen 910fc93842 Merge build.[ch] into rpmbuild.c, doesn't make sense to separate anymore 2010-08-20 11:26:28 +03:00
Panu Matilainen 5ddfae716a Clean up rpmbuild's --quiet handling + honor it on --rebuild too 2010-08-20 11:16:17 +03:00
Panu Matilainen 7230aba539 Cosmetics cleanup 2010-08-20 11:06:24 +03:00
Panu Matilainen f976dbd2f5 Eliminate unnecessary sanity checks wrt --sign and fix indentation 2010-08-20 11:02:14 +03:00
Panu Matilainen 8e9f4a9eeb Test argument count early, avoiding the need to re-check over and over
- Instead of bothering with different error messages for tar/spec/pkg
  messages, just dump usage when no arguments present.
- Testing argument file existence for signing is meaningless on build
  as we're not signing the specs or tarballs present there but the
  build result.
2010-08-20 10:57:48 +03:00
Panu Matilainen af1fbfaca8 Eliminate a bunch of now unnecessary cli-switch sanity checks 2010-08-20 10:57:43 +03:00
Panu Matilainen a3795d0dc2 Simplify --root argument checking
- We haven't accepted url's in as root since ages, wipe out the goo
2010-08-20 10:57:35 +03:00
Panu Matilainen 66ce5dc19c Eliminate the IAM_RPMBT ifdef's from rpmbuild.c for real 2010-08-20 10:57:27 +03:00
Panu Matilainen 5fe63cd8e0 Chainsaw the now unused #ifdef'ed parts out of rpmqv.c and rpmbuild.c 2010-08-20 10:57:20 +03:00
Panu Matilainen f9cbeaca83 Begin splitting rpmbuild to separate sources
- Make a copy of the entire rpmqv.c source to rpmbuild.c and switch
  make to use the new copy. No functional changes. Making a copy first
  means we get much easier to follow patch-series on the changes
  that will follow.
2010-08-20 10:52:28 +03:00