platform/upstream/rpm.git
11 years agoUse addReqProv() for adding package self-provides too
Panu Matilainen [Tue, 16 Apr 2013 06:53:58 +0000 (09:53 +0300)]
Use addReqProv() for adding package self-provides too

- We have a function for this stuff so use it. This also ensures
  the per-package rpmds'es and the data in header stay in sync
  and that manually added self-provides wont cause duplicates.
(cherry picked from commit e4b7d44eac71dc4c26b5254f357d8ad786592c8c)

11 years agoUse string pool id instead of string for package lookup
Panu Matilainen [Tue, 16 Apr 2013 05:58:59 +0000 (08:58 +0300)]
Use string pool id instead of string for package lookup

- Comparing integers is cheaper than strings, but this is a fairly
  marginal win in practise.
(cherry picked from commit 89ff1ca2d97d34f65dac52d7eec24f072dfe0e28)

11 years agoUtilize the shared string pool for manually specified dependencies
Panu Matilainen [Tue, 16 Apr 2013 04:51:01 +0000 (07:51 +0300)]
Utilize the shared string pool for manually specified dependencies

- Brings the texlive.spec parse time down from 4.8s to 3.6s on my
  laptop. Not bad for a one-liner.
(cherry picked from commit 304924b10099733cf7f677b670c356593d165bbc)

11 years agoAdd a spec-level shared string pool to spec and package structs
Panu Matilainen [Tue, 16 Apr 2013 04:48:35 +0000 (07:48 +0300)]
Add a spec-level shared string pool to spec and package structs
(cherry picked from commit 948f85fb8ff51fb50df51b0a1f0691101e48a16f)

11 years agoExport the pool-aware rpmds constructors
Panu Matilainen [Tue, 16 Apr 2013 04:42:04 +0000 (07:42 +0300)]
Export the pool-aware rpmds constructors

- Private pools can be very expensive when constructing and tearing
  down dependency sets by the masses. Permit taking advantage of
  shared pool outside librpm internals.
(cherry picked from commit 541234b02ea8bcdd0da0a2a43eb099f7ecc9869c)

11 years agoAvoid umphteen arguments to isNewDep() by creating the new ds earlier
Panu Matilainen [Tue, 16 Apr 2013 04:38:01 +0000 (07:38 +0300)]
Avoid umphteen arguments to isNewDep() by creating the new ds earlier
(cherry picked from commit 0dd6e4491be69f4fc3074ae3859fb03fd6226a41)

11 years agoOptimize lookupPackage() a bit
Panu Matilainen [Tue, 16 Apr 2013 04:14:10 +0000 (07:14 +0300)]
Optimize lookupPackage() a bit

- Remember the name of sub-packages in the Package struct, avoiding
  the need for headerGetString() in a loop, and also avoid unnecessary
  strdup() in the case name is not a partial one.
- Somewhat hysterically, this more than halves the time to parse the
  infamous texlive.spec on my laptop: the parse time is down from
  10.2s to 4.9s.
(cherry picked from commit 9929459f9967ecfe0a05d557bc42531944faa70a)

11 years agoSanitize duplicate dependency checking at build
Panu Matilainen [Mon, 15 Apr 2013 14:42:49 +0000 (17:42 +0300)]
Sanitize duplicate dependency checking at build

- Creating a new rpmds from header each time isNewDep() gets hideously
  expensive when the number of manual dependencies is high.
  Add prco etc rpmds structs to each package and use those to determine
  whether a dependency has already been seen: this way the ds'es remain
  sorted so rpmdsMerge() will do the right thing for regular
  dependencies. Triggers are somewhat different beasts with their
  index tags so at least for now just do a linear search like we
  always did for correctness.
- Makes worlds of difference for complex specs... the time to parse
  texlive.spec from Fedora goes down from ~27s to ~10s on my laptop
  with this change.
(cherry picked from commit d642df2a5c5913010dae5b5b6a043359325cf055)

11 years agoMake rpmdsMerge() return something meaningful
Panu Matilainen [Mon, 15 Apr 2013 14:35:29 +0000 (17:35 +0300)]
Make rpmdsMerge() return something meaningful

- The API documentation was always incorrect and meaningless, as
  rpmdsMerge() can merge any number of entries so there's no single
  index to return. Instead return the number of merged entries
  and adjust the docs to match the new behavior.
- This is of course an incompatible API change in a strict sense,
  but then since the documentation was always wrong to begin with
  anybody looking at rpmdsMerge() return is relying on undocumented
  behavior really. The compatible way to use this is to check
  for < 0 for errors and assume success otherwise.
(cherry picked from commit a48b11edbd00c4f0dbdd3462e659dd1d3bcf21ac)

11 years agoFix ages old bug in rpmdsFind() wrt flags
Panu Matilainen [Mon, 15 Apr 2013 14:16:27 +0000 (17:16 +0300)]
Fix ages old bug in rpmdsFind() wrt flags

- EVRs are pointers which in theory could be NULL so checking them
  is appropriate, but 0 is a perfectly legal value for flags and
  the bogus "NULL check" causes it to get things wrong if either or both
  flags are RPMSENSE_ANY
(cherry picked from commit 83844d55cd18a469966a80ca7807f2c6339f9bfb)

11 years agoHandle source vs binary pkg dependency difference in handlePreambleTag()
Panu Matilainen [Mon, 15 Apr 2013 12:31:37 +0000 (15:31 +0300)]
Handle source vs binary pkg dependency difference in handlePreambleTag()

- We know perfectly well at handlePreambleTag() already whether something
  should go to binary or source package, pass the right pkg to
  parseRCPOT() so we dont need to fiddle with it there.
(cherry picked from commit 29813d418d0f9a255047353d0b163fb21fe943ad)

11 years agoPass the entire package struct to addReqProv()
Panu Matilainen [Mon, 15 Apr 2013 12:23:37 +0000 (15:23 +0300)]
Pass the entire package struct to addReqProv()

- Still doesn't make much difference as it is, but further pre-requisites
  for sanitizing the way dependencies are carried around.
- Change rpmSpecDS() to return the ds based on the actual source package
  header, not buildRestrictions. Using buildRestrictions was probably
  kinda wrong to begin with but its more so now as the actual
  requires and conflicts go to the "real" header, not buildRestrictions.
(cherry picked from commit 42b2f78e724e02d677974314d460cc6dec5cbc5b)

11 years agoUse newPackage() to initialize source package too
Panu Matilainen [Mon, 15 Apr 2013 12:16:11 +0000 (15:16 +0300)]
Use newPackage() to initialize source package too

