Commit Graph

11729 Commits

Author SHA1 Message Date
Panu Matilainen fe62087ac9 Yet more %config test-cases - shared configs have quirks of their own 2012-08-20 10:55:20 +03:00
Panu Matilainen 69850340e6 Add similar set of %config(noreplace) tests
- The first tests are kinda redundant but extra tests never hurt anybody...
2012-08-20 10:24:45 +03:00
Panu Matilainen 2b55fc1a48 Adjust the config test descriptions a bit to make room... 2012-08-20 10:16:10 +03:00
Panu Matilainen 83302bcfcf Add further "parametrization" to our config file test spec
- Currently unused but to allow for testing further cases with the
  same base spec...
2012-08-20 10:04:07 +03:00
Panu Matilainen da65571917 Add a test-case for another %config file special case
- When an existing config file content changes between package versions
  but the file has already been changed to match the content of the
  new version, we still create a backup file that's identical
  to the one that ends up being installed. This is a bug of sorts,
  but documenting the existing behavior before changing it.
2012-08-20 10:02:26 +03:00
Panu Matilainen c7403b0c88 Tighten the existing %config tests a bit
- Test for actual file content
- Also clean up any .rpm[new|save|orig] files from the testroot
2012-08-20 09:49:13 +03:00
Panu Matilainen bf3d65e795 Add a test-case for the shared file timestamp behavior
- Prior to commit f7f5f88f9f, this
  would've failed: removing the last package to be installed would
  cause timestamp failure on all others. The order is arbitrary in
  this testcase but it matters in real-world situations such as
  secondary arch packages.
2012-08-17 14:15:04 +03:00
Panu Matilainen f7f5f88f9f Only create the first instance of a file shared between packages
- When packages share an identical file, we only need to create the
  first one we encounter and skip it for the rest (reverse already
  happens, and must happen, on erase). This has the benefit of
  getting the timestamp to match the first file, which often is
  also the last one to get removed. Also when lots of shared files
  are involved (such as in multilib installations), this can give
  several percents worth of speed gain as we dont unnecessarily rewrite
  the same contents over and over.
