Commit Graph

135 Commits

Author SHA1 Message Date
Panu Matilainen 7c44f57977 Brute-force s/rpmTag/rpmTagVal/ in entire librpmbuild
- Many of these cases would be true enums from preambleList & similar,
  except for the list terminating sentinel. Just switch all the
  remaining rpmTag's to rpmTagVals to bring our enum-whacking to
  a grande finale.
2010-10-22 13:50:05 +03:00
Panu Matilainen 475244d14a Couple of doxygen argument mismatch fixes 2010-10-22 09:36:43 +03:00
Eric W. Biederman 7293d4aaf5 Add a getter for the source header.
It appears the access to the source header has started to get buried
into usability so add an getter so the implementation can change a
little without breaking callers.
2010-10-12 10:54:50 +03:00
Panu Matilainen 2fb15a5443 Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield
  itself is not an enumeration. Add a separate typedef on "rpmFlags"
  type (presenting a bitfield of flags) for all of these. Compilers
  hardly care, but the typedefs give a nice visual clue for
  us humans using these flags far away from ho^H^H definitions.
2010-09-21 11:10:14 +03:00
Panu Matilainen 19368e8aa7 Clarify RPMBUILD_STRINGBUF comment 2010-09-02 14:44:02 +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 bbe310aaf8 Add a new public function for retrieving build dependencies from spec
- Not needed by rpmbuild itself currently, but permits retrieving the
  build dependency information in a format that's better suited for
  further processing than an rpm problem set.
2010-09-02 14:28:17 +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 6b2de7c10a Cosmetics: update comments + use a specific type for buildAmount 2010-09-02 14:12:25 +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 53385ee676 Eliminate _noDirTokens from librpmbuild API+ABI
- Add another flag set to control package generation, passing around
  as necessary. Use this to implement --nodirtokens functionality
  in a cleaner manner.
2010-09-02 12:12:46 +03:00
Panu Matilainen 36f0c779d6 Handle --nobuild as another buildAmount flag 2010-09-02 10:23:57 +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 f579dadf3a Eliminate parseSpec() from librpmbuild, trim unused arguments
- We can't keep compatibility while eliminating goo like transaction set
  from the arguments so dont bother trying.
2010-09-01 17:09:34 +03:00
Panu Matilainen c7ccdea638 A new saner interface for parsing spec files
- For now just a wrapper around parseSpec() that returns *gasp*
  a pointer to a parsed spec structure.
- Limit the amount of goo that needs passing - optimally we'd only need
  the spec + parsing flags, but due to %{buildroot} macro abuse in specs
  we'll need that for now too.
2010-09-01 16:49:43 +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 05dd62aba9 Lift remaining build-related stuff out of librpm over to build-side
- none of this belongs to librpm headers and ABI
2010-09-01 12:34:33 +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 94a58d3864 Eliminate unused spec argument from addReqProv()
- addReqProv() only operates on the header, not spec
2010-08-25 15:06:47 +03:00
Panu Matilainen 8d448745f0 Eliminate freePackage() from librpmbuild API
- The only thing that should ever call this is freePackages() which
  was already made static. As newPackage() links the package structure
  with the spec, its not safe for others to call it.
2010-08-25 14:13:10 +03:00
Panu Matilainen e677ea1ea8 Eliminate initSourceHeader() from librpmbuild API
- This is a funky little implementation detail which no caller should
  have to bother with. Move it to parseSpec.c which is the only place
  needing it now and make static.
2010-08-25 14:04:52 +03:00
Panu Matilainen 9ed9daf93e Eliminate doRmSource() from librpmbuild API again
- buildSpec() is sufficient interface for accomplishing the same,
  avoid exposing internal helpers
2010-08-25 11:06:26 +03:00
Panu Matilainen ddee17551f Eliminate addChangelogEntry() from librpmbuild API
- This is just an internal helper for parseChangelog(), no point
  exporting it