- As newPackage() initializes the pkg header too, we now need
  a different way of checking whether initSourceHeader() has
  already been called. Checking RPMTAG_NAME should suffice for the job...
(cherry picked from commit 0db12898c5d270fd4bbc7b4bad677dee4f34a617)

11 years agoOnly pass the target package list, not entire spec, to newPackage()
Panu Matilainen [Mon, 15 Apr 2013 11:52:40 +0000 (14:52 +0300)]
Only pass the target package list, not entire spec, to newPackage()

- Its mildly hysterical either way, but it doesn't actually need
  the whole damn spec. More importantly allow passing NULL for
  "independent" package entities.
(cherry picked from commit c78c03d31289fb6a11537eb87b47c0a48a8dcb0d)

11 years agoPass the entire package struct to rpmlibNeedsFeature()
Panu Matilainen [Mon, 15 Apr 2013 11:08:24 +0000 (14:08 +0300)]
Pass the entire package struct to rpmlibNeedsFeature()

- Doesn't make much difference as it is, but pre-requisites for
  sanitizing the way dependencies are carried around.
(cherry picked from commit 0252fdf04884da7b7d2437eeb8e6ca8c697d902a)

11 years agoPass the entire package struct to genCpioListAndHeader()
Panu Matilainen [Mon, 15 Apr 2013 11:04:40 +0000 (14:04 +0300)]
Pass the entire package struct to genCpioListAndHeader()

- Again simplifies things by having less junk to pass around,
  but more importantly paving way for next steps...
(cherry picked from commit 4d7f6363b20f896c79749ef801eb657ecdc03103)

11 years agoEliminate the cpioSourceArchive struct
Panu Matilainen [Mon, 15 Apr 2013 10:53:45 +0000 (13:53 +0300)]
Eliminate the cpioSourceArchive struct

- Store archive size in the package struct, and now we can just
  axe the kinda hysterical CSA foobar, much simpler and saner this way
(cherry picked from commit 36826b8c0d666f934f32745653dd4f0f67036644)

11 years agoPass the entire package struct to cpio_doio() too
Panu Matilainen [Mon, 15 Apr 2013 10:48:12 +0000 (13:48 +0300)]
Pass the entire package struct to cpio_doio() too

- The CSA thing is nearly useless now...
(cherry picked from commit 25e2129dea56252ae7df07b7f3229f721cb1a275)

11 years agoPass the entire package struct to writeRPM()
Panu Matilainen [Mon, 15 Apr 2013 10:44:09 +0000 (13:44 +0300)]
Pass the entire package struct to writeRPM()

- Simplifies things a little bit, but mostly this is just paving
  way for next steps. Shouldn't change anything in practise.
(cherry picked from commit 790cb67b7f83c31b919ac50e48b83dd5b82fb0a3)

11 years agoUse struct Package for source package too
Panu Matilainen [Mon, 15 Apr 2013 10:23:48 +0000 (13:23 +0300)]
Use struct Package for source package too

- Makes the src.rpm that little bit more like other packages.
  Doesn't make things any saner here but we'll want to pass around
  package structs instead of headers later on.
(cherry picked from commit a3e35ad4c798c8d6e60444df4f146118599478d6)

11 years agoMove rpmlibNeedsFeature() and addReqProv() prototypes
Panu Matilainen [Mon, 15 Apr 2013 09:42:34 +0000 (12:42 +0300)]
Move rpmlibNeedsFeature() and addReqProv() prototypes

- rpmbuild_misc.h is just internal misc helpers whereas the
  dependency stuff has very much to  do with packages and the
  like. No functional changes, just clearing up stuff...
(cherry picked from commit 6d361d55d6e03bb1444e397f7c2d80edb307d601)

11 years agoReport replaced files in verification
Panu Matilainen [Fri, 12 Apr 2013 09:40:37 +0000 (12:40 +0300)]
Report replaced files in verification

- Unlike other file states, replaced state is always a forced one
  and thus a likely problem. Always report replaced files in verify
  output by appending the state to the verify line, similar to
  strerror() for unexpected errors. In verbose mode, report all
  non-normal file states.
- Like any output change, this can potentially break user scripts but
  at least this way the breakage should be minimal as regular output
  does not change, and similarly appended error strings have been
  present since 4.4.x days.
(cherry picked from commit ebeb53314d73a9a77d9e377ccfd6d388c11a82dd)

11 years agoHandle fork(), pipe() etc failures in signing passphrase check
Panu Matilainen [Fri, 12 Apr 2013 06:52:36 +0000 (09:52 +0300)]
Handle fork(), pipe() etc failures in signing passphrase check

- Actually check the return codes from various things and handle
  the failures. This is nowhere near 100% correct still, but
  at least within spitting distance from the ballpark.
- Incidentally this eliminates the last compiler warning on the rpm
  codebase with current gcc (4.8.0), wohoo.
(cherry picked from commit 7fd03b0abf0e9522890d1602867f3264b01e9961)

11 years agoHandle fork(), pipe() and dup2() failures in prelink helper launch
Panu Matilainen [Fri, 12 Apr 2013 06:19:35 +0000 (09:19 +0300)]
Handle fork(), pipe() and dup2() failures in prelink helper launch

- Actually check the return codes from the stuff that matters and
  deal with failures. Incidentally also eliminates a compiler warning
  from set-but-not-used variable...
(cherry picked from commit ae58a02861977d3a71a68bc1851cd0a70ec889f0)

11 years agoPrint out %pretrans and %posttrans dependencies too when building
Panu Matilainen [Wed, 10 Apr 2013 08:59:32 +0000 (11:59 +0300)]
Print out %pretrans and %posttrans dependencies too when building
(cherry picked from commit 427477fb3bc811fe8131c1a58f761a547645e610)

11 years agoFix python binding build on python 3
David Malcolm [Wed, 10 Apr 2013 06:47:11 +0000 (09:47 +0300)]
Fix python binding build on python 3

- Fixes PyString caused breakage from commit
  cb84c0db42db105116072cb71d89152e885e2e2c

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 5fc863ee1e28479accb0e034442f88d15de84031)

11 years agoFinish lua 5.2 support, trac #865
Johannes Dewender [Thu, 4 Apr 2013 17:11:48 +0000 (19:11 +0200)]
Finish lua 5.2 support, trac #865

Lua52 support was started with ac959fed0082cb253d45c7a04866e8654e962442.

Compilation tested with Lua 5.2.1 and Lua 5.1.5.

The short typerror() snippet is taken from luaL_typerror in Lua 5.1.5
(MIT license)

Signed-off-by: Johannes Dewender <rpm@JonnyJD.net>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit cd7ca60a6ca97d9b363c2bf25dfd156cb95f877c)