2012-08-17 14:07:05 +03:00
Panu Matilainen d6b925342f Blargh, more fdFree() braindamage
- Commit 429b933b42 fixes the fd-leak
  regression in rpm 4.10, but we already have code which relies
  on the new behavior and segfaults with the former one. Adjust
  rpmcpioClose() to the old behavior to get master tree back to
  working shape. TODO: fix this properly some rainy day (oh and see
  http://geekandpoke.typepad.com/geekandpoke/2012/08/likelihood.html)
2012-08-17 13:09:19 +03:00
Panu Matilainen 429b933b42 Revert "Always return NULL from fdFree()"
- This reverts commit 4c1f7e335de1724661ce63c53186d161ab71a63f:
  various things inside and outside of rpm actually do still depend
  on the old behavior, and leak file descriptors otherwise.
  As an easy backportable band-aid, revert back to the previous
  behavior, to which various callers are tuned to fix the regression
  introduced in rpm 4.10.0. The real fix would be something more like
  "eliminate fdFree() and make Fclose() honor refcounts".
2012-08-17 11:37:21 +03:00
Panu Matilainen 789e258d6c Run gcc supported flags test without our stricter warning flags
- Fixes fallout from commit f9c69f803f74bd458269c7a06def494ea63387e6:
  running these tests with -Wstrict-prototypes causes all these tests
  to fail as AC_LANG_PROGRAM() uses an incomplete prototype for
  main() :(
2012-08-14 08:44:32 +03:00
Panu Matilainen e06177ee65 Fix bogus "unclosed %if" error when %include is used in conditionals
- All rpm versions log a bogus "unclosed %if" error when %include
  is used inside %if-%endif (and rpm >= 4.10 actually aborts the
  parse): the check for unclosed if occurs before checking whether
  there's more to come.
- Move the error check into readLine() EOF path along with the other
  similar check to fix, and to consolidate the error handling to
  a single spot.
2012-08-08 09:43:42 +03:00
Panu Matilainen 4e221afaa2 Add test for file verification from originating package 2012-08-07 12:52:29 +03:00
Panu Matilainen 227654f30c Verify files from non-installed packages again (RhBug:826589)
- Verifying files against the originating, non-installed package can
  be useful sometimes, eg if rpmdb is broken or cannot be trusted.
  Of course such verification will give false positives on files that
  were intentionally skipped during installation (nodocs, wrong color,
  netshared...), that can't be helped.
- This restores the former behavior that was erroneously changed
  in commit adbd484372 while "fixing"
  an unhandled enumeration in the switch. Doh.
2012-08-07 12:28:56 +03:00
Panu Matilainen d6add031f1 Accept em64t architecture as an alias for x86_64 (RhBug:800489)
- Some vendors insist on calling their x86_64 packages "em64t" instead
  of the more standard x86_64. Minimally support this naming convention
  as those packages aren't going away anytime soon - be liberal in
  what you accept and all, sigh.
2012-08-07 11:29:03 +03:00
Panu Matilainen 72621fcf32 Add tests for invalid --relocate detection and --badreloc functionality 2012-08-07 10:28:59 +03:00
Panu Matilainen 4fbb58c7e6 Fix RPMPROB_FILTER_FORCERELOCATE aka --badreloc (RhBug:828784)
- As noted (but since then blissfully forgotten) in the commit message,
  commit e696b409fe broke --badreloc
  so its been broken since rpm >= 4.9.x :-/
- Transaction problem filter is only available during rpmtsRun() so
  we have no clue whether bad relocations should be filtered or not
  during rpmte creation. Instead of creating the problems at rpmteNew()
  time, remember any bad relocations that were found and check +
  create the actual problems (unless filtered) along with other
  problems during rpmtsRun().
- Passing an "allow bad relocations" flag to rpmtsAddInstallElement()
  would be a saner option but this is a back-portable way of handling it.
2012-08-07 09:52:15 +03:00
Panu Matilainen 7c70bdea1a Handle all dependency tags in spec via same switch-case fallthrough
- Requires and OrderWithRequires take extra qualifiers, but other
  than that they areall handled the same through parseRCPOT()
2012-08-07 08:28:26 +03:00
Panu Matilainen cce0fb4387 "prereq" is not a valid qualifier to regular Requires 2012-08-07 08:24:57 +03:00
Panu Matilainen 01706306d1 Extra qualifiers like (postun) are not valid with legacy PreReq 2012-08-07 08:18:00 +03:00
Panu Matilainen ecd9aceb56 Honor RPMSENSE_MISSINGOK flag in dependency checking
- For now there's no way to set this flag from packages so it doesn't
  actually do anything, but it doesn't hurt anything either, allows
  Suse & friends to drop one patch (greetings Michael :) and there
  are might be some things we could use this for internally.
2012-08-03 12:43:59 +03:00
Panu Matilainen 933a3e32dd Dont silence patch by default (RhBug:678000, RhBug:773503)
- Unfortunately patch'es idea of "interesting" output is not ideal for
  our purposes: "patching foo.c" is of little value, but hunks with
  offsets and fuzz can be important and there's no switch to patch
  to get exactly what we want. So let it be chatty... build logs are,
  anyway.
2012-08-02 18:16:09 +03:00
Panu Matilainen 12f9b3f9e6 Add --noclean and --nocheck options to rpmbuild
- Ability to skip %clean build stage was requested as RhBug:756531,
  --nocheck seems otherwise useful to have as %check can take a lot of
  time, time you might not want to spend for a trivial spec change or such.
2012-08-02 12:10:39 +03:00
Panu Matilainen 395be24637 Fix memleak in changelog parsing on error paths
- All the early returns would leak memory from the argvJoin(),
  assume failure and force all exits through a single path where
  we can clean up.
2012-08-01 19:17:09 +03:00
Panu Matilainen 465f5f9d5c Turn the invalid date error to warning (related to RhBug:843525)
- The strict date validation introduced in commit
  a29e5f9894 is too much of a PITA
  for such a petty cause, mismatching weekday names as very very
  common in specs. Maybe we can change it to a hard error in a couple
  of years from now once folks have had time to get rid of the
  warnings first.
2012-08-01 19:03:15 +03:00
Panu Matilainen 94b4ee60c0 Refactor the struct stat hacking into a helper function
- Shouldn't change actual functionality, just makes the code easier
  to read and fit on screen by reducing indentation level.
- Add further commentary about what it does and why.
2012-08-01 16:38:15 +03:00
Panu Matilainen d6775a746b Permit non-existent %ghost directories to be packaged (RhBug:839656)
- Directories can be explicitly specified via either %dir or trailing
  slash in the %files manifest, take this into account for %ghosts that
  dont exist in the buildroot. Otherwise we still assume regular file.
- Dont require explicit %attr() for missing %ghosts, let them fall
  back to %defattr() instead. If %defattr() doesn't specify a mode
  the file will be seen without any permissions at all, but that's
  not strictly an error (and same can happen with %dev() already)
2012-08-01 16:25:43 +03:00
Panu Matilainen 24ad8291bb Dont bother asking libmagic about directories
- There's no (relevant) additional information to be gained from passing
  directories to libmagic and we already have this info available in the
  file mode. This permits nice and easy handling of %ghost directories
  (related to RhBug:839656)
2012-08-01 16:25:06 +03:00
Panu Matilainen 9c26bd05ea Report starting line for unclosed %if in specs 2012-07-31 16:20:16 +03:00
Panu Matilainen 89ce186258 Dynamically grow spec line buffer on line continuations
- Allows arbitrary length line continuation constructs in specs, but
  probably the more useful side-effect is cleanly handling unterminated
  macros and the like (instead of segfaulting) on large spec files,
  there was a bug on this somewhere but cant find it atm.
- This also has a wee bit silly effect on the maximum macro expansion size:
  after very long constructs the max expansion gets is bigger than
  at the beginning of spec parse, but properly fixing the resizing wrt
  macros is a different issue.
- Watch out for possible fallout from spec->line etc tracking, they
  *seem* to be ok even with the potentially moving buffer location but...
2012-07-31 14:22:08 +03:00
Panu Matilainen e5ea5dcd2d Minor cleanups: const pedantry and helper variable scoping
- Make the reading pointers const, push helpers to scope where needed
2012-07-31 13:27:30 +03:00
Panu Matilainen 729fd554ee Allocate spec line buffer separately from spec struct
- Further preliminaries for dynamic buffer resizing
2012-07-31 11:56:01 +03:00
Panu Matilainen 0c737f72b2 Track spec parse buffer position by offset instead of pointer
- Preliminaries for dynamically reallocating the buffer
2012-07-31 11:12:27 +03:00
Panu Matilainen 66ed9fc616 Fix (well, loosen up) the valgrind suppression rules
- The previous rules far too specific to glibc + gcc with certain
  optimization levels, eg relying on parse_auxv() getting inlined
  and when it does not, the suppression rules would no longer match.
2012-07-30 17:29:47 +03:00
Panu Matilainen a29e5f9894 Stricter validation of changelog date (RhBug:843525)
- Compare the date parsed from changelog to date normalized by mktime()
  and complain if they differ. This catches cases like wrong weekday
  specified for an otherwise valid date, and a leap day on a non-leap
  year etc.
2012-07-30 14:59:35 +03:00
Panu Matilainen 2e95618c0e Always print out package dependencies on build
- Previously packages which had no files or for which automatic
  dependency generation was partially or fully disabled didn't get
  any of their dependencies printed out at build-time. This doesn't
  affect the actual recorded dependencies, only the "debugging"
  output during package builds.
2012-07-12 14:51:12 +03:00
Panu Matilainen f9c69f803f Run gcc supported flags test with -Werror
- On gcc versions supporting -fstack-protector, not all platforms
  support this feature, causing gcc to emit only a warning instead
  of an error. Which then causes warning-spew on every compiled file.
  Run all the supported flag tests with -Werror to turn the warnings
  into errors, there could be other similar cases besides stack protector.
- Patch originally from Arnaud Patard according to this Mandriva commit:
  http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages?view=revision&revision=448632
2012-07-12 13:04:43 +03:00
Panu Matilainen 928386a317 Report config and missinok flags in deptype format extension too 2012-07-11 15:10:08 +03:00
Panu Matilainen a3de720a84 Default to automatic patch application in %autosetup
- Defaults should be for the common case with disablers for those who want
  to do something special, and typically if you have patches you also
  want to apply them. Change it while we still can: eliminate -A option to
  %autosetup and apply all patches unless -N option is used.
2012-07-11 12:07:46 +03:00
Panu Matilainen d1dcc53dfb Accept "owner" as an alias to "user" %verify attribute (RhBug:838657)
- Both Maximum RPM and the newer RPM Guide incorrectly list "owner"
  as a valid %verify() attribute, whereas rpm has used "user"
  for as long as the code has been present (since 1996). Since
  adding the alias is so trivial, and certainly easier than changing
  published books... meh.
2012-07-10 12:52:23 +03:00
Panu Matilainen 32a4e283a6 Recognize relative paths as such in --whatprovides query 2012-07-03 08:51:09 +03:00
Panu Matilainen cf3069b4d9 Also track large file presence for src.rpm's (RhBug:833427) 2012-07-02 17:19:03 +03:00
Panu Matilainen 338f6e4cf7 Push payload file size limit checking into cpio code
- At the time when the file list is being processed, we dont yet
  have the slightest clue what kind of payload will be used for
  for the archive or what limits it might have. Let the cpio code
  handle its own limits checking, the build-side only needs to
  worry about whether 32bit uints are sufficient for storing the
  sizes in headers.
2012-07-02 17:11:00 +03:00
Panu Matilainen f79ce27fff Report the actual failure reason on archive create failure (again) 2012-07-02 16:15:41 +03:00
Panu Matilainen eefcb12b9c Cosmetics: remove redundant {} block, fixup indentation 2012-07-02 15:05:30 +03:00
Panu Matilainen bf3a14a866 Dont use mmap() for anything, axe the code instead
- Commit 4cb02aa928 asked to see
  what breaks when mmap() is used, now we know: large package support
  broke when enabling it. Could be fixed of course by eg adding
  a size cap to the fsm part as well, but just doesn't seem worth it:
  I fail to measure any meaningful performance improvement from mmap
  usage in either case, and added complexity for what is close to
  zero benefit just doesn't make sense... and various sources in fact
  note the rpm usage (read through the entire file sequentially) as one
  of the cases where mmap() is NOT beneficial due to mmap() high
  setup + teardown cost + page fault speed (or lack of thereof).
2012-07-02 15:02:11 +03:00
Phil Knirsch 105f91fc9a Arch macro for all supported PowerPC 64 processors (RhBug:818320) 2012-06-28 10:21:04 +03:00
Phil Knirsch a7248ac1c9 Plain 32bit ppc cannot be a ppc64p7
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-06-28 10:15:59 +03:00
Panu Matilainen 3ffaef5afc Clarify/correct tag usage in rpmdbProvides()
- Refer to RPMTAG_* for rpmds tags, not RPMDBI_*. The values for these
  are the same, only the "intended use" differs (RPMDBI refers to
  rpmdb indexes) so this doesn't change anything in practise.
2012-06-27 11:10:57 +03:00
Panu Matilainen 2cb102f35e Fix obsoletes-thinko in rpmdbProvides()
- dbtag cannot possibly be on obsoletes here, we need to look at deptag
  instead. This thinko in commit 5f1ec21518
  renders that whole commit useless. Doh.
2012-06-27 11:08:25 +03:00