Commit Graph

1802 Commits

Author SHA1 Message Date
Panu Matilainen 968461689c Const-correctness: source is a pointer to fullSource and must not be freed 2010-10-30 11:37:06 +03:00
Panu Matilainen f2039adf6f Const-correctness: rpmCharCheck() doesn't modify field, make it const 2010-10-29 20:30:07 +03:00
Panu Matilainen e9e42004e9 Lose ancient lclint remnants from the repository 2010-10-29 10:40:25 +03:00
Panu Matilainen a2a6060a6c Eliminate unused truncStringBuf() function
- This has been unused at least as far back as rpm 4.4 actually...
2010-10-29 10:21:45 +03:00
Panu Matilainen b4bc5e778e Eliminate unused spectag and speclines goo from spec
- These were used, back in the day, to implement a hidden --specedit
  switch, which in all its glory did: print a copy of a spec file,
  with group, summary and description looked up from specspo.
  This huge pile of junk was left behind from kicking out the
  useless "feature" in commits 7b95061d3b and
  0f991a1420.
2010-10-29 10:12:53 +03:00
Panu Matilainen 94ea5ee25f Fix the remaining enum abuse over rpmParseState in librpmbuild
- rpmParseState uses might actually qualify for a true enum here
  but changing it would require changing half of librpmbuild and
  many of them mix the parse states, other error codes and whatnot
  in their types... just not worth the trouble, so use an int.
2010-10-28 12:01:42 +03:00
Panu Matilainen b3c6d5a395 Now, make getStringBuf() return const char * for correctness sake 2010-10-28 11:58:02 +03:00
Panu Matilainen 3418a1078f parseScript() const pedantry
- The string from getStringBuf() is not modified, so use a const
  variable for it, and a separate variable for the temporary
  line splitting for triggers
2010-10-28 11:57:47 +03:00
Panu Matilainen 342189d479 Use ARGV_t instead of stringbuf in changelog parsing
- addChangelog() is a bad boy and modifies the string it grabs
  from getStringBuf(), be clean about it and grab a copy through
  argvJoin() instead
- addChangelog() would be better off walking and parsing over the
  argv directly instead of a joined string of it all, but leaving
  that exercise for some other rainy day
2010-10-28 11:55:04 +03:00
Panu Matilainen 4100680ec2 Use ARGV_t for temporary line storage directly
- Similar to commit 1e3db59b56,
  no point using temporary string buffer when only end up splitting
  it into an argv for processing. Incidently this would've been
  a much less intrusive fix to RhBug:573339 than introducing
  a whole new argvSplitString() function... oh well. Take care not
  to introduce extra newlines in the process as argvSplitString() was
  eating them before - need to use appendStringBuf() for spec->prep now.
2010-10-28 11:10:38 +03:00
Panu Matilainen 3b99c79ef9 Pass the script to doScript() as const char *
- doScript() doesn't do anything special with the script buffer,
  this lets us use const for the argument.
2010-10-28 10:51:00 +03:00
Panu Matilainen 3f152a1312 Argument passing hysteria in doScript()
- Callers know perfectly well which part they're passing to doScript()
  so they can just as well pass in the name and the scriptlet to run,
  avoiding silly stuff in the switch-case
2010-10-28 10:45:35 +03:00
Panu Matilainen 98aff6e658 Handle NULL sb in getStringBuf() cleanly 2010-10-28 10:38:40 +03:00
Panu Matilainen a32705e737 Use ARGV_t for package fileFile, fileList and policyList
- Similar to commit 1e3db59b56,
  all these end up being passed to argvSplit() to process them line
  by line in the end, collect them in the argv to start with saving
  a whole lotta huffing and puffing in the process
2010-10-28 10:24:20 +03:00
Panu Matilainen 1e3db59b56 Eliminate splitString() leftover braindamage in processSourceFiles()
- Collect the filenames directly into the ARGV_t files instead of
  putting them to a StringBuf first and then argvSplit()'ing the
  result, doh. Leftover stupidity from eliminating splitString()
  usage in commit 94ff22b129
2010-10-28 09:54:53 +03:00
Panu Matilainen 21e0e5cd48 Bury StringBuf inside librpmbuild internals 2010-10-26 23:36:46 +03:00
Panu Matilainen b2a688ee00 Make rpmfcExec() internal
- Nobody in their right mind is likely to be calling what's really
  an internal helper function in the build code. Simply missed in
  the first round of librpmbuild API butchery.
- This eliminates the last remaining exposure of StringBuf in the API
2010-10-26 23:28:39 +03:00
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 07e68a5a77 Fix invalid uses of rpmTag/rpmSigTag in pack.c 2010-10-22 13:31:34 +03:00
Panu Matilainen ac2efca814 Use header datatype for hash algo instead of pgpHashAlgo enum
- The digest algo can come from macro numeric expansion which is
  not an enum. Just use uint32_t which is how it'll end up in the header
2010-10-22 13:07:16 +03:00
Panu Matilainen 475244d14a Couple of doxygen argument mismatch fixes 2010-10-22 09:36:43 +03:00
Colin Walters eea47aa9a7 Add 'VCS' key
Spec files have a lot of metadata about a project.  However one of the
most key components is the upstream version control system which was
notably lacking.

Resolve this by adding a "VCS" key.  There is no specification
for contents of this key, given that the set of version control
systems (and features thereof) are not well-defined.  However,
recommendations are:

 * git: This URL should be in a form that can be passed to "git clone",
   with the additional feature that an optional fragment identifier "#foo"
   denotes a branch or tag.
2010-10-12 17:05:17 +03:00
Panu Matilainen 190b58746c Add support for querying source rpm from spec too
- Handle source rpm query as a new query source type RPMQV_SPECSRPM,
  rename the binary query to RPMQV_SPECRPMS, with RPMQV_SPECFILE
  as a backwards compatibility alias to RPMQV_SPECRPMS.
2010-10-12 14:41:35 +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 4e8d7c1a46 Require file attribute config to have .attr suffix
- Allows for more precise globbing, avoiding potential issues from
  leftover / accidentally placed files in the fileattrs directory.
2010-10-05 10:08:53 +03:00
Panu Matilainen fb4bc9b7d7 Replace __foo_exeonly attribute with a more generic mechanism
- Use a list of text keyword tokens to allow for more flags without
  requiring adding special processing for every new flag we make
2010-10-05 09:35:45 +03:00
Panu Matilainen c8ddd0ca7f Add getter for spec script sections too, bah...
- Pretty dumb and all, but to avoid breaking some python users
  (some folks apparently have found /some/ use for these...)
