Commit Graph

1928 Commits

Author SHA1 Message Date
Panu Matilainen 6104478265 Eliminate leftover, commented debugging printf() 2014-10-08 15:25:35 +03:00
Panu Matilainen 99edd77385 Only add per-file dependencies if we collected them
- Legacy generators dont create a dependency dictionary, in which
  case there's no point adding per-file depends dictionary indexes
  (all zeros) either. Should've probably been in
  commit 05636a7db2 already.
2014-10-08 15:14:44 +03:00
Panu Matilainen b857171b78 Move internal vs external depgen decision to rpmfcApply()
- Rename the actual worker functions for consistency, rpmfcApply()
  is now just a simple wrapper around the two
2014-10-08 11:45:24 +03:00
Panu Matilainen 30165a31dd Dont bother passing pkg to rpmfcGenerateDependsHelper()
- This is already available through fc
2014-10-08 11:37:32 +03:00
Panu Matilainen 6e76016fbe We already have the files with buildroot prepended here... 2014-10-08 11:06:22 +03:00
Panu Matilainen d582d6ea6c Pass file classifier, not spec, to external depgen helper 2014-10-08 11:02:08 +03:00
Panu Matilainen a20794e78f Permit NULL spec in rpmCharCheck()
- It can get called when parsing automatically generated dependencies
  and those do not correspond to any particular spec lines
2014-10-08 10:54:56 +03:00
Panu Matilainen 64150dbad8 Refactor current file index from rpmfc struct
- There's no good reason for having a "current index" within fc,
  and the code is easier to read when its clear its just an index
  of a silly for-loop and not something fancier.
2014-10-08 10:31:59 +03:00
Panu Matilainen 05636a7db2 Generate file classes and colors regardless of dependencies (RhBug:1150209)
- File coloring affects ability to install packages on multilib
  systems when relying on color conflict resolution (eg Fedora, RHEL),
  and that has zero to do with whether package dependencies are being
  automatically generated or not. Always generate file classification
  and the coloring based on that.
- Besides fixing coloring where AutoReqProv: 0 is used (ie RhBug:1150209),
  this also fixes two issues when the legacy external dependency generator
  is used: file coloring (RhBug:lotsa) and config() dependency generation.
  So in default configuration, internal vs external depgen now only
  affects whether dependencies are recorded on file or package level,
  otherwise the produced packages should be fully equivalent now.
2014-10-08 10:30:18 +03:00
Panu Matilainen 104856ea17 Unbreak size and archive size generation on big-endian systems
- Fix regression from commit 68bddc353a,
  accessing a 64bit int as if it were a 32bit one doesn't make it one.
2014-10-07 15:37:21 +03:00
Panu Matilainen 9b9e0ca4d4 Dont preserve ownership from tar when root (RhBug:1133946)
- Tar defaulting to preserving owner etc makes sense for its normal
  uses, but for rpmbuild its not a good idea, ownership needs to be
  set in spec for consistency and sanity.