11 years agoClarify the macro entry struct a bit
Panu Matilainen [Thu, 4 Apr 2013 08:22:22 +0000 (11:22 +0300)]
Clarify the macro entry struct a bit

- Macro name, opts and body must not be freed or otherwise written
  to after initialization, make them const pointers to clarify
  (and enforce) this. Arena is used to store whatever we need: it
  always contains the macro body, sometimes also name and/or opts,
  but these can be pointers to elsewhere too.
(cherry picked from commit a944143cf54fb5f41b18949a9c6324d22f382274)

11 years agoImprove macro table performance
Alexey Tourbin [Sun, 27 Jan 2013 20:20:10 +0000 (20:20 +0000)]
Improve macro table performance

In the existing implementation, when a new macro is added, the whole
table has to be sorted again.  Hence the cost of adding n macros is
worse than O(n^2), due to arithmetic progression.

This change drops all qsort(3) stuff altogether, by carefully preserving
table in sorted order.  In findEntry routine, bsearch(3) is replaced
with customized binary search which tracks position for insertion.
In the addMacro routine, if a matching entry is not found, this
position is used for direct insertion, after the rest of the elements
are "shifted to the right" with memmove(3).  Likewise, in delMacro
routine, the elements are shifted back to the left when the last macro
definition is popped.  Technically, shifting half of the array with
memmove(3) is still O(n^2); however, modern CPUs process contiguous
memory in a very efficient manner, and glibc provides a fine-tuned
memmove(3) implementation.

Also, macro table entries are now allocated in a single chunk.

This change reduces rpm startup costs by factor of 6.  Also, this change
improves specfile parser performance by a factor of 2 (e.g. the parse
time of texlive.spec is reduced from 67s to 35s).

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 301d5450a1c7849f9eb4ead11d00c8a20ea6a6bd)

11 years agoRemove -K/--checksig related leftover in the manual (RhBug:708734)
Panu Matilainen [Wed, 27 Mar 2013 07:43:12 +0000 (09:43 +0200)]
Remove -K/--checksig related leftover in the manual (RhBug:708734)
(cherry picked from commit 307a1c0b77a4ff99dde5c4b577fca17cd81e10a1)

11 years agoAdd a simple --rebuilddb test-case
Panu Matilainen [Wed, 27 Mar 2013 04:26:39 +0000 (06:26 +0200)]
Add a simple --rebuilddb test-case
(cherry picked from commit 08e27ffe8fdea04d1c148b8b1c4ed46153d52f03)

11 years agoTest rpmmi pattern match too while testing for the single instance thing
Panu Matilainen [Tue, 26 Mar 2013 10:55:53 +0000 (12:55 +0200)]
Test rpmmi pattern match too while testing for the single instance thing
(cherry picked from commit 56028aab2bdd7d09e5b75223c00fff37167f6bc8)

11 years agoAdd a testcase for db iterator locked to single instance number
Panu Matilainen [Tue, 26 Mar 2013 10:36:15 +0000 (12:36 +0200)]
Add a testcase for db iterator locked to single instance number

- Back in the day, this case used to cause an endless loop. Just
  making sure we dont end up with such stupidity again...
(cherry picked from commit 035c52d2f4e58176ee90266b43367d32c5ae3d32)

11 years agoAccept Python longs as db instance number too
Panu Matilainen [Tue, 26 Mar 2013 10:34:27 +0000 (12:34 +0200)]
Accept Python longs as db instance number too

- Prior to this, trying to retrieve a db instance by number gotten
  from header['dbinstance'] would fail with unknown key type, doh.
(cherry picked from commit 409fb9daea495fb88b9cecaa0a053ad738a625cf)

11 years agoAdd test-case for explicit file conflict variants
Panu Matilainen [Wed, 20 Mar 2013 10:50:48 +0000 (12:50 +0200)]
Add test-case for explicit file conflict variants

- Three-way tests for explicit (aka manually added) file conflicts:
  conflict within added set, and conflict in transaction <-> database.
- The problem message rpm creates for the third case is pretty bad,
  it misses the fact its on an installed package and gets the name
  wrong too. Better than not detecting though, and the message has
  been broken for a long time so not related to the recent other
  changes.
(cherry picked from commit 909aab0916ef851ea78df4dbd7bd8c9d2045c7ab)

11 years agoAdd a file to the dependency test-case spec
Panu Matilainen [Wed, 20 Mar 2013 09:49:35 +0000 (11:49 +0200)]
Add a file to the dependency test-case spec

- To be able to test file-dependencies it needs some files too...
- Adjust dependency problem verify case to avoid looking at files
  (user+group will always be wrong in the test suite). So it actually
  serves as --nofiles testcase now too.
(cherry picked from commit 35cf3112f12d30660614258183a6cbf2e0fbf953)

11 years agoPlug another hole in conflicts and obsoletes handling
Panu Matilainen [Wed, 20 Mar 2013 09:35:15 +0000 (11:35 +0200)]
Plug another hole in conflicts and obsoletes handling

- Handle multiple "providers" in self-conflict and -obsolete cases:
  we need look up all matches in the added package set, otherwise
  if a self-conflict (or obsolete) is also a conflict (or obsolete)
  in some other package in the transaction, this could previously
  fall through unnoticed.
(cherry picked from commit 70013c4144a3c04678143c326f7135e775ec4ccc)

11 years agoCheck for file conflicts in installed packages
Michael Schroeder [Wed, 20 Mar 2013 07:29:58 +0000 (09:29 +0200)]
Check for file conflicts in installed packages

- Rpm checks that a conflict in the new package is not satisfied by an
  installed file, but it ignores when a conflict of an installed package
  is satisfied by a file of the new package, eg

    Package A: Contains file "/foo"
    Package B: Has "Conflicts: /foo"

    rpm -U A.rpm, then rpm -U B.rpm results in:
    error: Failed dependencies:
        /foo conflicts with B-1-1.i586

    rpm -U B.rpm, then rpm -U A.rpm will work.
- Use an IndexIterator over RPMTAG_CONFLICTNAME to create a hash with
  all of the possible file conflicts to speed things up.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 46edce686a5949179c4f6eee18b41e761b53ae49)

11 years agoMake sure PKG_CONFIG_PATH is set according to target libs
Panu Matilainen [Fri, 15 Mar 2013 10:34:58 +0000 (12:34 +0200)]
Make sure PKG_CONFIG_PATH is set according to target libs

- pkg-config isn't multilib-aware by itself so things fail when
  building packages for secondary archs (RhBug:212522)