2010-10-01 15:22:06 +03:00
Panu Matilainen f94d1507e5 Add minimal API for spec packages and sources
- Iterators for both (these could easily done as self-iteration over
  ->next but to keep the api similar to other rpm iterators...)
- Minimal getters to satisfy python bindings needs
2010-10-01 15:03:22 +03:00
Panu Matilainen 675bfca5cc Use namespaced names for spec pkg and source opaque typedefs
- Leaving the painful and somewhat pointless exercise of changing
  all the Package and Source references for another rainy day
2010-10-01 13:33:08 +03:00
Panu Matilainen 1933cb5a9d Finish off our librpmbuild API mass-murder by turning everything opaque
- These huge structs have no business being visible to the public.
  Just brute-force split all remaining spec internal structures into
  another internal header, including where needed.
- The only thing accessing these structs outside of librpmbuild is
  the python spec bindings. Temporarily permit direct access to
  rpmspec_internal.h until we have the necessary API in place.
2010-10-01 13:25:38 +03:00
Panu Matilainen a0444009a1 rpmfcGenerateDepends() is internal, move away from public header 2010-10-01 13:23:03 +03:00
Panu Matilainen a462500b63 Whoops, missing RPM_GNUC_INTERNAL on stashSt() 2010-10-01 11:32:31 +03:00
Panu Matilainen 84747fb22e Stuff fts into a convenience library in misc/
- This is not really native rpm code but a copy of (glibc?) FTS
  implementation, with slight modification to avoid symbol name
  collisions. Stick it where the sun don't shine, we'd eventually
  like to get rid of such bundled external code.
2010-10-01 11:22:13 +03:00
Panu Matilainen ecf7ce8b2b Lose rpmio-url leftovers from fts
- We never pass url's here, just plain old local paths
2010-10-01 11:17:24 +03:00
Panu Matilainen 8422a94ca9 Split signature and digest generation to separate functions
- Similar in spirit to commit 825691afb2,
  these have fairly little in common really.
- Change the function names to force breakage on users (these are exported
  in ABI but not in public headers so "users" are internal uses in
  practise): the automatically generated bits in signature header are
  not signatures, but digests (even size is a checksum of sorts) ...
  and fix the couple of internal uses.
2010-09-29 10:55:38 +03:00
Panu Matilainen 8274b41ee6 Remove leftover trap for RPMRC_FAIL errors where none should be seen
- Been 2.5 years now without seeing that trap trigger, should be safe
  to remove now ... to silence a warning about comparing to non-existent
  enumeration value.
2010-09-28 22:35:10 +03:00
Jindrich Novy 4c41013eeb Fix segfault in rpmdeps (RhBug:637357) 2010-09-26 18:45:34 +02:00
Panu Matilainen af57879ea0 Remove bunch of double consts in librpmbuild 2010-09-21 16:18:22 +03:00
Panu Matilainen 312ceee392 Initialize nametag to RPMTAG_NOT_FOUND in parseRCPOT()
- Doesn't matter what the value is, the switch (somewhat hysterically)
  makes it default to RPMTAG_REQUIRENAME in unknown cases anyway
2010-09-21 15:55:02 +03:00
Panu Matilainen add59e49ea Const pedantry: taropts only ever points to string constants 2010-09-21 15:53:38 +03:00
Panu Matilainen 7723fef264 Move expression type enum out of the struct
- While legal in C++, the enum and its values are only visible within
  the scope it was declared in, making it invisible to the rest of
  the program.
2010-09-21 15:38:41 +03:00
Panu Matilainen 8b7ff12b4e Add "c++ protection" to (hopefully) all of our internal headers 2010-09-21 15:21:12 +03:00
Panu Matilainen c60bf8f766 Avoid stepping on toes of relatives, part 3
- Eliminate remaining (hopefully) C++ reserved keywords in librpmbuild
2010-09-21 15:07:08 +03:00
Panu Matilainen 6ae1fae20f Use the macro allocator variants within librpm* 2010-09-21 14:47:14 +03:00
Panu Matilainen 67a3e424ed Use _free() instead of rfree() where "return value" is assigned 2010-09-21 14:34:33 +03:00
Panu Matilainen e3e69b44e5 Return explicit NULL from various fooFree() functions everywhere 2010-09-21 14:26:29 +03:00
Panu Matilainen 42a523a491 strstr() considered harmful, part 541
- buf isn't const here, it's modified through pointer acquired through
  strstr() which silently casts away the const.
2010-09-21 13:14:20 +03:00
Panu Matilainen 99b44e35e5 Use actual rpmTags in place of the old HEADER_FOO defines everywhere 2010-09-21 11:58:08 +03:00
Panu Matilainen 42bcdfd527 Rename specdFlags to remove unnecessary type vs variable name confusion 2010-09-21 11:40:49 +03:00
Panu Matilainen 8f7874c193 Fix up bunch of silly int vs rpmRC return code mismatches 2010-09-21 11:37:21 +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 3c6fed5347 Plug memleak from rpmSpecCheckDeps()
- We need to call rpmtsEmpty(), not rpmtsClean() to purge the
  transaction elements in the set...
2010-09-14 09:45:58 +03:00
Panu Matilainen b71818080b Urk, mixed up in branches and wrong stuff getting pushed. Revert.
- This reverts commits 9ac127c352 and
  7abc26e300
2010-09-08 07:48:04 +03:00
Panu Matilainen 9ac127c352 Mark ts argument unused in bunch of query APIs
- The ts argument used to be necessary and used for rpmfiNew() and spec
  query but not any more...
2010-09-07 21:13:34 +03:00
Panu Matilainen 384362737f Cosmetics: use an enum instead of #defines for source type bits 2010-09-02 14:47:33 +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 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 3c7d4f89bb Detect short-circuited build based on executed build steps from buildSpec()
- Avoids having to access rpmBTArgs from deep packageBinaries(),
  API changing is not an issue anymore...
2010-09-02 11:16:07 +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 f9ae396a43 Handle --nolang as another spec parse flag 2010-09-01 18:07:19 +03:00
Panu Matilainen 1c00fe0b5f Combine spec parsing options into a common flag bitfield 2010-09-01 18:03:05 +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 305a476624 Eliminate transaction set from spec parsing internals 2010-09-01 17:18:11 +03:00
Panu Matilainen 5ead64bcd0 Pass flags directly to the lower level parseSpec() helper 2010-09-01 17:13:26 +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 cbd5d98a84 Update callers to use the new rpmSpecParse() interface 2010-09-01 16:59:22 +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 c22fff5b93 Eliminate silly and unused timecheck feature from (lib)rpmbuild
- This was broken for years without anybody complaining, should
  be safe to conclude nobody will miss it later either. And if
  somebody misses it, this is a job for rpmlint really.
