Commit Graph

11677 Commits

Author SHA1 Message Date
Panu Matilainen 7c8c36c334 Fall back to using fsync() on systems without fdatasync()
- While fdatasync() is widely available on modernish systems,
  OS X doesn't have it
2012-06-21 09:45:16 +03:00
Panu Matilainen da01eb98c1 Add valgrind suppression file
- valgrind is not happy about us now processing /proc/self/auxv on Linux,
  this can be used to suppress the false positives when running
  rpm under valgrind. At least until a better solution is found or
  valgrind is taught to treat /proc/self/auxv specially (see
  https://bugs.kde.org/show_bug.cgi?id=253519)
2012-06-19 10:35:31 +03:00
Panu Matilainen ac8a0175be Only use local mempcpy() if system libraries dont provide one
- Obvious yes, but how come this didn't barf on my other rather
  identical system? Meh.
2012-05-31 18:10:33 +03:00
Panu Matilainen 794e24456a xmalloc() and xrealloc() never fail, remove redundant checks 2012-05-31 16:55:37 +03:00
Panu Matilainen a48c369a44 Call alloca() and stat() by their own names... 2012-05-31 16:48:57 +03:00
Panu Matilainen 0d9cfcc07f Eliminate unnecessary glob portability fiddles
- Flags available to our internal glob implementation do not depend on
  posix/gnu/bsd defines
2012-05-31 16:48:52 +03:00
Panu Matilainen 68f991e50c Eliminate VMS, MS-DOS, Windows and Amiga compatibility hacks in rpmglob
- We'll never run on these platforms, we just dont care...
2012-05-31 16:48:46 +03:00
Panu Matilainen b1e9413a5b Eliminate shell interruptability hack in rpmglob 2012-05-31 16:48:41 +03:00
Panu Matilainen 8516fc2212 We always have xstrdup() available, eliminate redundant alternatve 2012-05-31 16:48:33 +03:00
Panu Matilainen 493571ce23 Eliminate getpwnam_r() and getlogin_r() uses from rpmglob
- We dont particularly care if rpmGlob() is thread-safe or not,
  just use the simpler code-path
2012-05-31 16:48:28 +03:00
Panu Matilainen f2954e9b97 Eliminate mempcpy() related conditionals from rpmglob
- Provide a local copy of the trivial mempcpy() function so we can always
  use the shorter code-path, eliminate now unnecessary ifdef goo.
2012-05-31 16:48:21 +03:00
Panu Matilainen 81560ef2e5 Remove __GNUC__ conditionals on variable sized local arrays
- We require a C99 compiler anyway so these conditionals are not needed
2012-05-31 16:48:17 +03:00
Panu Matilainen 9dc4c3c2d7 Eliminate unnecessary libc header typedeffery from rpmglob
- No doubt important bits in glibc but unnecessary goo for our
  internal implementation.
2012-05-31 16:48:11 +03:00
Panu Matilainen 3e05597ba9 Run indent -kr on the glob implementation
- rpm style isn't exactly K&R but close enuf for goverment work
  and prevent sore eyes now that this is a "real" part of rpm.
2012-05-31 16:47:40 +03:00
Panu Matilainen bf088dbeb5 Bury our glob() implementation entirely inside rpmglob.c (RhBug:819680)
- Lump glob.h and glob.c into rpmglob.c in all their g(l)ory libc
  decorations and make everything static to stop overriding system
  library symbols with our own glob().
2012-05-31 16:46:40 +03:00
Panu Matilainen 38932d1d17 Export our own version of glob_pattern_p() as rpmIsGlob()
- Further preliminaries to hiding the glob() implementation
2012-05-31 16:45:32 +03:00
Panu Matilainen a6821de783 Split rpmGlob() to a separate source file
- As a preliminary step to hiding our internal glob implementation,
  split our only glob() user to a source of its own.
2012-05-31 16:45:26 +03:00
Panu Matilainen 077db96e9d Add a test-case for various %files manifest globbing scenarios
- In particular (aside from basics working) we're interested in
  the broken symlink behavior: at least glibc and Solaris have
  a weird glob() which doesn't return broken symlinks at all,
  yet we need to be able to package them (and that's why rpm
  carries its own copy of a differently broken, old glibc glob)
- Also test for directory-only match (RhBug:505995 cases)
2012-05-30 13:40:01 +03:00
Panu Matilainen 6e4e5ebd87 Parametrize default vs current %verify and %attr parsing
- Only try to parse one thing at a time so the caller knows what
  value its going to get if any and doesn't have to pass both
  current and default pointers. Just simplifies things a little.
2012-05-29 12:58:13 +03:00
Panu Matilainen 55bf9abee2 Initial support for "special" %license, similar to %doc (ticket #116)
- Now that this is relatively sanely doable... make %license with
  non-absolute paths behave similarly to %doc, only installing to a
  different directory (%_licensedir) and with different flags:
  licenses are not generic documentation and should not be skipped
  on installation even if --nodocs is used. The common practise of
  stuffing licenses into %doc actually violates various licenses
  which require the license text to always accompany the software.
- While ticket #116 suggests various schemes to reduce disk usage,
  adding some very special logic to installation code just to deal
  with these doesn't seem justifiable, given how small the licenses
  generally are. However with licenses now in their own directory
  structure (/usr/share/licenses by default), running hardlink on
  them is trivial for cases where disk space is tight
  (live images, embedded systems etc)
2012-05-28 16:55:57 +03:00
Panu Matilainen c1f59e74de Generalize special doc attribute to "special dir" 2012-05-28 15:26:49 +03:00
Panu Matilainen ff16d1a487 Handle rpmfiNew() failure centrally in genCpioListAndHeader() 2012-05-28 12:14:15 +03:00
Panu Matilainen 06cd93832d Fix spec parsing memleak from source header on buildarch recursion 2012-05-28 12:03:43 +03:00
Panu Matilainen 1adaff3ee4 Eliminate redundant helper variables from src.rpm generation
- Spec being the first is easily detected from the current index,
  no need for separate tracking variable
- Use the file records used variable to track the progress, no need
  for separate index variable
2012-05-28 11:42:38 +03:00
Panu Matilainen d8334d2e3f Move file list freeing to helper function 2012-05-28 11:06:46 +03:00
Panu Matilainen 975489fa26 Hardlink detection doesn't need entire filelist, just the actual records 2012-05-28 09:56:11 +03:00
Panu Matilainen 86fc7db32d isDoc() only needs the doc dirs, not the entire filelist 2012-05-28 09:51:29 +03:00
Panu Matilainen bafde44e2d Clean up file records freeing a bit
- All the necessary data is in FileRecords struct so we only
  need to pass that. Dont bother NULLing everything as these
  are not passed around in a way where it would matter.
2012-05-28 09:47:58 +03:00
Panu Matilainen de94517558 Split the actual file records into a struct of their own
- No functional changes, just straightforward dumb conversion. Various
  places look fairly dumb with this, leaving sanitizing to other commits.
2012-05-28 09:39:48 +03:00
Panu Matilainen bd16afc2ac Use vfaMatch() for %config attributes as well 2012-05-28 08:57:09 +03:00
Panu Matilainen 487f26633f Unify %verify and virtual file attribute handling 2012-05-28 08:54:30 +03:00
Panu Matilainen f69dd4ce18 Eliminate unused negate field of VFA struct
- The negate field has never been used nor does it seem very useful
  either: %verify negation can't be handled by it anyway, and
  for others it hardly makes sense.
- While at it, make virtualFileAttributes const and fix the
  indentation
2012-05-28 08:50:55 +03:00
Panu Matilainen cca8f6bb55 Push special %doc handling details out of processPackageFiles()
- Add a new struct to hold the necessary bits and pieces about
  these special directories with functions to create & free for
  easy management for callers, move the remaining processing into
  processSpecialDocs() to make that part one-stop shop for the
  caller as well.
- Should not change functionality in any way.
2012-05-25 15:40:31 +03:00
Panu Matilainen b5a0f6876c Refactor getSpecialDocDir() so it cannot fail
- Spit a warning on illegal _docdir_fmt and fall back to the default
  format (which cannot fail). This just isn't worth dying for and
  avoids having to deal with such a petty error elsewhere.
2012-05-25 14:17:33 +03:00
Christophe Fergeau 185596818f Add support for 7zip compressed tarballs
Teach %prep and %uncompress how to handle 7zip tarballs, with
the mingw toolchain landing in fedora, this may be useful when
crossbuilding Windows sources compressed using 7zip (CxImage is
one such project).
2012-05-22 13:48:01 +03:00
Panu Matilainen 7df78ae466 Split prelink checking into a helper function
- No functional changes, just makes the thing a little bit more readable
  as the ELF details are buried out of sight in the helper
2012-05-21 15:15:34 +03:00
Panu Matilainen 50b03d015e Restore basic debug output for fsm operations
- This is close to what we had in the stage-machine days, just to allow
  easily viewing whats going on inside the fsm (create/skip/etc)
2012-05-21 13:34:03 +03:00
Panu Matilainen 5895463186 Push special doc directory generation next to other special doc foobar
- There's no need to carry the special doc directory in the
  package struct, the directory is only a fleeting thing deep down
  in the filelist parsing. Handle local-only needs locally.
- No behavior/semantic changes intended or expected.
2012-05-16 17:05:26 +03:00
Panu Matilainen 29677605d4 Refactor special doc handling out of parseForSimple()
- Change parseForSimple() to return all filenames it finds, moving
  most sanity checking and decision making of what goes where to
  processPackageFiles() which has a better overall view of things.
  This also means we could trivially handle more than one file per
  %files line, but keeping the (now artificial) limitation for now
  at least.
- Collect special %doc arguments individually to a local ARGV,
  split the script generation and execution to a separate helper
  function.
- Actual semantics / behavior is not supposed to change (other than
  'cp' now getting called once per %doc arg, not per %doc line), but
  knock wood, this is a larger at-once change than I care for.
2012-05-16 16:05:53 +03:00
Panu Matilainen dda476dc77 parseForSimple() doesn't need the entire file list anymore 2012-05-16 12:03:56 +03:00
Panu Matilainen f2f591acae Negation doesn't make sense for any of the virtual file attributes
- The negate field is unused in all the attributes anyway, but
  the whole concept doesn't make any sense for the virtual file
  attributes. Simplifies the thing another little bit.
2012-05-16 11:40:38 +03:00
Panu Matilainen 13a7d31860 Handle %dir parsing with an internal file attribute
- Cleans things up a little bit by removing the special test
  for %dir in parseForSimple(). The separate isDir is still necessary
  for directory recursion tracking but that's separate from parsing
  the line.
2012-05-16 11:29:09 +03:00
Panu Matilainen 42eeec9341 Handle %docdir with an internal file attribute
- Simplifies and cleans up things a bit as parseForSimple() now only
  parses this and processPackageFiles() acts on the result, and
  doesn't need specific argument checking now (only %doc is allowed
  to have more than one file per line)
2012-05-16 11:05:44 +03:00
Panu Matilainen 8d277bbba6 Explicitly differentate internal/exported file attributes
- RPMFILE_EXCLUDE only exists during spec parse, and doesn't "leak"
  into headers only because the file is, well, excluded to start with.
  Unexport the internal-only bit and explicitly strip out any excess
  bits from data going to header. The current 16/16 split is artificial
  of course, RPMTAG_FILEATTRS is 32bit so there's plenty of room
  for growing new file attributes, with internal-only adjustments
  required.
- Eliminate RPMFILE_UNPATCHED while at it, this is a leftover
  from Suse patch rpms which are no longer used anywhere.
2012-05-16 10:58:00 +03:00
Panu Matilainen 2225fd7e92 Unmask %license directive when parsing %files section
- This always was a rare creature, driven to extinction long time
  ago when Copyright: changed to License: which masks the %license
  directive of %files list with a macro holding the the textual
  description from License tag, causing errors.
- Override %license during %files parsing to bring back its original
  meaning, useless as it might be in its current form.
2012-05-15 14:23:35 +03:00
Panu Matilainen 470705f17b Eliminate unused argument to parseForSimple() 2012-05-15 11:39:24 +03:00
Panu Matilainen 5784b99bdc Only pass what's needed to parseForCaps()
- It doesn't need the entire filelist, just the current file
  pointer (or actually just the caps string but for consistency...)
  That we need to track for capability presence overall is a different
  thing, that doesn't need to be in parseForCaps() at all.
2012-05-14 11:09:37 +03:00
Panu Matilainen 0b0664cabd Only pass what's needed to parseForLang()
- It doesn't need the entire filelist, just current file entry (actually
  just the lang pointer but for consistency with others...)
- We could (and perhaps should) now quite easily support %deflang as well,
  but leaving that to another time...
2012-05-14 11:04:34 +03:00
Panu Matilainen e0c2d4c41e Only pass what's needed to parseForConfig()
- It doesn't need the entire filelist, just current file entry.
2012-05-14 10:59:21 +03:00
Panu Matilainen 2c0416811a Only pass what's needed to parseForDev()
- It dosn't need the entire filelist, just the buffer and current
  file entry
2012-05-14 10:56:57 +03:00