- A variant of this patch has been in Fedora and RHEL for quite some
  time, but they used to just brutally override whatever might
  have been in PKG_CONFIG_PATH, which can break things in a custom
  setup (RhBug:569773). Append instead of full override.
(cherry picked from commit aa8979f4d1cd5ad5b2c69135595d90489e039817)

11 years agoMake sure /var exists created in the test-suite root
Panu Matilainen [Wed, 6 Mar 2013 12:45:36 +0000 (14:45 +0200)]
Make sure /var exists created in the test-suite root

- Rpm installation only creates /var if configured in specific way,
  but the test-suite relies on /var being there. Ensure its always
  there regardless of how rpm was configured.
(cherry picked from commit ea3fa1513f5f8346d9f282a99a6d69088afd10b4)

11 years agoSanitize the hardlink test size thing
Panu Matilainen [Wed, 6 Mar 2013 12:07:11 +0000 (14:07 +0200)]
Sanitize the hardlink test size thing

- The previous "echo $0" got actually expanded to the temporary
  build-time script name, something like /var/tmp/rpm-tmp.UtGhG1,
  which isn't what we're interested in, and depends on rpm
  configuration so can easily cause false positives. Just use
  %{name}-%{version} to get stable content.
(cherry picked from commit 9e918abb4c6d577f3aae2a1a1abd0f4e67f2d151)

11 years agoForce known _tmppath during test-suite non-chroot builds
Panu Matilainen [Wed, 6 Mar 2013 11:29:27 +0000 (13:29 +0200)]
Force known _tmppath during test-suite non-chroot builds

- Rpm might be configure'd with a _tmppath that isn't writable
  or even existing on the build-host, force our testing tmp directory
  to be used for package builds which cannot be executed within the
  test-root.
- Fixes a few false positives in the test-suite by making it less
  reliant on the configuration of the built rpm and build host
(cherry picked from commit ec00b3f02e3caab77849338bdb6422bf6ab7c306)

11 years agoAvoid relying on filesystem macro values in test suite
Panu Matilainen [Wed, 6 Mar 2013 11:17:21 +0000 (13:17 +0200)]
Avoid relying on filesystem macro values in test suite

- The test-suite expected results are hardcoded, so we can't rely
  on rpm-defined macros as those reflect rpm's own configuration
  which could be something entirely different than our expectations.
- Fixes another big pile of false positives in the test suite
(cherry picked from commit 62e73943576acf19d212cac4f54b8c449c69531b)

11 years agoMain macros needs similar sed-love on install as platform macros
Panu Matilainen [Wed, 6 Mar 2013 10:50:24 +0000 (12:50 +0200)]
Main macros needs similar sed-love on install as platform macros

- Autoconf leaves things like @localstatedir@ unexpanded at build-time
  on purpose so the paths can be overridden during "make install".
  However this leaves %{_var} in macros in its unexpanded state
  unless --localstatedir is explicitly passed in, which does not
  work very well for rpm.
- Process the main macros file through the same meat grinder as
  the platform macros. Ugly as sin but... it brings the casual
  "./configure; make; make check" sequence much closer to working.
(cherry picked from commit ccd6281e699781e0b00edb16b6e9f4dec6878c15)

11 years agotests: Make sure testing/usr/bin exists and to copy data from srcdir.
Mark Wielaard [Tue, 5 Mar 2013 20:52:36 +0000 (21:52 +0100)]
tests: Make sure testing/usr/bin exists and to copy data from srcdir.

When srcdir != builddir the data has to be copied over from the srcdir.
When any of the required progs comes from /usr/bin then there also needs
to be a usr/bin under testing. Just use the same symlink as for testing/bin.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 96bcbca9b10e635f5e77868ae55fd7497ea5c630)

11 years agoFixup find-requires linking for srcdir != builddir.
Mark Wielaard [Tue, 5 Mar 2013 20:31:06 +0000 (21:31 +0100)]
Fixup find-requires linking for srcdir != builddir.

When configuring with srcdir != builddir the find-requires link would fail:
ln: failed to create symbolic link './autodeps/find-requires'

Do the link in the same way as find-provides with an explicit ${srcdir}.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit dd0ea43f14a0cf52b654df2886ac2d68d32e069a)

11 years agoAArch64 support v2
Mark Salter [Mon, 4 Mar 2013 17:30:16 +0000 (12:30 -0500)]
AArch64 support v2

Here is my updated patch adding AArch64 support. The main change was to
use CANONCOLOR=3 rather than 2.

--Mark

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 8e1ca16c58d478dce53c232d8943124636658cee)

11 years agoSpelling fixes.
Ville Skyttä [Sat, 16 Feb 2013 18:29:33 +0000 (20:29 +0200)]
Spelling fixes.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 8002b3f98543729fd4544545c055476f2f88a210)

11 years agoA non-naive implementation of argvJoin()
Panu Matilainen [Mon, 18 Feb 2013 08:44:40 +0000 (10:44 +0200)]
A non-naive implementation of argvJoin()

- The previous version was as naive as they get, for reasonable behavior
  with non-trivial amount of data precalculating string lengths and
  allocating at one go is necessary.
(cherry picked from commit 11ba21e2ab67f14ad349252cfb890006a112867f)

11 years agoFixed buffer problems in doShellEscape
Alexey Tourbin [Thu, 7 Feb 2013 03:44:41 +0000 (03:44 +0000)]
Fixed buffer problems in doShellEscape

When the output from a command is empty, nothing stops doShellEscape from
chopping newlines past the beginning of the buffer.  This problem was first
identified by Dmitry V. Levin in July 2009.

Also, there is an off-by-one error in replacing trailing '\n' with '\0'.
This problem, however, escaped the attention of Dmitry V. Levin in July 2009.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 2d647098c803620aab2a7ca94007441e060451d3)

11 years agoFailure to initialize crypto is fatal
Panu Matilainen [Tue, 12 Feb 2013 03:14:34 +0000 (05:14 +0200)]
Failure to initialize crypto is fatal

- Almost nothing works if crypto fails to initialize for whatever reason,
  check and propagate rpmInitCrypto() failure from rpmReadConfigFiles().
- Logging the error left for individual crypto backends to let them
  identify themselves: beecrypt requires no initialization whatsoever
  so it cannot fail at all, but NSS can fail in a number of entertaining
  ways due to missing dlopen()'ed bits and pieces, this should help
  avoiding wild-goose chases in such cases (RhBug:909627, RhBug:909618...)
(cherry picked from commit cca91666d041abb500604997b0a5235018217b3f)

11 years agoFailure to calculate digest in rpmDoDigest() is, well, a failure
Panu Matilainen [Tue, 12 Feb 2013 03:11:16 +0000 (05:11 +0200)]
Failure to calculate digest in rpmDoDigest() is, well, a failure