2010-09-01 16:48:16 +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 628de71cde Sanitize buildSpec() arguments a bit 2010-09-01 13:46:49 +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 76600e5389 Eliminate useless hardwired build debug foo 2010-09-01 10:48:02 +03:00
Steve Lawrence 383e275648 Add new %sepolicy section to the spec file format
The %sepolicy section is used to describe SELinux policy to be included
in a package. It's syntax is similar to other sections (%files, %pre,
%post, etc.) in that you can provide a string and -n after the
declaration to specify policy should be added to a subpackage.

For example:

%sepolicy
 # policy in this section will be added to the main package

%sepolicy foo
 # policy in this section will be added to the '<mainpackage>-foo' subpackage

%sepolicy -n bar
 # policy in this section will be added to the 'bar' subpackage

The %sepolicy section contains zero or more %semodule directives, with the
following format:

%semodule [OPTIONS] path/to/module.pp

The available options are:

-b, --base
	The module is a base module

-n, --name=NAME
	The name of the module. If not given, assumes the name is the basename of
	the module file with file extensions removed.

-t, --types=TYPES
	One or more comma-separated strings specifying which policy types the
	module can work with. To explicitly state that a module can work with any
	policy type, "default" can be specified as the value. If not specified,
	assumes the module can work with any policy type, and assigns the types as
	"default".

Below is an example of this new format:

  %sepolicy
  %semodule -n foo -t mls policy/foo.pp
  %semodule -n bar -t strict,targeted,mls -b policy/bar.pp

This also adds new header tags to store the new information:
 RPMTAG_POLICYNAMES        (string array)
 RPMTAG_POLICYTYPES        (string array)
 RPMTAG_POLICYTYPESINDEXES (uint32 array)
 RPMTAG_POLICYFLAGS        (uint32 array)

The index of NAMES and FLAGS maps directly to the index of RPMTAG_POLICIES.
However, because a single policy can have multiple types, the mapping for
TYPES is not direct. For this, the index maps to TYPESINDEXES, which
contains the index of the policy that the type maps to. This is similar to
how DIRINDEXES is used to map DIRNAMES and BASENAMES. As an example, the
previous %sepolicy section would have the following header tags:

RPMTAG_POLICIES:
 0: <foo.pp data, base64 encoded>
 1: <bar.pp data, base64 encoded>

RPMTAG_POLICYNAMES:
 0: foo
 1: bar

RPMTAG_POLICYFLAGS:
 0: 0
 1: 1	# assumes flag 1 == BASE

RPMTAG_POILCYTYPES:        RPMTAG_POLICYTYPESINDEXES:
 0: mls                     0: 0
 1: strict                  1: 1
 2: targeted                2: 1
 3: mls                     3: 1
2010-09-01 09:04:27 +03:00
Steve Lawrence 5779fb12e2 Remove the existing %policy directive
Remove the existing %policy directive, to be replaced with a new
%sepolicy section with more configurable options.
2010-09-01 09:04:15 +03:00
Panu Matilainen d010ec1c90 Permit packages with no files to omit %files entirely
- Fixes the long standing obscure behavior of missing %files
  section causes build to complete without errors but without producing
  any packages either. Packages without files in them are perfectly
  valid (eg metapackages), requiring empty %files section for those
  is just unnecessary spec noise.
- Remove %files section on one of the test-suite specs to create
  a test-case for this as a side-effect.
- This of course introduces a slight incompatibility with older rpm's,
  if compatibility is required then just add those empty %files in the
  spec, they dont hurt anything but the readers eyes.
2010-08-26 12:31:01 +03:00
Panu Matilainen e38efea49c Clean up newPackage() a bit
- No much point explicitly NULL'ing calloc()'ed memory, only initialize
  the values that are something else + other cosmetics.
2010-08-26 11:58:24 +03:00
Panu Matilainen a0950b6013 Split arch/os/platform adding out of parseSpec()
- Combining description /checking/ and arch/os/platform /adding/
  into same for-loop (to save cycles or lines, dunno) makes no sense
  whatsoever. No functional changes.
2010-08-26 11:57:49 +03:00
Panu Matilainen 3b15d08cff Stuff the remaining truly internal structure defs out of sight
- All these are internal implementation details that no callers
  should mess with. Bury inside rpmbuild_internal.h.
- spec, package and source structures are tougher nuts as python
  bindings expect to expose some of the information, we'll need
  at least some api to cover walking over package headers etc before
  shutting the door completely.
2010-08-25 16:10:44 +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 2a6efbca7e Bury OpenFileInfo inside parseSpec.c
- Nothing outside spec parsing machinery needs this nor should mess
  with it, enforce with opaque pointer.
2010-08-25 14:52:58 +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 68beb82e9f Eliminate ancient leftover initSourceHeader() call
- processSourceFiles() is only ever called through buildSpec(),
  and if you throw unparsed spec into that you're pretty much screwed
  anyway. rpmbuild always called initSourceHeader() anyway, and now
  its ensured for all successfully parsed specs.
2010-08-25 13:51:42 +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 b6eb24ebc1 Move source+patch tag insertion into initSourceHeader()
- processSourceFiles() is more about processing the physical files
  ending up in the srpm payload, source + patch tags are mostly just
  informational and can be added early
2010-08-25 13:20:15 +03:00
Panu Matilainen 7209fb6179 Eliminate an exit point from parseSpec() 2010-08-25 12:25:55 +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 3a765b98b6 Eliminate now unnecessary buildio.h
- readRPM() is not used or needed by anything, shred it
- make writeRPM() static inside the only place needing it: pack.c
- move struct cpioSourceArchive_s inside pack.c
2010-08-24 13:25:49 +03:00
Panu Matilainen 1719b2f341 Eliminate newOpenFileInfo() from librpmbuild API
- Nothing outside parseSpec.c needs, bury it there and make static
2010-08-24 12:38:50 +03:00
Panu Matilainen 5ed685425e Eliminate addSource() from librpmbuild API
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-08-24 12:35:59 +03:00
Panu Matilainen 38a8700db8 Eliminate parseNoSource() from librpmbuild API
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-08-24 12:31:13 +03:00
Panu Matilainen 3171179ea3 Lose leftover variable, use const for s to clarify usage 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
Giulio Eulisse c79542ee5a Add missing libgen.h include 2010-08-10 11:50:48 +03:00
Panu Matilainen 74c84ef992 Oops, dont hang in getOutputFrom() if we have nothing to write 2010-07-03 07:16:22 +03:00
Panu Matilainen 375a6b5630 Rewrite getOutputFrom() in a race-free way (supposedly ;)
- Use a self-pipe to handle signal race on select(). pselect() would work
  too but this is more portable and avoids other signal hassles.
