- argiAdd() isn't as costly as argvAdd(), but it still involves unnecessary
reallocation on every addition as the number of files is predetermined,
and each file has an associated class index.
- Additionally fixes a mostly harmless glitch introduced in commit
65e616cc9fdd00f523939088fab1070021b9f742: the pool id's are one larger
than the indexes we store in headers, take this into account in the
debug output.
- argiAdd() isn't as costly as argvAdd(), but it still involves unnecessary
reallocation on every addition as the number of files is predetermined,
and each file has an associated color (whether its zero or something else)
- argvAdd() gets more and more costly as the number of files increase,
use a plain old string array where one is called for: the size
is predetermined (from another argv) and we're just copying the
strings for internal storage here. We do need to pay a little bit
more attention to details now though.
- The pool is mostly just a dumb storage space for this case, but
insertion to pool is far more efficient than argv search, add,
sort operation. The order does not matter as the actual information
is encoded in the string and then painfully parsed out again. This
could really use a special-purpose data structure for sanity but...
- The string pool is a natural fit for this and much more efficient
when the number of files (and classes) is large.
- This does have an effect on the generated classdict array: it's no
longer sorted, and we no longer always (possibly unnecessarily)
insert an empty string and "directory" in it, but only when they
actually exist. Neither change makes any difference for usage,
unless some 3rd party software is making assumptions about the
classdict contents they shouldn't be making (very unlikely anyway)
- 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.
- 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.
- 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.
- 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)
- 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)
- 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...
- 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.
- 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.
- 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.
- 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.
- 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.
- 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)
- 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
- 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.
- 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
- 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.
- 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.
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).
- 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.
- 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.
- 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.
- 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.