- This is mostly a cant-happen situation but technically it can
  fail, lets not segfault if it does (RhBug:909618)
(cherry picked from commit 65d2e787d518fb5d13340cbadecfc256af74fde6)

11 years agoWarn when whitespace is missing before macro body
Alexey Tourbin [Sat, 19 Jan 2013 12:11:11 +0000 (12:11 +0000)]
Warn when whitespace is missing before macro body

This will now issue a warning when macro definition is possibly
incorrect or ambigous, such as the one found in FC18 lvm2.spec:

%define util-linux_version 2.22.1
warning: Macro %util needs whitespace before body

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 0eb0da9af91c8dfee5cd202770d686cf937fedb8)

11 years agoCheck for stale db locks when opening write-cursors
Panu Matilainen [Tue, 5 Feb 2013 08:11:19 +0000 (10:11 +0200)]
Check for stale db locks when opening write-cursors

- During long-running transactions its entirely possible for some
  other player to come and go leaving stale locks behind and cause
  the transaction to get stuck until the cavalry comes along in the
  form of somebody else opening the rpmdb, clearing the blockage.
- Presumably dbenv->failchk() is not entirely free of cost so we only
  do this for writes which are way more critical and also more prone to
  getting stuck.
- dbenv->failchk() could return DB_RUNRECOVER in which case we should
  abort everything but we lack a mechanism to do it... just add
  a reminder comment for now.
(cherry picked from commit 29e7c4b3bd1e67f9de1eaaf9fecf82cae281a7e6)

11 years agoRestore legacy behavior on %ghost %config erasure, mostly upstream/4.11.0.1
Panu Matilainen [Thu, 31 Jan 2013 14:03:30 +0000 (16:03 +0200)]
Restore legacy behavior on %ghost %config erasure, mostly

- Make rpmfiConfigConflict() consider any existing %ghost %config
  as "modified". This causes them to be left alone on erasure to match
  long-standing rpm behavior (whether the behavior is intended or not...)
  Ghost config testcase passes again, talk about flip-flop. Sigh.
- Legacy behavior had an extra twist which we are intentionally NOT
  restoring: if a non-empty %ghost exists at build-time, its digest
  is stored in the header despite the file not being present in
  the payload. With previous versions of rpm, the contents of an
  existing  %ghost %config would be compared to the one in header and
  resulting in different behavior on erasure: if the contents matched
  that of build-time, the file would be removed, otherwise it would
  be preserved. Ghosts remembering their identity from previous life
  goes a little bit too far into the land of paranormal for me...
(cherry picked from commit 233e4573d1d21a36d06874fea6c594428033802e)

11 years agoAdjust ghost config test case to match legacy behavior
Panu Matilainen [Thu, 31 Jan 2013 13:55:22 +0000 (15:55 +0200)]
Adjust ghost config test case to match legacy behavior

- Rpm has traditionally (at least for the last decade) preserved
  existing %ghost %config file on erasure. Whether this was intentional
  or not, changing the behavior now risks data loss in case people
  are relying on this long-standing behavior.
- This fails now: The behavior changed as (an unexpected) side-effect
  of commit 389b1ab706be8eddba9f00c7084759f670ce96ac.
(cherry picked from commit 4efec66338ef04d2f1ed20cfba84c47145269d0d)

11 years agoRefresh translations again, sigh
Panu Matilainen [Thu, 31 Jan 2013 06:28:54 +0000 (08:28 +0200)]
Refresh translations again, sigh

11 years agoBump version to dot-paperbag aka 4.11.0.1
Panu Matilainen [Wed, 30 Jan 2013 15:23:31 +0000 (17:23 +0200)]
Bump version to dot-paperbag aka 4.11.0.1

11 years agoDont skip shared file/dir create if the other one is a ghost
Panu Matilainen [Wed, 30 Jan 2013 12:07:33 +0000 (14:07 +0200)]
Dont skip shared file/dir create if the other one is a ghost

- Explicitly test for shared file/dir being ghost when deciding whether
  to skip create: we must never skip the creation of a real file/dir
  because of a ghost as the ghosts do not get created.
- This fixes the shared ghost testcase, ie the thing that commit
  a712252392eca75443ca45c10a72873cabec7963 was supposed to fix,
  without side-effects that I can see.
(cherry picked from commit 147a26c5f672ee3421fe057725f6be357031bbb5)

11 years agoRevert the severely broken FA_SKIP on %ghost "fix"
Panu Matilainen [Wed, 30 Jan 2013 12:01:59 +0000 (14:01 +0200)]
Revert the severely broken FA_SKIP on %ghost "fix"

- Reverts the bad half of commit a712252392eca75443ca45c10a72873cabec7963:
  treating files that wont be installed as skipped seems logical enough,
  but rpm disagrees... making %ghosts FA_SKIP on install causes
  upgrades on %ghost %config files to miss the necessary FA_SKIP getting
  set on the erase half via handleInstInstalledFile() and
  rpmfiDecideFate(), causing %ghost %config files to be nuked. Which isn't
  very nice when your /var/lib/rpm/ contents are packaged as
  %ghost %config...
- This fixes the %ghost %config testcase but breaks the shared %ghost
  case in turn.
(cherry picked from commit 471b74bf6e218abb06bb3131a259cdfaec3f08cf)

11 years agoAdd testcase for %ghost shared with a real file
Panu Matilainen [Wed, 30 Jan 2013 11:52:23 +0000 (13:52 +0200)]
Add testcase for %ghost shared with a real file

- Further parametrize conflicttest.spec to allow for different attributes
- Verify that the real file gets created without conflicts, that
  it doesn't get removed when ghost is removed and gets normally removed
  on erase.
- This is the case commit a712252392eca75443ca45c10a72873cabec7963 was
  supposed to fix (which it does but with, ahem, "slight" side-effects)
(cherry picked from commit 0485eab2c96173d1e34e4edb3570e58a693e255e)

11 years agoAdd testcase for %ghost %config behavior
Panu Matilainen [Wed, 30 Jan 2013 11:46:45 +0000 (13:46 +0200)]
Add testcase for %ghost %config behavior

- Further parametrize configtest.spec to allow for different attributes
- Verify pre-existing %ghost %config is preserved on install,
  that it survives upgrades and gets removed on erase.
  This fails now because it IS broken due to commit
  a712252392eca75443ca45c10a72873cabec7963.
(cherry picked from commit 5121ea2151f13e58740b7b4e7dc20cff5f2475fb)