- Use non-blocking IO for communicating with the child to avoid spin-happy
  timeouts, just check all fd's properly before trying to use them
- Avoid leaking memory from readBuff on errors
2010-07-02 12:23:43 +03:00
Panu Matilainen 5711982e27 Make the infamous getOutputFrom() error message more useful
- ...like actually saying what was the failing script, doh
- leaving the function name there for a googling hint
2010-06-30 12:30:49 +03:00
Michal Schmidt 7583fcc341 Allow '--short-circuit' for '-bb'
This patch allows short-circuiting of building binary packages. To
prevent accidental use of short-circuited rpms, they are marked with
an unsatisfiable dependency "rpmlib(ShortCircuited)". A developer using
this feature for local development and testing will use "--nodeps".
Should such a rpm leak into the world, users will quickly notice
it does not install by default.

(v3: avoids API change, suggested by Panu Matilainen.
 v2: added poisoning with unsatisfiable dependency.)

Michal
2010-06-23 16:06:43 +03:00
Steve Lawrence 0158708305 Add new Collections preamble tag
This adds a new Collections preamble tag, which contains a space separated list
of collection names that the package belongs to.
2010-06-22 11:12:43 +03:00
Jindrich Novy a2b999df2e Put the macro evaluation in spec comments back.
- '#' at the beginning doesn't need to always represent comment in spec
  but can be part of the embedded bash script (RhBug:594672 - comment 6)
2010-05-24 09:39:54 +02:00
Jindrich Novy 8cb7b9085c Do not evaluate macros in spec comments (RhBug:594672) 2010-05-21 13:12:02 +02:00
Giulio Eulisse d131c3393a Fixes missing __fxstat64 symbol on mac. 2010-04-29 10:30:43 +03:00
Panu Matilainen 40b275b4a7 Fix a few uninitialized variable cases found by clang-analyzer 2010-04-29 10:30:43 +03:00
Panu Matilainen a761daa2f8 Use correct tag for NOPATCH
- dumb copy-paste error from commit a317eaadc3
2010-04-13 08:35:45 +03:00
Michael Schroeder daec6ebf58 readLineFromOFI may modify the fileStack, thus we have to re-set
ofi after calling it
2010-04-12 12:10:20 +02:00
Michael Schroeder 64e7f2aeb4 Seems like a change was made to make %attr(-) go back to the
defattr setting. Unfortunatelly this broke %defattr(-).
2010-04-12 12:07:01 +02:00
Panu Matilainen 6ba22ca0d9 headerNextTag() fits the checkForDuplicates() use-case better
- as we're only looking at tags, not their contents... avoid unnecessary
  data shuffling and the code is a little simpler too
2010-03-29 14:40:40 +03:00
Panu Matilainen dbec366423 Oops, being a bit too strict on dependency qualifiers
- Forgot how nasty hack parseBits() was... its abusing multilang
  support and the multilang support passes "C" if no lang is specified,
  which certainly isn't a valid qualifier. Make multilang vs tag with
  optional qualifiers different types in PreambleRec, which allows
  handling this more sanely
- Additionally build-dependencies dont take any qualifiers now
2010-03-29 09:35:25 +03:00
Panu Matilainen c0eb82dd1f Teach rpm about pre-transaction dependencies
- A pre-transaction dependency is generally anything that must be
  available at the start of the transaction, and cannot be resolved
  by packages *in* the transaction. This lets %pretrans scriptlet
  dependencies be expressed correctly, and could be also used for
  other kinds of pre-conditions.
- rpmlib() dependencies are a special case of pre-trans dependencies
  but leaving them handled separately as they cannot be provided by
  anything in rpmdb either, whereas pretrans dependencies can.
2010-03-29 08:58:27 +03:00
Panu Matilainen bf2bc18ebb Always fail build on unknown dependency qualifiers
- previously unknown qualifiers would go unnoticed if they happened
  be last (including being the only qualifier), eg Requires(pre,junk)
  or Requires(junk) would be cheerfully accepted but Requires(junk,pre) not.
2010-03-29 08:30:18 +03:00
Panu Matilainen 1ab0222b03 Always initialize tagflags to RPMSENSE_ANY 2010-03-29 08:27:35 +03:00
Panu Matilainen 130fddf015 Remove redundant assignments
- everything but buildrequires goes to pkg->header, no point having
  this separately set in each case
2010-03-29 06:29:19 +03:00
Panu Matilainen 668f958291 Group the tag cases a bit more logically in parseRCPOT() 2010-03-29 06:27:44 +03:00
Panu Matilainen d160f45ab3 Drop "support" for per-scriptlet build-requires
- Rpm has never done anything useful with "BuildRequires(prep): foo"
  style dependencies other than recorded them in src.rpms, nor is there much
  point in properly supporting this in the future either
- Frees up four more bits from rpmsenseFlags for better uses
2010-03-29 06:21:10 +03:00
Panu Matilainen 75cccc91f3 Free up three bits from rpmsenseFlags
- pass the wanted dependency type to addReqProv() as tagN argument
  (previously unused, eh...) instead of taking up three precious bits
  for internal-only purposes from a constrained bitfield
2010-03-29 05:59:54 +03:00
Panu Matilainen 8c7e53ec80 First take at pluggable file attribute + dependency extraction system
- move most of the hardwired classification logic from rpmfc C-code
  to macro-based configuration, supporting drop-in addition of arbitrary
  new attributes + dependency extractors based on regex matching of
  libmagic file types and paths
- just the initial rough conversion of our built-in dependency types,
  various open questions + todo-items remain, plus likely fair amount
  of more-or-less subtle breakage
2010-03-23 16:32:46 +02:00
Panu Matilainen d71964bda5 Lose the useless rpmio refcounting debug junk
- the rpmio API always had this goo, should've gotten rid of it
  back in commit dbdbe8010c but .. oh well
2010-03-22 13:25:57 +02:00
Panu Matilainen c586c9955c Lose the useless rpmfi refcounting etc debug messages + debug switches
- get the debug messages out of API, this is what should've been in commit
  dbdbe8010c
2010-03-22 12:49:45 +02:00
Panu Matilainen ad43e72d70 Bury FTS inside librpmbuild and eliminate from public ABI 2010-03-19 18:23:52 +02:00
Panu Matilainen 12802c36c9 Avoid eating empty lines in spec %prep section (RhBug:573339)
- In spec %prep context empty lines don't usually matter but they can
  be significant in eg here-documents.
