Commit Graph

1802 Commits

Author SHA1 Message Date
Panu Matilainen 15dc6ebc30 Whoops, flags needs to be sorted for argvSearch() to work correctly 2011-05-23 12:32:27 +03:00
Panu Matilainen c6e81eeff9 Unify fileattr include- and exclude-rule handling
- Handling both rule-types identically not only makes things more
  consistent but also adds exclude_flags support practically for free:
  "exeonly" and "magic_and_path" are usable for excludes too now, ditto
  for any other flags that might be added in the future.
2011-05-23 11:36:24 +03:00
Panu Matilainen d9d1a1bdad Don't fetch missing sources on spec query 2011-05-20 15:20:49 +03:00
Jindrich Novy 3a10220715 Unbreak %if, %if(n)arch, %if(n)os handling
- having those expressions without argument is no more allowed
- white space between expression and argument is mandatory
- rpmbuild no more confuses %ifabcd macro with %if abcd
- fix criptic message in case of invalid %if condition
2011-05-20 13:55:39 +02:00
Michael Schroeder f17e10f870 Support "magic_and_path" flag in fileattrs
- Allow "magic_and_path" flag to configure that files must
  match both regexpes to be sent to the dependency generator.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-05-19 14:57:30 +03:00
Panu Matilainen e0213a13df Remove redundant NULL checks
- Fclose() handles NULL by itself, no need to check in callers.
  Also no need to NULL'ify the local variables here.
2011-05-19 11:08:07 +03:00
Panu Matilainen 63ee1e735a Fix error handling in payload copying
- Lift the payload copy into a separate helper function to clean
  things up a bit
- The code to handle read errors was unreachable before this,
  causing any read error (rare as they might be) to be silently
  ignored and package generation considered successful.
- This could/should perhaps use ufdCopy() instead but that ha
  its own set of problems (not clean wrt large files, error reporting...)
2011-05-18 16:01:47 +03:00
Panu Matilainen ab3337e4f6 Eliminate dead cpio_copy() + related stuff
- These code-paths cannot have been hit since readRPM() was
  killed, mop out the leftovers
2011-05-18 15:11:42 +03:00
Panu Matilainen 96bfbe0486 Further simplify & cleanup script file (error) handling
- Simply always call addFileToFoo() and handle no scriptfile condition
  as early success case there (and allocate sb only if actually needed).
- Consolidate error logging into addFileToTagAux(), removing the need
  for umphteen nearly identical rpmlog error messages + related logic.
- Eliminate the now pointless addFileToFoo() wrapper functions
  and just call the main thing directly.
2011-05-18 13:36:14 +03:00
Panu Matilainen 4030d4b9d9 Clean up addFileToTagFoo() helpers
- Centralize the work into addFileToTagAux(), turning the other
  two helpers into dumb wrappers with the only difference being
  append or no append. This simplifies and clarifies the exit
  codes, stringbuf allocations etc a good deal.
2011-05-18 12:47:50 +03:00
Panu Matilainen 4cc33f0670 Minor cleanups to cpio_doio()
- Remove redundant rpmtsEmpty(), this is done from rpmtsFree() anyway
- Dont bother NULL'ing local variables at exit
2011-05-18 12:04:12 +03:00
Panu Matilainen 765cbedce4 Simplify rpmio flags handling in writeRPM() / cpio_doio()
- The payload macros are already expanded in writeRPM(), no point
  re-expanding in cpio_doio() and handle fallback to default gzdio
  in writeRPM() already in case the payload is not set in config
  or is bogus. Also rpmExpand() cannot return NULL so there's no
  point in checking for that.
2011-05-18 11:55:59 +03:00
Tero Aho fc56d98f5d Plug a minor memleak on writeRPM() error paths
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-05-18 11:10:09 +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
Michael Schroeder 39800e901e Fix segfault on build with empty %prep section
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-05-16 11:57:44 +03:00
Ville Skyttä e254f9b9d4 Add lrzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-29 08:49:05 +03:00
Ville Skyttä bcad08867d Add lzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-29 08:48:56 +03:00
Jindrich Novy 756aea37fe Do not compile unused functions when SELinux support is disabled 2011-04-22 09:30:45 +02:00
Jindrich Novy e0c941ab51 Attempt to fetch sources/patches when they are missing from %_sourcedir
- use _default_source_url macro to specify default URL when it is
  missing from the spec Source/Patch line