11 years agoPreparing for 4.11.0 final rpm-4.11.0-release
Panu Matilainen [Tue, 29 Jan 2013 06:30:28 +0000 (08:30 +0200)]
Preparing for 4.11.0 final

11 years agoUpdate translations from Transifex
Panu Matilainen [Tue, 29 Jan 2013 06:22:37 +0000 (08:22 +0200)]
Update translations from Transifex

11 years agoDont mess with global user identity in __scm_setup_bzr
Panu Matilainen [Mon, 28 Jan 2013 20:34:11 +0000 (22:34 +0200)]
Dont mess with global user identity in __scm_setup_bzr

- Bzr defaults to global value on "bzr whoami", so we would mess
  up user identity on "%autosetup -S bzr". Oops. Move identity setting
  after repo initialization and set the identity per-branch, not global.
  The notion of "per-branch identity" seems odd, but then bzr is...
  I guess this would be bzr-speak for "per-directory identity"
(cherry picked from commit 58f41cb4e1721d410017732a55613056b6acb24c)

11 years agoSetup git identity in __scm_setup_git (RhBug:905002)
Panu Matilainen [Mon, 28 Jan 2013 20:31:30 +0000 (22:31 +0200)]
Setup git identity in __scm_setup_git (RhBug:905002)

- For some reason on my own account git keeps functioning even if
  I remove its configuration, but on a newly created account git commit
  bails out with "Please tell me who you are" unless we set the
  (per-repo) configuration here.
(cherry picked from commit 321a87d789bb090c88c541f7f158ae922ddee3ff)

11 years agoSplit __scm_author to separate name and email address macros
Panu Matilainen [Mon, 28 Jan 2013 20:28:35 +0000 (22:28 +0200)]
Split __scm_author to separate name and email address macros

- At least git wants name and email separately, change __scm_author
  to combine the two instead. Related to RhBug:905002.
(cherry picked from commit 1a21dc867dfbf48169782c6b8dbd0e0476e2bbbf)

11 years agoAcommodate to glibc 2.17 __secure_getenv() renaming
Panu Matilainen [Mon, 28 Jan 2013 16:49:01 +0000 (18:49 +0200)]
Acommodate to glibc 2.17 __secure_getenv() renaming

- glibc 2.17 renames __secure_getenv() to secure_getenv() so now we
  need to test for both. Meh.
(cherry picked from commit 49519f2564777fdcfb801088fb3025b3d6f5783a)

11 years agoBe more careful about skipping shared file/directory creation
Panu Matilainen [Mon, 28 Jan 2013 10:50:39 +0000 (12:50 +0200)]
Be more careful about skipping shared file/directory creation

- Only skip shared file/dir creation if its actually being created
  by another package. Previously we could've decided to skip an entry
  where the other file was also being skipped for some other reason.
- Ensure %ghost entries always have FA_SKIP on install, previously
  they often were FA_CREATE which makes no sense for %ghost. We dont
  encounter %ghosts at all during install in the FSM as they dont
  exist in the payload, but the file disposition calculations need
  to take them into account now that we're avoiding redundant creates.
- Fixes a regression from commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e
  which unearthed the %ghost FA_CREATE issue, reported here:
  http://lists.fedoraproject.org/pipermail/buildsys/2013-January/004047.html
(cherry picked from commit a712252392eca75443ca45c10a72873cabec7963)

11 years agoAdjust rpmspec -P to invoke non-build parse
Alexey Tourbin [Tue, 22 Jan 2013 00:47:15 +0000 (00:47 +0000)]
Adjust rpmspec -P to invoke non-build parse

In the query mode, rpmspecQuery puts the parser into non-build mode
by invoking rpmSpecParse with (RPMSPEC_ANYARCH|RPMSPEC_FORCE) flags.
The same flags should be applied in the parse mode, so that it is
possible to preprocess specfiles separately, i.e. without also
installing sources and patches.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 4eb824937ce536aeecdfdcab2d88e28083bba85b)

11 years agoMake double-quoting work for special %doc (and %license) too
Panu Matilainen [Tue, 22 Jan 2013 05:55:11 +0000 (07:55 +0200)]
Make double-quoting work for special %doc (and %license) too