- Fixes regression from commit 94ff22b129
2010-03-15 12:00:55 +02:00
Panu Matilainen e34d752b92 More dumb thinko/typo/braindamage in scriptlet expansion patches
- qformat certainly shouldn't default to on, duh
2010-03-11 13:34:17 +02:00
Panu Matilainen d370816ba5 Support run-time macro and queryformat expansion on scriptlets
- Add per-scriptlet type flag tags to control special behavior.
- Add rpmlib dependency on scriptlet expansion - if a package relies
  on scriptlet expansion it cannot be correctly installed with
  a version of rpm that doesn't support it.
- Expansion is always an opt-in behavior, enabled with -q and/or -e argument
  in spec. We can't just blindly expand even macros as there's no telling
  %{} constructs might mean in whatever language is used for the script.
- Queryformat expansion requires great care with strange and ugly escapes
  when writing scriptlets, but OTOH it permits access arbitrary header
  data at runtime, which has previously been completely impossible.
- The handling of these expansions needs unifying for all scriptlet types,
  the trigger scriptlet handling is uuugly. Macro expansion could be
  transparently done from rpmScriptRun(), but because of their similar
  syntax, macro expansion needs to happen before query format expansion,
  and we dont have the header available in rpmScriptrun()
2010-03-11 12:06:49 +02:00
Panu Matilainen 4878580634 Lose a couple of leftover variables from times before headerPutString() 2010-03-06 11:04:48 +02:00
Panu Matilainen 1ab5fa94e3 Dont bother translators with internal error debug foo 2010-03-06 11:03:11 +02:00
Panu Matilainen b1afaf7471 rpmdsN() and rpmdsEVR() returning NULL here is a serious can't happen 2010-03-06 11:01:08 +02:00
Panu Matilainen c3c5eae10b Remove now unused inFtw from file lists 2010-03-01 15:55:57 +02:00
Panu Matilainen d46f752c39 Lose ancient prefix remnants from build code
- since commit 840599e3d9 in 1998, nothing
  has set RPMTAG_DEFAULTPREFIX meaning fl.prefix is always NULL...
2010-03-01 15:52:46 +02:00
Ville Skyttä da5b85fb23 Fix rpmfcAttrDeps() for perl modules (was broken in c03be327). 2010-03-01 11:53:54 +02:00
Panu Matilainen 0e36eb1370 Perform dependency extraction solely based on collected attributes
- Yank out the now unnecessary apply table + related apply functions, simply
  collect dependencies for whatever attributes we found for a given file
2010-02-18 13:23:18 +02:00
Panu Matilainen f6534fa920 Classify .desktop files by just path
- Previously we required a file to be classified as text and have
  .desktop suffix, for now replace that with just a regex. We'll eventually
  want/need some extra qualifying logic to handle cases like these,
  eg "only apply path attributes if condition X is also true"
2010-02-18 12:44:05 +02:00
Panu Matilainen e9e3b5eb6e fontconfig -> font dependency extractor rename
- No functional changes, just clearing the naming conventions to avoid
  having to extra mapping for attribute -> extractor name. The current
  font provides are handled by fontconfig, but that's just an internal
  implementation detail.
2010-02-18 12:31:34 +02:00
Panu Matilainen 3d94b4f594 Add debug output for file attributes 2010-02-18 12:26:03 +02:00
Panu Matilainen 3b40816421 Add path coloring for versioned python interpreter itself
- pythondeps.sh knows how to figure python(abi) provide from
  /usr/bin/pythonN.N version but as that's an ELF file, pythondeps.sh
  never got a chance to run on that file
2010-02-18 12:25:04 +02:00
Panu Matilainen 759c03dac2 Replace python-specific path-coloring hack with a generic mechanism
- Use a table of regex pattern - attribute list pairs to apply any
  additional path based attributes. While the fundamental type of a file
  certainly does not depend on its location on the filesystem, its
  location *does* have attached semantics and it'd be just silly to
  ignore that fact.
- The current implementation is dumb as it ends up recompiling the regexes
  and splitting the attr strings a million times. OTOH compiling the
  regexes into the static rpmfcPathTable would be wrong as the patterns
  can contain macros and they can vary from package to package when building
  several packages on one invocation. The attribute split + regex compilation
  should be done once per rpmfc instanciation...