2010-08-24 13:56:29 +03:00
Panu Matilainen 692945f29e Eliminate buildHost() and getBuildTime() from librpmbuild API
- Neither is needed anywhere outside pack.c, bury there and make static
2010-08-24 13:54:04 +03:00
Panu Matilainen 64a1351844 Eliminate checkPackages() from librpmbuild API
- No needs outside pack.c, make it static
2010-08-24 13:39:42 +03:00
Panu Matilainen 398df91274 Eliminate parseExpressionString() from librpmbuild
- This has been unused since its introduction in 1998...
2010-08-24 13:37:16 +03:00
Panu Matilainen 0d50dde3d7 Eliminate freePackages() from librpmbuild API
- This is a spec-internal cleanup task, no need outside spec.c
2010-08-24 13:30:12 +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 9fbaedd1ac Ensure rpmlib() dependency sanity on build
- only requires on rpmlib(foo) are allowed
- make sure any rpmlib() foo dependencies have RPMSENSE_RPMLIB bit set,
  rpmdeps as external dependency generator can create rpmlib() dependencies
  without the bit set, and also any manual rpmlib() deps wont have it
2009-10-21 12:23:50 +03:00
Jindrich Novy 8f44f9159c Don't check Provides/Requires for bad characters, they could be UTF-8
- don't check Name but EVR in parseRCPOT()
- use rpm namespacing for charCheck()
- remove unused variable
2009-06-16 13:53:42 +02:00
Jindrich Novy ad53979f9a Check for valid chars in Requires/Provides as well 2009-06-15 08:47:55 +02:00
Jindrich Novy e58db2eda1 Don't check package BuildRequires when doing --rmsource (rhbz#452477)
- export doRmSource() and make it more consistent with the API
2009-01-11 16:54:07 +01:00
Jindrich Novy d535818f42 Add the post-build package checker feature in rpmbuild (upstream ticket #2)
- allow to run helper programs to check:
  - generated SRPM
  - each generated RPM after it is successfully written
  - whole successfully written binary package set
- it is possible to use it for sanity checks
2008-11-10 15:52:29 +01:00
Panu Matilainen e5d4fc50c2 Missing const in parseUnsignedNum() 2008-07-07 18:11:59 +03:00
Jindrich Novy 0f8102c1ed Avoid reading negative constants from SourceXX, PatchXX tags
- convert parseNum() to parseUnsignedNum()
- don't misleadingly declare it to return int, when the result is
  always unsigned due to strtoul() call
2008-07-01 12:54:12 +02:00
Panu Matilainen f6a8d969de Convert build reqprov to headerPut()
- also changes index type to uint32_t instead of signed
2008-06-17 12:56:53 +03:00
Panu Matilainen dc61ca3b65 Start cleaning up the rpmerr removal mess of build/ return codes
- define PART_ERROR for error returns from various parse bits,
  teach parseSpec() about it
- streamline parseSpec() exists
2008-05-05 09:51:14 +03:00
Panu Matilainen 365ffe20a4 Remove meaningless extern on function declarations in headers 2008-04-24 15:08:09 +03:00
Panu Matilainen 29674e476a Yet more url ripping - buildroot is never an url
- this is a bit nasty as it changes public interfaces but rename to make
  it explicit they're just plain paths, not urls
2008-04-09 08:18:38 +03:00
Panu Matilainen d718b12f5b Mass convert (back) to rpmTag as it's usable everywhere now
- cast away a few cases where the enum usage causes ridiculous amount
  of compiler warnings from unhandled switch-cases
2008-02-05 17:42:19 +02:00
Panu Matilainen aca6d4a2c4 Add rpm_time_t type for time types (in headers), use where spotted
- easy to spot, easy to change...
- time_t size can vary, header data needs fixed size
2008-02-04 11:50:39 +02:00
Panu Matilainen 7e56c6355b Use rpm_tag_t everywhere for rpm (header) tag type
- typedef'ed as int32_t for now, negative values used in some places for
  error cases
- easy to grep, easy to change...
- add RPMTAG_NOT_FOUND define, used in place of -1 "magic",
2007-12-13 19:32:37 +02:00
Panu Matilainen 9ce13e09ef Switch to <rpm/foo.h> style for public headers
- adjust include paths accordingly
2007-12-08 14:02:32 +02:00