- Up to now, special %doc has been different from everything else in
  %files: double-quoting which is used to escape eg spaces in filenames
  has not worked, but single-quoting and backslash-escapes (which do
  not work elsewhere in %files) "worked" by happenstance due to getting
  passed verbatim to shell/cp. Those and various other %doc hacks people
  have come with stopped working (ticket #858) as starting from
  commit 29677605d44dc9cba3119135653ba0372ab58037 we perform the
  copies in slightly more controlled manner.
- Rather than re-enable old quirks, make %doc and %license behavior
  consistent with the rest of the %files section: double-quoting and
  globs work, other escaping methods do not.
- This does mean a minor (as docs with spaces are relatively rare)
  compatibility rift in specs, the "official workaround" is that
  if compatibility with older rpm versions is required globs can
  be used instead of quotation.
(cherry picked from commit a1d9364adb556813886d91b2799217a412ac5bb0)

11 years agoRevert "make "canonicalization(...)shrank by one character" error message more usefull"
Panu Matilainen [Wed, 9 Jan 2013 11:48:40 +0000 (13:48 +0200)]
Revert "make "canonicalization(...)shrank by one character" error message more usefull"

- The message is not about basedir and destdir, and printing them
  here only makes the message even more confusing than it was, eg:
      canonicalization unexpectedly shrank by one character \
          ('/home/pmatilai/rpmbuild/BUILD/' vs '/usr/src/debug/')
- This reverts commit 1eea433d9961d74dbc797cea7f9bfceab8c16a3e
(cherry picked from commit e83cc97792d66f8d31ef471455a9fa6ae136ae9a)

11 years agoAlternatively accept files from command line arguments in elfdeps
Panu Matilainen [Tue, 8 Jan 2013 10:51:36 +0000 (12:51 +0200)]
Alternatively accept files from command line arguments in elfdeps

- Nothing actually needs this, but for testing & debugging command line
  args are often nicer than having to pass stuff via stdin.
(cherry picked from commit 6941d51e7e5139014418d1056acb6dafccefbab7)

11 years agoFake ELF sonames by default (again)
Panu Matilainen [Mon, 7 Jan 2013 12:23:13 +0000 (14:23 +0200)]
Fake ELF sonames by default (again)

- (Private) libraries which might intentionally not have DT_SONAME
  are still recorded as requires from DT_NEEDED, and there's no
  way of knowing what's an internal library when generating requires.
  Not faking the soname in these cases will only result in broken
  requires in cases that always used to "just work".
- Change the switch to --no-fake-soname disabler instead to allow
  tweaking in special cases but by default we gotta match linker
  (and ELF specification) behavior, no matter how much we'd like to
  use this for our own heuristics :-/
(cherry picked from commit b6f159a34c946b75cb95a7862968ff4e8eb74fe6)

11 years agoCentralize elf soname provide addition, comment
Panu Matilainen [Thu, 3 Jan 2013 15:01:42 +0000 (17:01 +0200)]
Centralize elf soname provide addition, comment

- Remember DT_SONAME in the elfInfo struct if encountered and
  only add it after everything else has been processed. This doesn't
  change any actual functionality for now, but gives us a single
  place where to control the addition.
- Additionally document what the related DT_DEBUG test is for and
  clean up the processDynamic() loop and switch-case a bit.
(cherry picked from commit 8e3ce7417a20dd8bca4676c0a598fc4932d22eef)

11 years agoOnly fake ELF soname's if requested
Panu Matilainen [Thu, 3 Jan 2013 12:16:20 +0000 (14:16 +0200)]
Only fake ELF soname's if requested

- This helps cutting down the number of bogus provides from dlopen()'ed
  plugins and internal libraries which preferrably shouldn't have a
  soname at all. Unfortunately libtool always puts in a soname even if
  -module -avoid-version is used :-/
- OTOH there are broken libraries which dont have a soname even though
  they should, so (we need to) allow falling back to the former behavior
  of faking up a soname from the basename.
(cherry picked from commit 6c0bdc393dda3de8bacd3a1844d980802e45d195)

11 years agoMove elf class marker figuring to helper function, generalize a bit
Panu Matilainen [Thu, 3 Jan 2013 10:59:13 +0000 (12:59 +0200)]
Move elf class marker figuring to helper function, generalize a bit

- Determine arch-specific issues by looking at the elf header instead
  of compile-time #ifdefs, so we'll generate correct dependencies for
  non-native elf binaries too. Currently this is just alpha which despite
  being a 64bit system, never had the (64bit) markers in its dependencies.
  Of course alpha has pretty much already met its mark^H^H er maker by now,
  but doing the right thing is cheap... Also we'll need similar special
  cases sooner or later for other archs (such as x32).
(cherry picked from commit f84a71cdc786a012fc9cbe16c5236c622ea970a4)

11 years agoConsolidate elf dependency string generation to helper function
Panu Matilainen [Thu, 3 Jan 2013 10:11:26 +0000 (12:11 +0200)]
Consolidate elf dependency string generation to helper function

- Figure out the elf class marker early and handle the rest in helper
  to avoid copy-slop code. No functional changes.
(cherry picked from commit e7489abd6672e8c980d2d1b2ab32b963e1ea83b2)

11 years agoDisable useless empty translations, enable Ukrainian translation
Panu Matilainen [Wed, 19 Dec 2012 11:21:58 +0000 (13:21 +0200)]
Disable useless empty translations, enable Ukrainian translation
(cherry picked from commit 8774cb03cf78b02411cc26329a3c362d95e36fe4)

11 years agoInitial Breton (br) translation
Thierry Vignaud [Wed, 19 Dec 2012 10:52:51 +0000 (12:52 +0200)]
Initial Breton (br) translation

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit d277537bcafa65f1cb09d12e259569d6ed35e2a2)

11 years agoHandle transaction global pool allocation centrally in rpmtsPool()
Panu Matilainen [Wed, 19 Dec 2012 10:32:52 +0000 (12:32 +0200)]
Handle transaction global pool allocation centrally in rpmtsPool()

- Previously the pool would only get allocated on successfull addition
  of install or erasure elements, causing assert() failures on
  operations on empty transaction set, which should be just a no-op,
  not an error.
- Make rpmtsPool() create the pool if it doesn't exist, update relevant
  users to call rpmtsPool() instead of directly accessing tsmem->pool,
  this avoids having to worry about pool existence in all the various cases.
- Also fix up the pool-related comment on rpmtsEmpty(): pools does not
  and can not support emptying as it could break references to its
  contents. Per-string refcount would be needed for emptying support.
(cherry picked from commit d73535e1a9dc5095e78475adc5b636d99f01efa9)

11 years agoClean up fix grabData() error handling in callers
Panu Matilainen [Tue, 18 Dec 2012 11:22:12 +0000 (13:22 +0200)]
Clean up fix grabData() error handling in callers

- grabData() only returns non-NULL on data length > 0, separately
  checking for length only makes it look like a possible case when
  its not. If it were, it'd be a memory leak.
(cherry picked from commit aa6af71d457be5d78252f23ea68322dcaf199e4e)

11 years agodisplay the actual unknown option instead of '?'
Thierry Vignaud [Mon, 17 Dec 2012 12:58:44 +0000 (13:58 +0100)]
display the actual unknown option instead of '?'

'?' is returned by getopt when option is unknown, making hard to
pinpoint the actual bogus option...

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 8192e580a0a962b8eb7f9d8fc07bd3f99ccf0ffe)

11 years agoDead code removal
Panu Matilainen [Fri, 14 Dec 2012 07:26:02 +0000 (09:26 +0200)]
Dead code removal

- Nothing is setting "arch" here anymore, this should've been removed in
  commit fddfee17c3c4e19269665800d557d3452cbde162 already
(cherry picked from commit 1c3f966903743ea571a23e1af08a618b4179c5cb)

11 years agoPreparing for 4.11.0-beta1 rpm-4.11.0-beta1 upstream/4.10.91
Panu Matilainen [Mon, 10 Dec 2012 13:20:51 +0000 (15:20 +0200)]
Preparing for 4.11.0-beta1

11 years agoEnsure correct return code on malformed signature in packages
Panu Matilainen [Fri, 7 Dec 2012 11:54:23 +0000 (13:54 +0200)]
Ensure correct return code on malformed signature in packages

- rpmpkgRead() starts with assumed failure, but there are a number
  of places assigning the return code, and by the time we get
  to the parsePGPSig() calls its likely to be RPMRC_OK, so the
  jumps to exit result in "all is well" return code on a signature
  we couldn't even parse. Oops.
- Set the failure status explicitly to fix this fairly nasty regression
  introduced in commit e8bc3ff5d780f4ee6656c24464402723e5fb04f4, ie
  rpm >= 4.10.
(cherry picked from commit 96a616c6aed4c516789a154af188f005caf23f14)

11 years agoHandle allocation failure in NSS DSA signature initialization
Panu Matilainen [Tue, 4 Dec 2012 12:06:42 +0000 (14:06 +0200)]
Handle allocation failure in NSS DSA signature initialization
(cherry picked from commit 2d39f13064f6e6ff1a1633b708e7ba5622a7e8eb)

