Panu Matilainen [Mon, 2 Jul 2012 11:30:24 +0000 (14:30 +0300)]
Dont use mmap() for anything, axe the code instead
- Commit
4cb02aa928d3e41f636d0e01356c7a3cb51018ee 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).
Phil Knirsch [Thu, 28 Jun 2012 07:21:04 +0000 (10:21 +0300)]
Arch macro for all supported PowerPC 64 processors (RhBug:818320)
Phil Knirsch [Thu, 28 Jun 2012 07:15:59 +0000 (10:15 +0300)]
Plain 32bit ppc cannot be a ppc64p7
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen [Wed, 27 Jun 2012 08:10:57 +0000 (11:10 +0300)]
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.
Panu Matilainen [Wed, 27 Jun 2012 08:08:25 +0000 (11:08 +0300)]
Fix obsoletes-thinko in rpmdbProvides()
- dbtag cannot possibly be on obsoletes here, we need to look at deptag
instead. This thinko in commit
5f1ec21518078e599b2499cf1ff852837ec33df7
renders that whole commit useless. Doh.
Panu Matilainen [Mon, 25 Jun 2012 07:34:22 +0000 (10:34 +0300)]
Add support for quilt (ticket #54) and bzr to %autosetup/patch
- These are both "appears to have roughly the intended effect" level
tested, but I'm not really familiar with either bzr or quilt so
any further refinements need to come from people actually familiar
with these tools.
Panu Matilainen [Thu, 21 Jun 2012 10:45:13 +0000 (13:45 +0300)]
Add a set of macros to further automate spec %prep tasks
- This adds two main macros (+ bunch of helpers) to automate the
common case tasks in %prep:
1) %autopatch which automatically applies all patches from a spec
2) %autosetup which (optionally) takes care of it all, and (also
optionally) sets up a git/hg repository of the unpacked source +
applied patches as it goes.
- This should be considered a starting point only, there are various
things to improve. Eg we'd like to be able to make backups
with plain patch (based on patch number maybe) and at least with git,
we'd like to be able be (optionally) use 'git am' patching style
to preserve original authors + commit messages etc.
- A noteworthy point here is that as these are fully implemented as
macros, they are compatible with several older rpm versions as well.
Panu Matilainen [Thu, 21 Jun 2012 06:45:16 +0000 (09:45 +0300)]
Fall back to using fsync() on systems without fdatasync()
- While fdatasync() is widely available on modernish systems,
OS X doesn't have it
Panu Matilainen [Tue, 19 Jun 2012 07:30:08 +0000 (10:30 +0300)]
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)
Panu Matilainen [Thu, 31 May 2012 15:09:23 +0000 (18:09 +0300)]
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.
Panu Matilainen [Thu, 31 May 2012 13:55:37 +0000 (16:55 +0300)]
xmalloc() and xrealloc() never fail, remove redundant checks
Panu Matilainen [Thu, 31 May 2012 13:42:23 +0000 (16:42 +0300)]
Call alloca() and stat() by their own names...
Panu Matilainen [Thu, 31 May 2012 13:34:45 +0000 (16:34 +0300)]
Eliminate unnecessary glob portability fiddles
- Flags available to our internal glob implementation do not depend on
posix/gnu/bsd defines
Panu Matilainen [Thu, 31 May 2012 13:31:42 +0000 (16:31 +0300)]
Eliminate VMS, MS-DOS, Windows and Amiga compatibility hacks in rpmglob
- We'll never run on these platforms, we just dont care...
Panu Matilainen [Thu, 31 May 2012 13:27:49 +0000 (16:27 +0300)]
Eliminate shell interruptability hack in rpmglob
Panu Matilainen [Thu, 31 May 2012 13:26:24 +0000 (16:26 +0300)]
We always have xstrdup() available, eliminate redundant alternatve
Panu Matilainen [Thu, 31 May 2012 13:24:57 +0000 (16:24 +0300)]
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
Panu Matilainen [Thu, 31 May 2012 13:21:57 +0000 (16:21 +0300)]
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.
Panu Matilainen [Thu, 31 May 2012 13:19:16 +0000 (16:19 +0300)]
Remove __GNUC__ conditionals on variable sized local arrays
- We require a C99 compiler anyway so these conditionals are not needed
Panu Matilainen [Thu, 31 May 2012 13:14:01 +0000 (16:14 +0300)]
Eliminate unnecessary libc header typedeffery from rpmglob
- No doubt important bits in glibc but unnecessary goo for our
internal implementation.
Panu Matilainen [Thu, 31 May 2012 13:02:41 +0000 (16:02 +0300)]
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.
Panu Matilainen [Thu, 31 May 2012 12:51:15 +0000 (15:51 +0300)]
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().
Panu Matilainen [Thu, 31 May 2012 12:40:51 +0000 (15:40 +0300)]
Export our own version of glob_pattern_p() as rpmIsGlob()
- Further preliminaries to hiding the glob() implementation
Panu Matilainen [Thu, 31 May 2012 12:37:11 +0000 (15:37 +0300)]
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.
Panu Matilainen [Wed, 30 May 2012 10:40:01 +0000 (13:40 +0300)]
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)
Panu Matilainen [Tue, 29 May 2012 09:56:06 +0000 (12:56 +0300)]
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.
Panu Matilainen [Mon, 28 May 2012 13:31:36 +0000 (16:31 +0300)]
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)
Panu Matilainen [Mon, 28 May 2012 12:26:49 +0000 (15:26 +0300)]
Generalize special doc attribute to "special dir"
Panu Matilainen [Mon, 28 May 2012 09:14:15 +0000 (12:14 +0300)]
Handle rpmfiNew() failure centrally in genCpioListAndHeader()
Panu Matilainen [Mon, 28 May 2012 09:02:47 +0000 (12:02 +0300)]
Fix spec parsing memleak from source header on buildarch recursion
Panu Matilainen [Mon, 28 May 2012 08:39:45 +0000 (11:39 +0300)]
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
Panu Matilainen [Mon, 28 May 2012 08:06:46 +0000 (11:06 +0300)]
Move file list freeing to helper function
Panu Matilainen [Mon, 28 May 2012 06:56:11 +0000 (09:56 +0300)]
Hardlink detection doesn't need entire filelist, just the actual records
Panu Matilainen [Mon, 28 May 2012 06:51:29 +0000 (09:51 +0300)]
isDoc() only needs the doc dirs, not the entire filelist
Panu Matilainen [Mon, 28 May 2012 06:47:58 +0000 (09:47 +0300)]
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.
Panu Matilainen [Mon, 28 May 2012 06:39:48 +0000 (09:39 +0300)]
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.
Panu Matilainen [Mon, 28 May 2012 05:57:09 +0000 (08:57 +0300)]
Use vfaMatch() for %config attributes as well
Panu Matilainen [Mon, 28 May 2012 05:54:30 +0000 (08:54 +0300)]
Unify %verify and virtual file attribute handling
Panu Matilainen [Mon, 28 May 2012 05:50:55 +0000 (08:50 +0300)]
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
Panu Matilainen [Fri, 25 May 2012 12:01:19 +0000 (15:01 +0300)]
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.
Panu Matilainen [Fri, 25 May 2012 11:14:42 +0000 (14:14 +0300)]
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.
Christophe Fergeau [Thu, 10 May 2012 21:27:56 +0000 (23:27 +0200)]
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).
Panu Matilainen [Mon, 21 May 2012 11:52:19 +0000 (14:52 +0300)]
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
Panu Matilainen [Mon, 21 May 2012 10:17:39 +0000 (13:17 +0300)]
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)
Panu Matilainen [Wed, 16 May 2012 14:01:29 +0000 (17:01 +0300)]
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.
Panu Matilainen [Wed, 16 May 2012 12:07:53 +0000 (15:07 +0300)]
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.
Panu Matilainen [Wed, 16 May 2012 09:03:56 +0000 (12:03 +0300)]
parseForSimple() doesn't need the entire file list anymore
Panu Matilainen [Wed, 16 May 2012 08:36:53 +0000 (11:36 +0300)]
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.
Panu Matilainen [Wed, 16 May 2012 08:29:09 +0000 (11:29 +0300)]
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.
Panu Matilainen [Wed, 16 May 2012 08:05:44 +0000 (11:05 +0300)]
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)
Panu Matilainen [Wed, 16 May 2012 07:40:01 +0000 (10:40 +0300)]
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.
Panu Matilainen [Tue, 15 May 2012 11:23:35 +0000 (14:23 +0300)]
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.
Panu Matilainen [Tue, 15 May 2012 08:39:24 +0000 (11:39 +0300)]
Eliminate unused argument to parseForSimple()
Panu Matilainen [Mon, 14 May 2012 08:09:37 +0000 (11:09 +0300)]
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.
Panu Matilainen [Mon, 14 May 2012 08:02:23 +0000 (11:02 +0300)]
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...
Panu Matilainen [Mon, 14 May 2012 07:59:21 +0000 (10:59 +0300)]
Only pass what's needed to parseForConfig()
- It doesn't need the entire filelist, just current file entry.
Panu Matilainen [Mon, 14 May 2012 07:56:57 +0000 (10:56 +0300)]
Only pass what's needed to parseForDev()
- It dosn't need the entire filelist, just the buffer and current
file entry
Panu Matilainen [Mon, 14 May 2012 07:53:49 +0000 (10:53 +0300)]
Only pass what's needed to parseForAttr()
- It doesn't need the entire filelist, just the buffer and current
or defaul file entry pointer
Panu Matilainen [Mon, 14 May 2012 07:42:23 +0000 (10:42 +0300)]
Only pass what's needed to parseForVerify()
- It doesn't need the entire filelist, just the buffer and current
or default file entry pointer
- Additionally initialize the local variables on declaration, cleaning
things up that little bit
Panu Matilainen [Mon, 14 May 2012 07:31:45 +0000 (10:31 +0300)]
Centralize fl.processingFailed setting for parseForFoo() calls
- All the parseForFoo() functions return an error code already,
on top of this they also set fl.processingFailed, which forces
passing the whole damn filelist to them when they'd only really
need the current buffer and (parts of) fl.cur / fl.def.
- Preserve former behavior of continuing parsing despite errors,
dunno whether it makes much sense though.
Panu Matilainen [Mon, 14 May 2012 07:16:31 +0000 (10:16 +0300)]
Add a helper function for freeing/resetting a file entry, use it
- Now with all the per file-entry data in a struct of its own this
becomes sane and should plug up a couple of leaks as well.
Panu Matilainen [Mon, 14 May 2012 07:00:13 +0000 (10:00 +0300)]
Eliminate redundant filelist initializiation
- The file list gets zeroed out with memset(), eliminating all this
noise lets the actually necessary initialization tasks more obvious.
Panu Matilainen [Mon, 14 May 2012 06:20:37 +0000 (09:20 +0300)]
Split out the remaining "current file" state out of global filelist
- We're unlikely to ever want default counterparts for directories
and devices, but moving these out of the global state tracking
will allow for saner handling of this constantly changing
state nevertheless.
Panu Matilainen [Mon, 14 May 2012 06:14:52 +0000 (09:14 +0300)]
Split file languages and capabilities out of the global filelist
- These are only releavant for "current" entry but it wouldn't seem
unreasonable (if not terribly useful mayhap) to be able to have defaults
for these as well. No functional changes yet though.
Panu Matilainen [Mon, 14 May 2012 06:10:10 +0000 (09:10 +0300)]
Split the file attribute recs (permissions) out of the global filelist
- Same as previous commit: moving these to a common struct will
allow various benefits like more shared code. For now just
moving things, no other changes.
Panu Matilainen [Mon, 14 May 2012 05:55:20 +0000 (08:55 +0300)]
Split the various file flags out of the global filelist struct
- Active defaults and current values share several properties, moving
them to a common struct will allow more code to be shared when
manipulating them. For now just splitting things piece by piece
though, no functional changes.
Panu Matilainen [Mon, 14 May 2012 05:42:05 +0000 (08:42 +0300)]
Shuffle FileList members around for a more logical grouping
Panu Matilainen [Fri, 11 May 2012 08:57:09 +0000 (11:57 +0300)]
Improve spec %include error detection and message
- Besides excess arguments, catch missing argument too
- Log filename and line number like with other error messages
Panu Matilainen [Fri, 11 May 2012 08:30:26 +0000 (11:30 +0300)]
Unify pops from spec file stack to a function
- Previously done in two different places, calls for a function eh?
Panu Matilainen [Fri, 11 May 2012 08:04:42 +0000 (11:04 +0300)]
Simplify / sanitize pushing new files on spec file stack
- Replace the rather useless newOpenFileInfo() "constructor" with
a function to push a new filename on spec stack, creating the
OFI struct as we go. forceIncludeFile() becomes so simple its
no longer necessary at all.
Panu Matilainen [Thu, 10 May 2012 08:49:24 +0000 (11:49 +0300)]
Keep the macro buffer terminated on append
- This isn't strictly needed as we're terminating the buffers "just in
case" all over the place but handling this centrally might allow
some day eliminating the other fluff...
Panu Matilainen [Thu, 10 May 2012 08:28:39 +0000 (11:28 +0300)]
Fix off-by-ones in mbAppend() and mbAppendStr()
- Oops, remember to reserve space for the trailing \0 when appending.
mb->nb holds the number of actual characters left in the buffer,
not the terminator. Fixes a regression introduced in rpm 4.9.x
dynamic macro realloction work (RhBug:431009 reprise)
Panu Matilainen [Mon, 7 May 2012 12:29:14 +0000 (15:29 +0300)]
Simplify mono file magic regex
- Begin/end restrictions with wildcards on both ends dont make much
sense, just match on the plain (sub)string
Panu Matilainen [Mon, 7 May 2012 12:17:45 +0000 (15:17 +0300)]
Relax python file magic regex somewhat
- libmagic sometimes adds trailing descriptions about encodings, line
terminators and whatnot, we dont want to care about those (RhBug:796218)
- not all python-related strings start with [pP]ython either, sometimes
libmagic says "a python script" or "a /usr/bin/python script" and
whatnot, so loose the start-of-line restriction as well
Panu Matilainen [Mon, 7 May 2012 11:51:32 +0000 (14:51 +0300)]
Tweak font magic regex a bit (yet again)
- Lose the pointless begin/end restrictions, take the optional
space into account for both optional parts (one of the later issues
in RhBug:757105)
Michael Schroeder [Thu, 3 May 2012 09:49:56 +0000 (11:49 +0200)]
Small patch to reverse hardlink ordering
Hi Panu et al,
Here's a small patch that changes the ordering used for putting
hardlinked files into the cpio archive back to lexicographical.
You might wonder what this is about. Well, old rpm-3 (and
also old versions of rpm-4, I think) already used lexicographical
ordering for files and hardlinks. When deltarpm was created,
it made use of this fact when "compressing" the file order
of the cpio archive into the so-called "sequence". Deltarpm
can deal with "out of order" files, but in that case it needs
to reset the compression, which leads to really long sequence
strings.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen [Thu, 3 May 2012 13:15:59 +0000 (16:15 +0300)]
Fall back to private db environment on system level EINVAL
- BDB wants to use mmap() for its environment by default, but not
all (file)systems support this, as pointed out by Daniel Drak.
However env->open() can return EINVAL for a number of reasons,
require all the fallback reasons to be system level errors to
differentiate from "logical" errors such as incompatible flags
to (possibly pre-existing) db environment, in which case we better
just error out.
Panu Matilainen [Wed, 2 May 2012 12:17:01 +0000 (15:17 +0300)]
Eliminate unused selinux file context path macros
- These haven't been used by anything since rpm 4.8.x days,
nowadays we just use selinux_file_context_path() instead
Panu Matilainen [Tue, 24 Apr 2012 12:52:41 +0000 (15:52 +0300)]
Eliminate rpmts usage from lower levels of fsm machinery
- The only remaining use for rpmts here was grabbing NODIGESTS
from rpmtsFlags(). Pass the tiny little piece of information
as an argument for the one place needing it and rip all the
now unused related goo.
Panu Matilainen [Tue, 24 Apr 2012 12:45:24 +0000 (15:45 +0300)]
Only install needs selabel handle, dont bother elsewhere
Panu Matilainen [Tue, 24 Apr 2012 12:33:40 +0000 (15:33 +0300)]
Dont bother with fsm-level digest statistics
- Most of fsm doesnt need the actual transaction set for anything "real"
and dragging it around as a mere statistics collector seems
pretty dumb. If we want better statistics, we better come up with
a saner way to gather them.
Panu Matilainen [Tue, 24 Apr 2012 11:28:03 +0000 (14:28 +0300)]
Eliminate rpmts and rpmte kludgery from package building
- Package building has no associated transaction or ts members,
this was all just fake-up kludgery to work around the way how
fsm used to work. None of it relevant now, kill kill kill.
Panu Matilainen [Tue, 24 Apr 2012 11:16:21 +0000 (14:16 +0300)]
Eliminate rpmte usage from lower levels of fsm machinery
- Determine the need for reverse iteration based on fsm goal
- Everything else was just using rpmte to get to its file states,
eliminate the intermediate ping-pong by passign the file states
around directly. Makes the thing that little bit less silly.
Panu Matilainen [Tue, 24 Apr 2012 11:01:46 +0000 (14:01 +0300)]
Move mode-specific flag setting out of fsmNew()
Panu Matilainen [Tue, 24 Apr 2012 10:48:11 +0000 (13:48 +0300)]
Clean up file backup logic a bit
- Ghosts are never backed up, and the whole business is irrelevant
for package building. Use fsm goal instead of rpmte mode to
determine what to do, rpmte in build code is nothing but an ugly hack.
Panu Matilainen [Tue, 24 Apr 2012 10:36:38 +0000 (13:36 +0300)]
Eliminate header and rpmte knowledge from rpmfs
- rpmfs is such a low-level construct it doesn't need to know anything
about the upper layers. Gather the necessary bits of info in the
sole caller instead and pass only whats needed to rpmfsNew() to
enable creating a filestate item without having rpmte/header at hand,
which we'll be needing in the fsm shortly.
Panu Matilainen [Tue, 24 Apr 2012 09:36:26 +0000 (12:36 +0300)]
Bury build filestate setting inside fsm remains
- This whole thing probably isn't needed anymore, but for now just
lift the FA_SKIP/FA_COPYOUT setting to rpmPackageFilesArchive(),
allowing rpmfsSetAction() to become properly internal-only function.
- Trim out unnecessary now unnecessary librpm internal includes
from librpmbuild code
Panu Matilainen [Tue, 24 Apr 2012 08:55:37 +0000 (11:55 +0300)]
Split out file state recording out of fsmMapPath()
- The file state that gets stored in the rpmdb has nothing to do with
path and is only relevant for installs.
Panu Matilainen [Mon, 23 Apr 2012 12:35:29 +0000 (15:35 +0300)]
Fix quoting in brp-python-hardlink (patch from Jon Nelson)
Panu Matilainen [Mon, 23 Apr 2012 08:16:04 +0000 (11:16 +0300)]
Add a few basic test-cases for tilde in version comparison
Michael Schroeder [Mon, 23 Apr 2012 08:04:02 +0000 (11:04 +0300)]
Add support for dpkg-style sorting of tilde in version/release
- This allows much nicer handling some common scenarios such as
upstream pre-releases where the pre-release version would normally
appear newer than final release, eg 1.0-rc1 vs 1.0. Previously this
required mapping the pre-release tag into the release tag to achieve
desired sorting, with tild this becomes simply 1.0~rc1 < 1.0.
- Add a rpmlib() tracking dependency to prevent older rpm versions
from getting confused with packages relying on the new behavior.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen [Fri, 20 Apr 2012 10:29:21 +0000 (13:29 +0300)]
Add further version comparison test-cases
- Add pile of further tests for the more common constructs,
collect various (old and new) corner cases from bugzilla.
Panu Matilainen [Fri, 20 Apr 2012 06:31:17 +0000 (09:31 +0300)]
rpmdsMatchesDep() isn't correct on obsoletes
- Fix oversight in commit
9fb81eac0bcd239e46459f72916099f1adfc5cb9:
rpmdsMatchesDep() works on provides, but obsoletes are matched on
package name so we want rpmdsNVRMatchesDep(). rpmdsMatchesDep()
"worked" as the implicit self-provide is always at the 0 index
on packages created by modern rpmbuild, but this isn't really
guaranteed: very old V3 rpms can have something else at the
first index, and ditto for non-rpmbuild created packages.
- Thanks to Michael Schroeder for pointing this out.
Panu Matilainen [Wed, 18 Apr 2012 09:48:58 +0000 (12:48 +0300)]
Pay attention to NULL returns from rpmcpioOpen()
- The archive interface might actually want separate new + open,
but for now just flag an internal error on NULL return on archive open.
Panu Matilainen [Wed, 18 Apr 2012 09:34:45 +0000 (12:34 +0300)]
Sanitize fsm creation/initialization and destruction
- Now that there are no more failing parts requiring return codes,
change + rename fsmSetup() into a more regular fsmNew() construct,
returning newly "instance" of fsm and similarly fsmTeardown() ->
fsmFree() to free the thing.
- There's no real need to allocate this stuff on heap, but doing
so makes life actually simpler for the three callers and makes the
whole thing more consistent with common practises in the codebase.
Panu Matilainen [Wed, 18 Apr 2012 09:18:35 +0000 (12:18 +0300)]
Split out hardlink checking from fsmTeardown()
- Checking missing links is only relevant for install, lift the
code to separate function and call from the install-case only.
- Freeing data while checking seems like a dubious "optimization"
but to keep changes minimal, leaving that as it is now.
Panu Matilainen [Wed, 18 Apr 2012 09:09:06 +0000 (12:09 +0300)]
Eliminate unused leftover rc member from fsm struct
Panu Matilainen [Wed, 18 Apr 2012 08:38:29 +0000 (11:38 +0300)]
Move cpio end trailer detection to the cpio code
- The fsm shouldn't know any archive format specifics, detect the trailer
from rpmcpioHeaderRead() and signal EOF through CPIOERR_HDR_TRAILER
instead.
Panu Matilainen [Wed, 18 Apr 2012 07:30:11 +0000 (10:30 +0300)]
Separate payload archive close and free
- When writing, archive finalization can write further data into
the payload (eg cpio trailer). We need to be able to fish the
final archive size *after* closing it, otherwise archive size
will be off by trailer size.
- Add new rpmcpioFree() function which simpy frees the archive struct,
calling rpmcpioClose() in the process if it wasn't already done.
- This also simplifies the error code gymnastics in fsm: we need to
free the resources whether error or not, which rpmcpioFree() allows
us to do. And for writers, calling rpmcpioClose() only needs to
be done if earlier parts were successfull, so we dont need to worry
about masking a former error code when calling it.
Panu Matilainen [Wed, 18 Apr 2012 07:09:01 +0000 (10:09 +0300)]
Always return NULL from fdFree()
- Up to now, if the fd had remaining references fdFree() would return
the supposedly free'd fd back to us, which is unlike anything else
in rpm. Make this consistent with the rest of rpm finally as the
last remaining caller requiring the old semantics is gone from
the codebase (somewhere between 4.9 and 4.10): always return NULL,
as the referenced instance is now gone as far as the caller is concerned.