- this feature can be disabled by defining _disable_source_fetch to 1
2011-04-19 13:24:34 +02:00
Jindrich Novy 94fb6eed6a Don't list packages which will not be created in spec query (RhBug:693338)
- particularly, while doing "rpm -q --specfile <a spec file>"
2011-04-04 16:03:11 +02:00
Jindrich Novy 9ba7b7a178 Fix cpio_doio()
- do not propagate incompatible error codes to cpioStrerror()
- plug possible memleak while creating transaction set
- clean up
2011-03-15 17:58:31 +01:00
Jindrich Novy cc23fdcaaa Clean up rpmfcClassify()
- don't check return values of functions that cannot fail
- remove "can't happen" asserts
- fail in case of empty file classifier
2011-03-14 15:37:00 +01:00
Jindrich Novy eb7be49dfa Clean up rpmfcApply() and rpmfcHelper() 2011-03-10 16:46:22 +01:00
Jindrich Novy 842c987486 Clean up rpmfcExec() 2011-03-09 08:16:46 +01:00
Jindrich Novy a1da07e60d Yet remove some unused variables to suppress warnings 2011-03-04 13:34:38 +01:00
Panu Matilainen 53f8ce9ff0 Make rpmspecQuery() return match the description
- It's supposed to return the number of errors, instead of silently
  ignoring errors from qva->qva_showPackage() to unused variable,
  count them. That qva->qva_showPackage() currently never returns
  errors is another story...
2011-03-04 12:52:59 +02:00
Jindrich Novy dc3116a581 Actually propagare failure when addOrAppendListEntry() fails,
add missing headerGet() check.
2011-03-04 05:38:32 +01:00
Jindrich Novy a6026437f2 Define variables in processBinaryPolicies() only if they are needed 2011-03-04 04:56:26 +01:00
Jindrich Novy 00274a017c Add missing exit status check for waitpid() while executing scriptlets 2011-03-04 04:43:32 +01:00
Panu Matilainen 771993d1fc Fix braindamage in the depgen helper collector loop (RhBug:675002)
- Read any remaining data before exiting on SIGCHLD
- Only perform one read() per loop, otherwise it could block
- Handle EINTR while read()'ing
2011-02-21 08:47:52 +02:00
Michael Schroeder 81acadbf1f Allow uncompressed payload in packages
- An example of a package where uncompressed payload is useful is
  out "installation-images" package. It's a meta package that is
  not shipped to customers, but used for image creation purposes.
  Compression just slows down the build process.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-02-15 14:39:29 +02:00
Panu Matilainen d7e2a04d68 Teach rpm about post-transaction dependencies
- %posttrans dependencies have their own peculiar semantics, they're
  install-only dependencies which have no implications on ordering.
2011-01-25 15:27:28 +02:00
Panu Matilainen 6977e09556 Restore default SIGPIPE handling for build scriptlets (RhBug:651463) 2011-01-21 09:57:36 +02:00
Panu Matilainen b76fa1a7fd Require %files section for package generation again
- Turns out this change does more harm than good, people are actually
  relying on this behavior to avoid zillion conditionals in the spec.
  We'll want a saner way to conditionally disable/enable packages
  but until we have that, revert to the former longstanding behavior.
- This effectively reverts commit d010ec1c90
2010-12-23 09:24:25 +02:00
Panu Matilainen 50ab0945c5 Unbreak file user/groupname handling in build
- Fixes regression from commit a2d002a34b,
  the librpmbuild "name cache" was used for unique string storage too
  and not just user/group-info lookup cache, duh.
- At least for now, making this separation explicit in the code
  by separating the "stash this string" operation from the actual
  user/group lookups.
2010-12-16 09:40:27 +02:00
Panu Matilainen bc457015f6 Remove the now unused user/group caching code 2010-12-15 09:44:54 +02:00
Panu Matilainen a2d002a34b Unify the user+group caching between librpm and librpmbuild
- The build version has getUidS() and getGidS() for which there is
  no counterpart in the rpmug api but there's not much point to them:
  they check whether the user/groupname exists but return our own
  string back to us even if it doesn't.
- The build version also caches more than current rpmug, but has an ugly
  hardwired limit causing (in theory) errors that can't be nicely
  handled, and is the last piece relying on RPMLOG_CRIT actually
  terminating the process. The librpm version doesn't fail, in the
  worst case its just a bit slower. And that can be fixed anytime by
  making it to use hash tables for caching.