2014-09-30 12:56:07 +03:00
Panu Matilainen a655cee655 Fix archive size tag missing cpio trailer size (RhBug:1142949)
- Fixes regression from commit 7f84a126ab
  which causes archive size to be determined before closing the archive
  when closing actually writes the cpio trailer into the archive. Thus
  RPMTAG_ARCHIVESIZE (and RPMTAG_LONGARCHIVESIZE) are off by the
  cpio trailer size in all packages built with rpm 4.12.0 and
  pre-releases :(
- Move rpmcpioFree() to rpmfiFree() to allow Tell() on the archive
  after closing it, swap to original order of things on build-side.
2014-09-18 11:05:00 +03:00
Panu Matilainen 1b3f7547c5 Turn invalid double separator error into a warning
- As hysterical as it seems, people keep banging their heads into this:
  older distros have these invalid dependencies deployed etc and people
  do expect to create srpms and do test-builds on newer distros they're
  running themselves. Which, put that way, seems rather reasonable...
- For history reference, the sanity check was originally introduced in
  commit b2cf1471bb and
  67ccf8d996,
2014-09-17 09:52:25 +03:00
Michael Schroeder f10707f385 Support IF in conflicts dependencies
It's not much code and it does not slow down depenency checking.
2014-09-15 12:07:30 +02:00
Panu Matilainen 4bc2900bae Dependency refactor whack-a-mole, aka One More Time...
- Commit 0bda2faa4d fixed manual
  dependencies in rpmspec queryies, but missed automatic self-provides.
  Add the self-provides before the first round of header dependency
  population to fix. SIGH.
- Another sorta related side-effect is that the exact order of rpmspec
  output changes as things are now properly sorted, previously it
  was a mixed bag.
2014-09-12 20:39:20 +03:00
Michael Schroeder 2b64fdd9c7 Parse rich dependencies in spec files
We use the callback to normalize the rich dependency (i.e. strip
spaces, canonicalize op names).
2014-09-12 16:58:18 +02:00
Michael Schroeder 21a17daa1b Add RPMSENSE_RICH for rich dependencies
Rich dependencies will be stored as a string with no EVR and the
RICH flag set. This unfortunately means that we have to parse
them again when checking dependencies.

Also add a rpmlib() marker when a rich dependency is used as
conflicts or requires dependency.
2014-09-12 16:45:27 +02:00
Michael Schroeder 4e8218f066 Use correct type in rpmSanitizeDSFlags and rpmParseDSFlags 2014-09-12 14:50:59 +02:00
Michael Schroeder e3e5ba7603 Refactor dependency comparison parsing into rpmds
The function will be used by the rich dependency parser
as well.
2014-09-12 14:39:34 +02:00
Michael Schroeder 9b44c75811 Drop fsize parameter from rpmCharCheck()
Everybody calls it with the length of the string and the
strstr it uses ignores the fsize parameter anyway.
2014-09-11 13:53:16 +02:00
Panu Matilainen 622e066153 Simplify tilde-dependency checking
- Now that all our dependencies are in per-package rpmds arrays this
  is far easier (and faster as well)
2014-09-10 12:25:21 +03:00
Michael Schroeder ca370a598e Add back comment lost with commit #e2ce4c21 2014-09-09 17:25:49 +02:00
Michael Schroeder a5228bed4a Clean up dependency relation parsing
Fix indenting and simplify control flow.
2014-09-09 17:17:08 +02:00
Michael Schroeder e2ce4c2103 Refactor dependency checking code into checkDep() 2014-09-09 17:07:15 +02:00
Michael Schroeder fea73eee33 Use rpmRC return type in checkSep 2014-09-09 16:58:06 +02:00
Panu Matilainen cac311c2dd Regression the 13th: The Final Friday
- Yet another regression from the recent dependency refactoring and
  ensuing patches-on-patches-on-patches work: some rpmlib() dependencies
  (payload, tilde) are added as late as writeRPM(), those have been going
  to /dev/null recently.
- The fix actually removing code is probably a good sign...
2014-09-09 13:03:44 +03:00
Panu Matilainen 35a7b29421 Add utf-8 validation to librpmbuild, take 1 (ticket #30, RhBug:948712, ...)
- This adds brutally simple utf-8 validation to spec parse & package
  construction: all string-class tags in headers are checked regardless
  of other tag semantics.
- Parse-time validation is optional via RPMSPEC_NOUTF8
  flag, but package construction time is required as we want to
  stomp RPMTAG_ENCODING to all packages that pass. What is always
  optional is whether non-valid utf-8 strings fail the build, defaulting
  to off (but distros probably want to enable it)
- Note we dont give a damn about the spec itself, only what ends up in
  packages: strings can come from numerous other sources than spec
  directly, and OTOH who cares if eg spec comments are non-utf?
2014-09-08 14:00:19 +03:00
Panu Matilainen 49f2bb7d8f Dirty kludgery to fix rpmdeps segfault (RhBug:1131892)
- Another regression from the recent rpmfc work, in rpmdeps context
  there's no spec or packages from it. Allocate a dummy package so
  we have some place to store the dependencies. And yes its ugly.
2014-08-25 12:33:31 +03:00
Panu Matilainen 8b540fbf1b Resurrect rpmlib() dependencies on source rpms
- Commit 0bda2faa4d caused a regression
  where rpmlib() dependencies are no longer added to src.rpm packages
  as the header is populated early, whereas rpmlib() dependencies
  get added late in the game. So nothing was pushing the rpmlib
  stuff to header. Sigh.
2014-08-25 11:03:00 +03:00
Panu Matilainen 404f053f78 Resurrect dependency spew during build
- Since commit a357c99c58 the dependencies
  are no longer in the header so there's little to print from there.
  As it happens things are much saner this way, we no longer need
  to create rpmds'es just to print stuff.
2014-08-25 10:41:27 +03:00
Panu Matilainen 6ee2468934 Revised fix for RhBug:1131892
- Didn't realize there's rpmdsTagTi() now, which is fit for this
  purpose and doesn't look as much out of line with the others.
  No functional changes here though.
2014-08-21 16:06:45 +03:00
Panu Matilainen 1566c18b6e Delete trigger indexes too from header before adding again (RhBug:1131892)
- Fixes regression introduced in the regression-fix
  commit 0bda2faa4d, *facepalm*
- Unlike other dependency types, trigger dependencies involve a fourth
  tag which we forgot to delete before adding again, causing duplicate
  trigger indexes
2014-08-20 15:10:36 +03:00
Panu Matilainen 0bda2faa4d Populate manual dependencies into spec pkg headers early too
- Similar to commit 1b41c91431, rpmspec
  and other tools expect to find manually specified dependencies
  from the headers of a freshly parsed spec. This means we need to
  add this cruft two times: once for the manual dependencies and then
  scratch all that and redo from start after automatic dependencies
  have been discovered at the end of package build.
- Fixes another regression (rpmspec dependency queries went dead)
  introduced in commit a357c99c58
2014-08-18 16:46:13 +03:00
Panu Matilainen 1b41c91431 Populate src.rpm header with dependencies early again
- BuildRequire checking requires a header populated with dependencies,
  commit a357c99c58 changed this to
  occur too late for this purpose. Move to initSourceHeader() seems
  to fix, also goes to show we dont have a test-case for buildrequires...
2014-08-18 15:04:23 +03:00
Lubos Kardos 5dfb6e6624 parseSimplePart() returned bad return code in case of failure (RhBug:1123722) 2014-07-28 09:26:05 +02:00
Panu Matilainen e49c51e451 Eliminate unused spec argument from parseExpressionBoolean()
- Its never been used beyond assignment to the internal state struct,
  so in reality this is entirely free of any rpmbuild-specifics.
  Meaning we could trivially lift it to librpmio for macros...
- No functional changes here
2014-07-10 13:55:28 +03:00
Florian Festi 90b821df89 Make package dependencies an array 2014-07-08 15:42:54 +02:00
Florian Festi 98a73b7ce0 Add weak deps to the dependency generators 2014-07-08 15:42:54 +02:00
Florian Festi 11a8af9c07 Make calling the dependency generators more generic 2014-07-08 15:42:54 +02:00
Florian Festi a357c99c58 Do not write the dependencies to the header instantly.
Add the dependencies generated from the files to the package and write them to the header at the end.
2014-07-08 15:42:54 +02:00
Florian Festi 400834a731 Redo addReqProv to no longer deal with all tags explictly 2014-07-08 15:42:42 +02:00
Florian Festi c08796791e Add packageDependencies() to allow accesing the rpmds by name tag 2014-07-08 15:28:05 +02:00
Lubos Kardos 899d602616 addReqProv() and handleOneTrigger() now use rpmds with trigger indices. 2014-07-08 11:49:46 +02:00
Panu Matilainen 3f2f483515 Use unified libtool version for all our libraries
- Our libraries are in reality so interdependent that its not even
  possible to use them independently of others, so having them
  all follow sort of independent versioning information just doesn't
  make any sense and is a PITA everytime I need to touch the data.
- This causes librpmsign soname bump with no good reason so its
  probably "evil" and all ... so sue me, its not as if anybody
  is actually using this library outside rpm itself.
2014-06-25 13:21:00 +03:00
Panu Matilainen 713914bde1 Drop the experimental collection support
- The basic concept is not without merit but what was implemented here
  has been stuck in experimental state in middle of two sorta conflicting
  goals for four years now, and world has moved onward in the meanwhile.
  The sepolicy part is better handled in the new selinux plugin, and other
  action business belongs to packages (in the form of some trigger-like
  scripts or such) rather than rpm plugins.
- Deleted here, but the sepolicy plugin functionality still needs
  merging into the new selinux plugin...
- RPMTAG_COLLECTIONS left in place but tagged unimplemented as per policy
  to never actually remove tags
2014-06-17 16:27:24 +03:00
Lubos Kardos 90833a57c5 Reserve space for gpg signature during building of package.
- During building of a package a dummy tag is added to the signature
header. This tag reserves some space for gpg signatures. So during
signing of the package the gpg signatures can be put in this reserved
space and it is not necessary to rewrite the whole package to make some
space for gpg signatures.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-21 13:02:44 +03:00
Lubos Kardos 68bddc353a Function writeRPM was modified to one pass implemntation to improve performance. Now data aren't written into temporary file and then copied into final file but they are directy written into final file.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-05 11:23:10 +03:00
Lubos Kardos cc8232d1d5 No longer needed.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-05-05 11:23:10 +03:00
Tomas Mlcoch e67fad1a1f Fix creation of file manifest in rpmfcGenerateDependsHelper()
- Fixes regression from commit 0c2a5d5868

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-03-24 10:39:47 +02:00
Florian Festi 47e879d550 Remove no longer needed rpmfi_internal.h include 2014-03-05 10:47:57 +01:00