2010-02-18 11:47:34 +02:00
Panu Matilainen 11ed0f75fe Script/interpreter terminology renaming
- No functional changes, just making more obvious mapping between
  attributes and the dependency extractor names. This also leaves the
  term "interpreter" free for use for the actual interpreters, such
  as interpreter(python) provides if we go that way (ticket #136).
2010-02-18 10:35:21 +02:00
Panu Matilainen d72cc38d30 Eliminate silly redundancy
- rpmfcSaveArg() and addAttr() were the very same thing, unify
- turn hasAttr() into a macro, its just dumb enough for that
2010-02-18 10:26:24 +02:00
Panu Matilainen c315beb319 Only run dependency extractors on files with attached attributes
- looking at file colors still works as every relevant type has
  RPMFC_INCLUDE set but this includes various things we might not have
  attributes for, just avoids unnecessary work and is more obvious this way
- should really have been in commit ad2c8485ea
2010-02-17 17:12:52 +02:00
Panu Matilainen 76c2fd5a93 Simplify rpmfcAddFileDep()
- rpmfcHelper() already has the "deptype" character in the format
  we want for file deps, pass it as argument avoiding bunch of silliness
2010-02-17 17:03:19 +02:00
Panu Matilainen ad2c8485ea Use text token attributes instead of bitfield for file classification
- 32 bits are nowhere near enough to meaningfully classify all the
  types of data we might want to extract dependencies for, the bitfield
  was already almost used up and twisty with embedded enumeration in the
  middle etc. With text-based tokens, there are no limits to the total
  number of known attributes or number of attributes that can be attached
  to a given file. This also paves way to moving the classification table
  out of librpmbuild into configuration file(s).
- Remove most of the now unused RPMFC_FOO definitions from the FCOLOR enum,
  leaving just the more abstract INCLUDE, WHITE etc which control other
  aspects of the operation. Also ELF is special as the value ends up
  in headers, preserve it too.
2010-02-17 15:09:20 +02:00
Panu Matilainen f3ca4fb481 Plug a silly memleak in processPackageFiles() 2010-02-17 12:58:40 +02:00
Panu Matilainen 33ea7cbd96 Permit requires extraction too from fontconfig and desktop files
- presently unused but...
2010-02-10 11:22:04 +02:00
Panu Matilainen 87c237bebf Split elf dependency extraction out of librpmbuild to external helper
- Elf dependency extraction code code lifted from rpmfcELF() and refactored
  to saner pieces. Having it in separate executable also frees librpmbuild
  of libelf dependency, clean up the unnecessary linkage etc from
  autofoo
- This lets internal dependency generator for elf files be
  overridden without losing file coloring (which is required for
  correct multilib handling). It also permits non-native elf files
  (eg when cross-building) to be handled by providing a custom
  elf dependency helper
- On the flip side, this inevitably slows down builds somewhat as
  two fork-exec's are needed for every elf file, but unlike invoking
  something like the python interpreter, this is a slim helper...
- All dependency extractors of the internal dependency generator are now
  external helpers (how twisted is that, huh? :) and thus can be customized
  and filtered through %__foo_provides|requires macros
2010-02-10 11:20:51 +02:00
Panu Matilainen a79822f382 Separate helper for script interpreters, split out of librpmbuild
- permit overriding/customization of script interepreter dependencies
- unlike the C-version, the interpreter.req only looks at the first line
  for shebang: libmagic only looks at the first line too, so anything
  else will never get classified as scripts in the first place
2010-02-10 11:19:49 +02:00
Panu Matilainen c03be327fe Make rpmfcSCRIPT() a bit easier on the eyes... 2010-02-10 09:24:21 +02:00
Panu Matilainen 38291e191c Clean up rpmfcClassify() a bit more
- push variables to the local blocks they're actually needed in, sanitize
2010-02-01 13:39:42 +02:00
Panu Matilainen a6a9d63862 Single point of exit for rpmfcClassify()
- cleans up returns + avoids a possible memleak from fcav on failure
2010-02-01 13:39:42 +02:00
Panu Matilainen 79b169bdce Clean up rpmfcHelper() a bit
- push local variables to the scope where actually needed
- use ARGV_t routines for creating av, makes allocations more obvious
2010-02-01 13:39:42 +02:00
Panu Matilainen fdf26eaba0 rpmfc script coloring tweaks
- loosen up the perl token to catch more things, such as
  "/usr/bin/perl -w script text"
- remove unnecessary /usr/bin/python token, these get caught by "python "
  already
- remove what now should be unnecessary coloring by interpreter name,
  both perl and python scripts should get colored by the tokens already
2010-02-01 13:39:42 +02:00
Panu Matilainen 95b177fcfb Revert spec tag-macro concatenation changes
- Concatenating to global, non-namespaced tag macros is fundamentally
  broken for specs with sub-packages, RhBug:555926 is not fixable with
  tag macros tweaks.
  Revert back to the old behavior where tag macros are simply "the last line
  seen wins." This might not be what one expects in many cases but it
  is at least consistent, and changing the behavior in any
  way (such as not adding the macros for multiline-items like requires)
  breaks existing packages without a good reason.
- Correctly handling the expected %{obsoletes} etc behavior in RhBug:555926
  would require a new mechanism, such as permitting spec to access the
  (sub-)package headers. Probably doable, unlikely to be worth the
  effort as the issue can be easily avoided by writing the spec differently.
- This reverts commits 3be37d9c78 and
  e811ef56aa
2010-02-01 13:39:42 +02:00
Jindrich Novy 3be37d9c78 Concatenate multiline tags in macros only in case of
Requires/Obsoletes/Conflicts and Provides. Preserve
older behaviour for other tags.
2010-01-20 10:28:40 +01:00
Jindrich Novy e811ef56aa Correctly expand %{obsoletes}, %{requires}, etc. in spec (RhBug:555926)
- tags declared multiple times in spec were simply overwritten so
  referencing it via %{} just showed contents of the last one
2010-01-16 12:43:16 +01:00
Panu Matilainen 8fe27d49e1 Move <ctype.h> include out of system.h to the places that need it 2010-01-05 15:33:47 +02:00
Panu Matilainen dd58384ede Move <errno.h> include out of system.h to the places that need it 2010-01-05 15:25:31 +02:00
Panu Matilainen 6109d6388e Remove libcap stuff out of system.h
- just a few places need, avoid polluting everything with it
- make fsm->fcaps void * to avoid having to deal with fcap_t not defined
2010-01-05 13:29:52 +02:00
Panu Matilainen 2c6120755c Unconditionally include <sys/wait.h> where needed
- no point conditionalizing what we cant live without
2010-01-05 12:35:54 +02:00
Panu Matilainen 5c084f842a Unconditionally include <netdb.h> where needed instead of system.h
- there's no fallback for missing netdb.h so there's little point
  conditionalizing it
- avoid yet more system.h pollution
2010-01-05 11:26:14 +02:00
Panu Matilainen 834551d246 Clean up poll() vs select() tests
- move the includes out of system.h, not commonly needed
- <poll.h> is conditional as we actually provide a fallback through select(),
  but for <sys/select.h> missing there's no fallback so doesn't make
  much sense to test for (and both poll.h and sys/select.h are posix anyway...)
2010-01-04 17:15:26 +02:00
Panu Matilainen 2753a5e934 Dont include <pwd.h> from system.h, dont bother checking for it either
- no much point conditionalizing something we can't live without
- just three places need, no point polluting include space everywhere
2009-12-23 13:40:10 +02:00
Panu Matilainen a39dc445fc Dont include grp.h from system.h, dont bother checking in configure either
- no much point conditionalizing something we can't live without
- just two places need, no point polluting include space everywhere
2009-12-23 13:15:59 +02:00
Panu Matilainen 4d328c0b69 Use %{__mkdir_p} macro in build instead of hardwired RPM_MKDIR_P 2009-12-22 15:32:17 +02:00
Panu Matilainen 507f21f6bb Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)
- For now, let %{} characters through our valid character set checks
  on specs. This isn't right really, but unexpanded, unrelated macros
  in spec can now cause failure to parse out buildrequires which would
  allow those macros to be expanded. This needs a better fix.
2009-12-17 08:43:31 +02:00
Panu Matilainen 50d1b52edb Avoid exposing libmagic dependency in public headers 2009-12-08 16:22:42 +02:00
Panu Matilainen 7a2395941e Bump soname for all our libraries
- while the "really public" API of librpmio has only been enhanced,
  librpm and librpmbuild use some supposedly internal bits which *have*
  changed considerably, so just to prevent anybody thinking they can
  combine librpmio from rpm 4.7 and librpm from this...
- librpmbuild hasn't seen much real change but some (unfortunately)
  exposed struct members have changed so...