2010-12-15 09:30:56 +02:00
Panu Matilainen 5c43095e1d Implement transaction ordering hinting
- Add support for new "OrderWithRequires: foo" spec syntax
  which has "if and only if foo is present in transaction, order
  the transaction as if this package required foo" semantics.
  While it looks, and in some ways is, a soft dependency, this
  is not the same as recommends/suggests etc: those have unknown
  depsolver policy dependent semantics attached to them, whereas
  ordering hints have a clear definition and is only relevant for rpm
  itself, depsolvers should not even look at the data.
- This allows packages to express correct ordering for optional
  functionality, such as

      %post
      if [ -x %{_bindir}/register-component ]; then
          %{_bindir}/register-component %{name}
      fi

  If the package containing %{_bindir}/register-component is included
  in the same transaction, it makes sense to have it installed before the
  package(s) that use it. But as it is fully optional, Requires would
  not be appropriate. Using OrderWithRequires allows this to be expressed
  without dragging in extraneous dependencies for optional functionality.
2010-12-13 12:26:06 +02:00
Panu Matilainen 185de18526 Implement filtering of autogenerated dependencies
- This allows both excluding entire paths from dependency generation
  and also excluding individual generated dependencies by regexes
  settable from spec or other configuration.
- %__(provides|requires)_exclude regex controls is matched against
  generated dependencies, %__(provides|requires)_exclude_from is
  matched against the currently processed path, with buildroot
  stripped out.
- We'll probably want some "higher level" macros to go with this,
  but the mechanism is usable as-is already.
2010-12-10 16:57:36 +02:00
Panu Matilainen 27a17ec74a Some further preliminaries for next bits
- Add a helper function for freeing regex pointers
- Move regMatch() to top of rpmfc.c, we'll need it shortly
2010-12-10 16:12:06 +02:00
Panu Matilainen ca3089f8bc Refactor the helper execution out of rpmfcHelper()
- Split the macro name generation and grabbing of argv-style output
  into yet another helper to reduce the clutter in rpmfcHelper()
  before adding more stuff in there.
2010-12-10 14:14:44 +02:00
Panu Matilainen a9bc1f51ae Rename pattern -> path for, duh, path patterns
- 4.9 alpha used "pattern" but better fix the stupid name now than
  have to live with the non-obvious name forever
2010-12-10 12:33:46 +02:00
Panu Matilainen f5a657112a Support excluding by path or magic in file classification
- %__foo_exclude_pattern and %__foo_exclude_magic regex'es now allow
  excluding attributes that would otherwise match.
2010-12-10 12:00:50 +02:00
Panu Matilainen 17445a390a Remove broken versioned provides rpmlib() tracking
- Every single package since rpm >= 3.0.4 or so has a versioned provide
  through the automatically added N = VR provide, which hasn't gotten
  tracked in all these years. Drop the useless dependency.
2010-12-10 10:36:45 +02:00
Panu Matilainen ed950990c4 Bump library sonames
- Lots and lots of API changes, including what amounts to
  rewriting of librpmbuild external API... The only exception is
  librpmsign which is new and starts with 0
2010-12-03 14:09:09 +02:00
Panu Matilainen 534f512002 Fix bogus error reporting from autogenerated dependencies (ticket #181)
- Automatically generated dependencies do not relate to spec lines,
  use different error reporting for manually vs automatically added
  dependencies.
2010-12-01 17:15:18 +02:00
Panu Matilainen 801a5790d1 Pass RPM_BUILD_ROOT to helper scripts through environment always
- Many of the scripts need to know the buildroot in order to figure
  out correct resulting paths. This permits unifying the current
  adhoc methods of passing the data to the scripts.
2010-12-01 11:18:19 +02:00
Panu Matilainen a66ca57369 Remember buildroot directory in rpmfc struct
- New constructor rpmfcCreate() which takes buildroot as an argument,
  and "flags" argument for future use. Calculate brlen at initialization
  now that we can.
- Preserve rpmfcNew() as a compatibility wrapper as it's something
  somebody could, in theory, have used legitimately.
2010-12-01 11:09:02 +02:00
Panu Matilainen ab68421992 Eliminate unused dir argument to getOutputFrom() 2010-12-01 09:31:07 +02:00
Panu Matilainen 3f5c10e9f6 Plug a minor memory leak in librpmbuild doPatch() 2010-11-17 15:54:38 +02:00
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