11 years agoFix build with older NSS versions that dont support SHA224
Panu Matilainen [Fri, 30 Nov 2012 10:23:42 +0000 (12:23 +0200)]
Fix build with older NSS versions that dont support SHA224

- SHA224-support was added around NSS 3.13, dont break compilation
  with older versions just for this rarely used hash.
- HASH_AlgSHA224 is an enum so test for SHA224_LENGTH define instead
(cherry picked from commit e15e29823451663e27a5bec6c865b37901f1c315)

11 years agoCondence NSS getHashType() a bit, handle SHA224 too
Panu Matilainen [Fri, 30 Nov 2012 10:20:05 +0000 (12:20 +0200)]
Condence NSS getHashType() a bit, handle SHA224 too

- Not much point in enumurating unsupported cases, or with switch-breaks
  after returns.
- Recognize SHA224 too
(cherry picked from commit 466a6b554e7f7ded9f1c59646e6b64243ce16812)

11 years agoUnbreak --setperms (RhBug:881835)
Panu Matilainen [Fri, 30 Nov 2012 06:15:24 +0000 (08:15 +0200)]
Unbreak --setperms (RhBug:881835)

- Fixes a regression introduced in rpm >= 4.10 caused by query format
  simplification (loss of zero padding support), in commit
  1f1e5e88a1f6c60cf2d11014d809000e97a63aad.
- 'chmod' command doesn't need zero padding, just remove the formatting.
  In fact we shouldn't be passing the entire mode to it but just the
  permission bits, but fortunately chmod isn't too picky here.
(cherry picked from commit 4c90c79e3f3c178189ad3bd89dfd87cd3a2290ab)

11 years agoGet rid of long since deprecated VFY_VerifyDigest() uses
Panu Matilainen [Thu, 29 Nov 2012 10:35:13 +0000 (12:35 +0200)]
Get rid of long since deprecated VFY_VerifyDigest() uses

- VFY_VerifyDigest() has been deprecated since NSS >= 3.12 and for
  a good reason too: with VFY_VerifyDigest() caller needs to painfully
  enumerate every possible supported enc + hash combination, only for
  NSS to revert the process. Use the saner VFY_VerifyDigestDirect()
  interface instead and test for its presence in configure.
- This means we now require NSS >= 3.12 but as that's already 4.5 years
  old and included in ancient beasts like RHEL-4, this doesn't seem
  exactly unreasonable requirement. And then there's always beecrypt...
(cherry picked from commit 9b995a7674adba08248fac79ae8b23ecbecc13de)

11 years agoRemove extra ',' in NSS configure checks, whoops
Panu Matilainen [Thu, 29 Nov 2012 10:31:52 +0000 (12:31 +0200)]
Remove extra ',' in NSS configure checks, whoops
(cherry picked from commit e1c67173d38016a88989f5b09e0934f90094fe85)

11 years agoUse NSS-defined constants for DSA q-bits and signature length too
Panu Matilainen [Thu, 29 Nov 2012 09:05:04 +0000 (11:05 +0200)]
Use NSS-defined constants for DSA q-bits and signature length too

- No functional changes here (either), but using the proper constants
  simply makes things that little bit clearer.
(cherry picked from commit 604da18bc267f89568081c1ab163c7fc45207220)

11 years agoAvoid deprecation warnings from NSS >= 3.14
Panu Matilainen [Thu, 29 Nov 2012 08:43:24 +0000 (10:43 +0200)]
Avoid deprecation warnings from NSS >= 3.14

- NSS >= 3.14 introduces support for DSA2 and marks DSA_SUBPRIME_LEN
  as deprecated. Use explicit DSA1_SUBPRIME_LEN (we only support DSA1
  for now) instead where available, add compatibility define for
  older versions.
- Also directly include <blapit.h> where its defined - blabit.h gets
  included via cryptohi.h but being explicit about it avoids having
  to redefine it again "just in case".
(cherry picked from commit 73be0fc7d9faab9f1120e2979f2ca1feed522195)

11 years agoAdd missing <errno.h> include
Panu Matilainen [Mon, 26 Nov 2012 11:34:06 +0000 (13:34 +0200)]
Add missing <errno.h> include

- Should've been in commit cbd6ef58bbc122e6adf2138679915bd3845d6756,
  this breaks build when selinux-support is not compiled in
(cherry picked from commit ebba1c7b58ba089bb9e1ded147c789d9ca067b6c)

11 years agoAvoid locale issues in rpm2cpio.sh (RhBug:878363)
Panu Matilainen [Thu, 22 Nov 2012 10:22:06 +0000 (12:22 +0200)]
Avoid locale issues in rpm2cpio.sh (RhBug:878363)

- In gawk >= 4.0.x printf() "adjusts" things according to current locale,
  but we need the data as it is. Forcing C locale prevents gawk from
  getting funny ideas about character conversions...
(cherry picked from commit c0e95f1cedefd6d7522ef2cf7a2ada7c83821596)

11 years agoFix double-free on %caps in spec (RhBug:877512)
Panu Matilainen [Sat, 17 Nov 2012 15:57:59 +0000 (17:57 +0200)]
Fix double-free on %caps in spec (RhBug:877512)

- Fixes regression caused by dumb refactoring mistake in commit
  807ba93a6cf168410e3801347898949f356fcd6c
(cherry picked from commit 6bdd34c451dbf69792c59704e06f1ccb045ae743)

11 years agoAdd --undefine cli switch for undefining macros (related to RhBug:876308)
Panu Matilainen [Fri, 16 Nov 2012 11:21:15 +0000 (13:21 +0200)]
Add --undefine cli switch for undefining macros (related to RhBug:876308)
(cherry picked from commit 644f080a4868208bf61f28103b7b676c094129a0)

11 years agoAccount for temporary disk-space requirement on forced replace too
Panu Matilainen [Wed, 14 Nov 2012 10:19:49 +0000 (12:19 +0200)]
Account for temporary disk-space requirement on forced replace too

- Similar to commit 85df102165fdbe64978f2019d757d400e7448218, but
  for forced file replacements.
(cherry picked from commit b1d3f21a54eb1f23a08e9e2d943a6438502b0e47)

11 years agoRemove ancient, no longer relevant comment
Panu Matilainen [Wed, 14 Nov 2012 08:54:38 +0000 (10:54 +0200)]
Remove ancient, no longer relevant comment

- Since commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e, only the first
  instance of shared files is created, the rest are FA_SKIP which
  consume no disk space and are not counted either.
(cherry picked from commit f8da4f613680b4da4ee191f8b7451de9b36bfcbd)