- librpm is mostly compatible but as rpmal has become internal API,
  we need to bump (annoyingly, as nothing actually uses rpmal ... sigh)
2009-12-07 13:35:53 +02:00
Panu Matilainen 1adb46a9f8 Back out overly strict file type check on %ghost files
- we currently only support creating regular files for %ghosts which
  dont exist in the buildroot, but for files that do exist in the buildroot
  there's no reason to place such limits (eg its perfectly ok to have
  symlinks marked as %ghosts)
2009-12-02 13:35:53 +02:00
Panu Matilainen cfcd1f9bd9 Dont fail build on unrecognized non-executable files (ticket #105)
- Generally only executable files are critical for dependency extraction,
  whereas oddball application data files can cause unnecessary build
  failure due to libmagic misdetections etc, so just let non-executables
  pass with a warning and mark them as unknown data
2009-11-26 10:22:41 +02: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
Panu Matilainen b6cfb4399c Fix memory leaks on error exit from parseRCPOT() 2009-10-21 12:22:33 +03:00
Panu Matilainen f677a821ad Since we really want a FILE* then get one in the first place
- this is visible in the librpmbuild exported goo, rename the member
  to force build-breakage on the poor souls trying to use librpmbuild API
2009-10-16 13:36:39 +03:00
Panu Matilainen 0a2f3e12d2 Support passing extra options to dep generator scripts 2009-10-07 12:09:00 +03:00
Panu Matilainen 468d5ab6cc Lose unused python/perl/java stringbuffers from rpmfc 2009-10-06 15:05:06 +03:00
Panu Matilainen 15fb8ccb41 Teach the internal dep generator about OCaml
- OCaml seems to have fairly well detectable magic in its files, nice
- Dont call the regular find-requires from the scripts now that internal
  is working
2009-10-06 12:34:44 +03:00
Ville Skyttä 1892984f02 Decompress lzma files with xz. 2009-10-06 10:47:36 +03:00
Panu Matilainen 4018bbd08e Allow absolute paths in file lists again (SuseBug:535594, RhBug:521760)
- patch from OpenSUSE / Michael Schroeder
- build-time generated file lists should be placed in the build directory,
  but at least one valid use case for this is things like %files -f %{SOURCE10}
2009-09-15 10:56:58 +03:00
Panu Matilainen cb2bd766de Single point of exit for doSetupMacro() to clean up freeing allocations 2009-09-14 09:48:49 +03:00
Panu Matilainen 154462928e Oops, accessing the wrong header in processBinaryFiles()
- dumb mistakes from commit 4177fdffd6
2009-09-10 17:16:12 +03:00
Panu Matilainen 0232226ab1 Minor rpmfcGenerateDependsHelper() cleanups
- initialize at declaration time, remove unnecessary variables etc
2009-09-07 17:10:12 +03:00
Panu Matilainen ec65f5e5f0 Move rl to the scope where its needed, dont bother assigning NULL 2009-09-07 17:00:49 +03:00
Panu Matilainen caa6dc91ac Single point of exit for doPatch() to clean up freeing 2009-09-07 16:59:01 +03:00
Panu Matilainen 2bdd1a5f5c Avoid theoretical NULL pointer dereference
- if sbp ends up not set it's an "internal error" really, dont bother
  with error message
2009-09-07 15:04:01 +03:00
Panu Matilainen 25d5968063 Eliminate unused counter variable 2009-09-07 11:49:25 +03:00
Panu Matilainen a912ca599c Fix dumb thinko from commit 4177fdffd6 2009-09-02 14:43:00 +03:00
Panu Matilainen e6b01b8f70 Eliminate headerGetColor() uses everywhere 2009-09-02 13:58:52 +03:00
Panu Matilainen edc5d15db4 Take advantage of new header string getters 2009-09-02 12:43:24 +03:00
Panu Matilainen 1d1b852ac9 Take advantage of new header string getters 2009-09-02 12:39:06 +03:00
Panu Matilainen 5deb850f37 Take advantage of new header string getters 2009-09-02 12:38:20 +03:00
Panu Matilainen 4177fdffd6 Eliminate uses of headerNVR() and friends in librpmbuild code 2009-09-02 11:55:42 +03:00
Panu Matilainen 7c15b12f02 Group tag inheritance doesn't need special treatment, just copy with others 2009-09-01 13:31:20 +03:00
Panu Matilainen 75c0d816a8 Add provide-extractors for fonts and desktop files
- extract mime handler capabilities from application .desktop files
- extract font family names and supported languages from font files
- both are used by PackageKit for on-demand installing of fonts and
  applications, but are useful for other things too
2009-09-01 10:52:12 +03:00
Panu Matilainen 457606983f Further file-classifier tweaks
- disable "known tokens" lookups in ascii files, this is way too unreliable
  to do anything but cause pain
- consider text files as RPMFC_TEXT consistently
- font metrics files are not fonts
2009-09-01 10:40:50 +03:00
Panu Matilainen c3770c9404 Make internal file classifier look into compressed files
- prerequisite for various things like font provide extraction
- at least libmagic from file-5.00 leaked fd's with MAGIC_COMPRESS,
  this has been fixed as of file-5.03
2009-09-01 10:31:44 +03:00
Panu Matilainen 0c4e48de79 Replace equal/not equal uses of str[n]cmp() with rstreq[n] in build code 2009-08-31 11:08:05 +03:00
Panu Matilainen 3ae20cd53d We always add EVR and Flags to dependencies, remove bogus condition 2009-08-20 13:04:21 +03:00
Panu Matilainen 10772ac7df Fix duplicate dependency checking on build
- Broken by commit af8b41c64a which
  simplified too much.
- There's no guarantee that rpmdsNew() returns a sorted dependency set
  so rpmdsFind() doesn't work correctly here. Walk the ds manually instead.
- With multiple triggers of same type, identical trigger conditions on
  different trigger script were seen as duplicates (RhBug:490378)
- Split the duplicate checking to separate helper function for clarity
2009-08-20 13:02:05 +03:00
Panu Matilainen 634a67d055 Copy BUGURL to source rpm's too
- should've been in commit 86032bfbb6, duh
2009-08-18 11:46:12 +03:00
Panu Matilainen d8cde273e5 Avoid adding Lua sources and patches twice when recursing (ticket #82)
- parseSpec() operates on newly created empty spec structures even when
  "recursing" but the lua variables are global and need recursion
  protection to avoid adding multiple times
2009-08-17 12:07:48 +03:00
Panu Matilainen 3fc58248d2 Add default %clean section unless overridden in spec (ticket #81)
- avoids silly clutter in every specfile in the regular case but permits
  overriding if needed for whatever reason
- it's a spec behavior change but mostly backwards compatible:
  existing specs will do whatever the %clean does, and if you need to avoid
  calling %clean for whatever reason just keep an empty %clean in the spec
2009-08-17 11:22:16 +03:00
Ville Skyttä 859dd6d4d2 Add -d option to %patch. 2009-08-14 11:37:39 +03:00
Panu Matilainen 86032bfbb6 Add an option bug reporting URL tag to packages (RhBug:512774) 2009-08-13 15:45:56 +03:00
Jindrich Novy 241581a93e rpmbuild won't segfault when %including spec with zero size 2009-08-12 16:06:08 +02:00
Jindrich Novy f6982a403b Correctly inherit default %attr(-,-,-) attributes from %defattr (rhbz#515685) 2009-08-06 14:16:02 +02:00
Panu Matilainen 69702c1de3 Kill off lclint remnants everywhere
- remove ancient and likely irrelevant LCL comments and bogus NULL checks
2009-07-23 12:24:10 +03:00
Panu Matilainen 2db564a85a Fix compiler warning on const free
- we dont need popt to set the file variable as we manually process
2009-07-09 09:28:45 +03:00
Panu Matilainen edbc9ead96 Base64-encode %policy files to ensure it can be presented as strings
- RPMTAG_POLICIES is a string array but there's no guarantee that
  something marked %policy is a plaintext file that can be represented
  as \0-terminated string, base64-encoding them fixes that. Baby steps
  towards making %policy remotely usable, related to RhBug:505066.
- Also remove unnecessary failure code setting, processMetadataFile()
  assumes failure already, and dont try to insert NULL strings in case
  b64encode() or pgpArmorWrap() fails
2009-06-26 12:31:57 +03:00
Jindrich Novy b028930925 Teach %files to accept multiple filelists (ticket #70, rhbz#475359) 2009-06-23 11:05:06 +02:00
Jindrich Novy 27263f94bd Allow ':' character in EVR, it's needed for Epoch separation 2009-06-23 11:02:51 +02: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 4e331d1dbb Add new function to check valid characters in NVR (ticket #59) 2009-06-10 11:52:53 +02:00
Jindrich Novy 53e48bc469 Nuke useless compatibility stuff and put V/R checking where it belongs 2009-06-10 09:16:45 +02:00
Jindrich Novy 7653f77013 Make whitelist of characters allowed in NVR (ticket #59, rhbz#493157) 2009-06-09 10:31:03 +02:00
Panu Matilainen 27d1f56f29 depMsg doesn't need _notpre() anymore 2009-06-01 15:32:26 +03:00
Panu Matilainen 4cf62df108 Remove leftover build/TODO file from 1998 / rpm 2.5 era... 2009-06-01 14:54:59 +03:00
Panu Matilainen 4913f48d08 Generate spec part string lengths at build time and make it const 2009-06-01 14:48:58 +03:00
Panu Matilainen 317533ce31 Generate preamble tag lengths at build time and make it const 2009-06-01 14:45:44 +03:00
Panu Matilainen 7c98cfb220 Issue deprecation warnings for PreReq and BuildPreReq 2009-06-01 13:39:00 +03:00
Panu Matilainen c0ed5b0a35 Turn unused spec syntax obsoletion mechanism into deprecation warning 2009-06-01 13:37:20 +03:00
Panu Matilainen 95c9e817ef Map PreReq into Requires(pre,preun) at build
- this gives a more reasonable mapping to former behavior of PreReq
  when cutting loops
2009-06-01 13:28:50 +03:00
Panu Matilainen 03e456de4a Build prereq is exactly the same as buildrequires 2009-05-29 11:03:33 +03:00
Panu Matilainen cdfd093484 Fix calculation of hardlinked files (RhBug:503020)
- regression from commit 899dfb5892,
  size of hardlinked file set is the size of one file of the set
- add isHardLink() internal helper to avoid a copy-paste code
2009-05-29 09:02:44 +03:00
Jindrich Novy c7523b4c52 Require file attributes in spec if %ghost files are missing from build root 2009-04-20 13:23:30 +02:00
Jindrich Novy e7ce53c3ae Introduce changelog trimming in binary packages feature (ticket #47) 2009-04-16 14:13:34 +02:00
Panu Matilainen 0f967d157d Error out at build on unsupported payload compressors (rhbz#495429)
- only permit bzip2/lzma/xz payload compression if rpm built with the
  necessary libraries
2009-04-13 13:58:39 +03:00
Jindrich Novy 07524b67b6 Don't require %ghost file presence in build root (rhbz#495040) 2009-04-10 11:27:49 +02:00
Jindrich Novy 2566a70b0a Remove file flags that have never been enabled 2009-04-09 14:48:02 +02:00
Jindrich Novy 37a35d0721 Don't allow '~', '/' characters and ".." sequence in NVR (rhbz#493157) 2009-04-06 10:20:47 +02:00
Panu Matilainen e38cbe5b4e Prefer more specific types over generic "text" in classification (rhbz#491349) 2009-03-31 13:14:08 +03:00
Panu Matilainen 54b027535f Don't try to parse %patch on spec query (rhbz#487855) 2009-03-18 14:53:34 +02:00
Panu Matilainen fa0898552d Add support for "lzma alone" compression format (lzdio)
- "lzma alone" is superseeded by XZ but it's used by Suse and Mandriva
  distros so it's nice to have as it doesn't need much, only open differs
  from XZ
- rpmlib() dependency versions are an uuuuuuuugly mess here: Suse used
  "PayloadIsLzma = 4.4.2-1" so that's what we provide to be most compatible
  (hopefully). Built packages require "PayloadIsLzma <= 4.4.6-1" however
  to be compatible with Mandriva 2008.0. Did I already say it's ugly?
- Based on similar patch in Mandriva by Per Øyvind Karlsen, but avoiding
  unnecessary renames in rpmio
2009-03-18 11:24:52 +02:00
Panu Matilainen 8078d0ba24 LZMA -> XZ renaming
- what we support now in payloads is XZ, not the former LZMA format, rename
  user- and header-visible parts to match this
- rpmlib(PayloadIsXz) dependency versioned 5.2-1 to avoid unnecessary
  incompatibility with what rpm5 has and what Mandriva is already using
- only provide the rpmlib dependency if actually built with xz support
- rpmFileIsCompressed() attempts to guess the magicless old lzma format
  by file suffix, so it can handle both right now
2009-03-18 09:42:23 +02:00
Panu Matilainen 23d202e928 Plug a memleak in genCpioListAndHeader() 2009-03-11 21:43:44 +02:00