Commit Graph

1466 Commits

Author SHA1 Message Date
Panu Matilainen d71964bda5 Lose the useless rpmio refcounting debug junk
- the rpmio API always had this goo, should've gotten rid of it
  back in commit dbdbe8010c but .. oh well
2010-03-22 13:25:57 +02:00
Panu Matilainen c586c9955c Lose the useless rpmfi refcounting etc debug messages + debug switches
- get the debug messages out of API, this is what should've been in commit
  dbdbe8010c
2010-03-22 12:49:45 +02:00
Panu Matilainen ad43e72d70 Bury FTS inside librpmbuild and eliminate from public ABI 2010-03-19 18:23:52 +02:00
Panu Matilainen 12802c36c9 Avoid eating empty lines in spec %prep section (RhBug:573339)
- In spec %prep context empty lines don't usually matter but they can
  be significant in eg here-documents.
- Fixes regression from commit 94ff22b129
2010-03-15 12:00:55 +02:00
Panu Matilainen e34d752b92 More dumb thinko/typo/braindamage in scriptlet expansion patches
- qformat certainly shouldn't default to on, duh
2010-03-11 13:34:17 +02:00
Panu Matilainen d370816ba5 Support run-time macro and queryformat expansion on scriptlets
- Add per-scriptlet type flag tags to control special behavior.
- Add rpmlib dependency on scriptlet expansion - if a package relies
  on scriptlet expansion it cannot be correctly installed with
  a version of rpm that doesn't support it.
- Expansion is always an opt-in behavior, enabled with -q and/or -e argument
  in spec. We can't just blindly expand even macros as there's no telling
  %{} constructs might mean in whatever language is used for the script.
- Queryformat expansion requires great care with strange and ugly escapes
  when writing scriptlets, but OTOH it permits access arbitrary header
  data at runtime, which has previously been completely impossible.
- The handling of these expansions needs unifying for all scriptlet types,
  the trigger scriptlet handling is uuugly. Macro expansion could be
  transparently done from rpmScriptRun(), but because of their similar
  syntax, macro expansion needs to happen before query format expansion,
  and we dont have the header available in rpmScriptrun()
2010-03-11 12:06:49 +02:00
Panu Matilainen 4878580634 Lose a couple of leftover variables from times before headerPutString() 2010-03-06 11:04:48 +02:00
Panu Matilainen 1ab5fa94e3 Dont bother translators with internal error debug foo 2010-03-06 11:03:11 +02:00
Panu Matilainen b1afaf7471 rpmdsN() and rpmdsEVR() returning NULL here is a serious can't happen 2010-03-06 11:01:08 +02:00
Panu Matilainen c3c5eae10b Remove now unused inFtw from file lists 2010-03-01 15:55:57 +02:00
Panu Matilainen d46f752c39 Lose ancient prefix remnants from build code
- since commit 840599e3d9 in 1998, nothing
  has set RPMTAG_DEFAULTPREFIX meaning fl.prefix is always NULL...
2010-03-01 15:52:46 +02:00
Ville Skyttä da5b85fb23 Fix rpmfcAttrDeps() for perl modules (was broken in c03be327). 2010-03-01 11:53:54 +02:00
Panu Matilainen 0e36eb1370 Perform dependency extraction solely based on collected attributes
- Yank out the now unnecessary apply table + related apply functions, simply
  collect dependencies for whatever attributes we found for a given file
2010-02-18 13:23:18 +02:00
Panu Matilainen f6534fa920 Classify .desktop files by just path
- Previously we required a file to be classified as text and have
  .desktop suffix, for now replace that with just a regex. We'll eventually
  want/need some extra qualifying logic to handle cases like these,
  eg "only apply path attributes if condition X is also true"
2010-02-18 12:44:05 +02:00
Panu Matilainen e9e3b5eb6e fontconfig -> font dependency extractor rename
- No functional changes, just clearing the naming conventions to avoid
  having to extra mapping for attribute -> extractor name. The current
  font provides are handled by fontconfig, but that's just an internal
  implementation detail.
2010-02-18 12:31:34 +02:00
Panu Matilainen 3d94b4f594 Add debug output for file attributes 2010-02-18 12:26:03 +02:00
Panu Matilainen 3b40816421 Add path coloring for versioned python interpreter itself
- pythondeps.sh knows how to figure python(abi) provide from
  /usr/bin/pythonN.N version but as that's an ELF file, pythondeps.sh
  never got a chance to run on that file
2010-02-18 12:25:04 +02:00
Panu Matilainen 759c03dac2 Replace python-specific path-coloring hack with a generic mechanism
- Use a table of regex pattern - attribute list pairs to apply any
  additional path based attributes. While the fundamental type of a file
  certainly does not depend on its location on the filesystem, its
  location *does* have attached semantics and it'd be just silly to
  ignore that fact.
- The current implementation is dumb as it ends up recompiling the regexes
  and splitting the attr strings a million times. OTOH compiling the
  regexes into the static rpmfcPathTable would be wrong as the patterns
  can contain macros and they can vary from package to package when building
  several packages on one invocation. The attribute split + regex compilation
  should be done once per rpmfc instanciation...
2010-02-18 11:47:34 +02:00
Panu Matilainen 11ed0f75fe Script/interpreter terminology renaming
- No functional changes, just making more obvious mapping between
  attributes and the dependency extractor names. This also leaves the
  term "interpreter" free for use for the actual interpreters, such
  as interpreter(python) provides if we go that way (ticket #136).
2010-02-18 10:35:21 +02:00
Panu Matilainen d72cc38d30 Eliminate silly redundancy
- rpmfcSaveArg() and addAttr() were the very same thing, unify
- turn hasAttr() into a macro, its just dumb enough for that
2010-02-18 10:26:24 +02:00
Panu Matilainen c315beb319 Only run dependency extractors on files with attached attributes
- looking at file colors still works as every relevant type has
  RPMFC_INCLUDE set but this includes various things we might not have
  attributes for, just avoids unnecessary work and is more obvious this way
- should really have been in commit ad2c8485ea
2010-02-17 17:12:52 +02:00
Panu Matilainen 76c2fd5a93 Simplify rpmfcAddFileDep()
- rpmfcHelper() already has the "deptype" character in the format
  we want for file deps, pass it as argument avoiding bunch of silliness
2010-02-17 17:03:19 +02:00
Panu Matilainen ad2c8485ea Use text token attributes instead of bitfield for file classification
- 32 bits are nowhere near enough to meaningfully classify all the
  types of data we might want to extract dependencies for, the bitfield
  was already almost used up and twisty with embedded enumeration in the
  middle etc. With text-based tokens, there are no limits to the total
  number of known attributes or number of attributes that can be attached
  to a given file. This also paves way to moving the classification table
  out of librpmbuild into configuration file(s).
- Remove most of the now unused RPMFC_FOO definitions from the FCOLOR enum,
  leaving just the more abstract INCLUDE, WHITE etc which control other
  aspects of the operation. Also ELF is special as the value ends up
  in headers, preserve it too.
2010-02-17 15:09:20 +02:00
Panu Matilainen f3ca4fb481 Plug a silly memleak in processPackageFiles() 2010-02-17 12:58:40 +02:00
Panu Matilainen 33ea7cbd96 Permit requires extraction too from fontconfig and desktop files
- presently unused but...
2010-02-10 11:22:04 +02:00
Panu Matilainen 87c237bebf Split elf dependency extraction out of librpmbuild to external helper
- Elf dependency extraction code code lifted from rpmfcELF() and refactored
  to saner pieces. Having it in separate executable also frees librpmbuild
  of libelf dependency, clean up the unnecessary linkage etc from
  autofoo
- This lets internal dependency generator for elf files be
  overridden without losing file coloring (which is required for
  correct multilib handling). It also permits non-native elf files
  (eg when cross-building) to be handled by providing a custom
  elf dependency helper
- On the flip side, this inevitably slows down builds somewhat as
  two fork-exec's are needed for every elf file, but unlike invoking
  something like the python interpreter, this is a slim helper...
- All dependency extractors of the internal dependency generator are now
  external helpers (how twisted is that, huh? :) and thus can be customized
  and filtered through %__foo_provides|requires macros
2010-02-10 11:20:51 +02:00
Panu Matilainen a79822f382 Separate helper for script interpreters, split out of librpmbuild
- permit overriding/customization of script interepreter dependencies
- unlike the C-version, the interpreter.req only looks at the first line
  for shebang: libmagic only looks at the first line too, so anything
  else will never get classified as scripts in the first place
2010-02-10 11:19:49 +02:00
Panu Matilainen c03be327fe Make rpmfcSCRIPT() a bit easier on the eyes... 2010-02-10 09:24:21 +02:00
Panu Matilainen 38291e191c Clean up rpmfcClassify() a bit more
- push variables to the local blocks they're actually needed in, sanitize
2010-02-01 13:39:42 +02:00
Panu Matilainen a6a9d63862 Single point of exit for rpmfcClassify()
- cleans up returns + avoids a possible memleak from fcav on failure
2010-02-01 13:39:42 +02:00
Panu Matilainen 79b169bdce Clean up rpmfcHelper() a bit
- push local variables to the scope where actually needed
- use ARGV_t routines for creating av, makes allocations more obvious
2010-02-01 13:39:42 +02:00
Panu Matilainen fdf26eaba0 rpmfc script coloring tweaks
- loosen up the perl token to catch more things, such as
  "/usr/bin/perl -w script text"
- remove unnecessary /usr/bin/python token, these get caught by "python "
  already
- remove what now should be unnecessary coloring by interpreter name,
  both perl and python scripts should get colored by the tokens already
2010-02-01 13:39:42 +02:00
Panu Matilainen 95b177fcfb Revert spec tag-macro concatenation changes
- Concatenating to global, non-namespaced tag macros is fundamentally
  broken for specs with sub-packages, RhBug:555926 is not fixable with
  tag macros tweaks.
  Revert back to the old behavior where tag macros are simply "the last line
  seen wins." This might not be what one expects in many cases but it
  is at least consistent, and changing the behavior in any
  way (such as not adding the macros for multiline-items like requires)
  breaks existing packages without a good reason.
- Correctly handling the expected %{obsoletes} etc behavior in RhBug:555926
  would require a new mechanism, such as permitting spec to access the
  (sub-)package headers. Probably doable, unlikely to be worth the
  effort as the issue can be easily avoided by writing the spec differently.
- This reverts commits 3be37d9c78 and
  e811ef56aa
2010-02-01 13:39:42 +02:00
Jindrich Novy 3be37d9c78 Concatenate multiline tags in macros only in case of
Requires/Obsoletes/Conflicts and Provides. Preserve
older behaviour for other tags.
2010-01-20 10:28:40 +01:00
Jindrich Novy e811ef56aa Correctly expand %{obsoletes}, %{requires}, etc. in spec (RhBug:555926)
- tags declared multiple times in spec were simply overwritten so
  referencing it via %{} just showed contents of the last one
2010-01-16 12:43:16 +01:00
Panu Matilainen 8fe27d49e1 Move <ctype.h> include out of system.h to the places that need it 2010-01-05 15:33:47 +02:00
Panu Matilainen dd58384ede Move <errno.h> include out of system.h to the places that need it 2010-01-05 15:25:31 +02:00
Panu Matilainen 6109d6388e Remove libcap stuff out of system.h
- just a few places need, avoid polluting everything with it
- make fsm->fcaps void * to avoid having to deal with fcap_t not defined
2010-01-05 13:29:52 +02:00
Panu Matilainen 2c6120755c Unconditionally include <sys/wait.h> where needed
- no point conditionalizing what we cant live without
2010-01-05 12:35:54 +02:00
Panu Matilainen 5c084f842a Unconditionally include <netdb.h> where needed instead of system.h
- there's no fallback for missing netdb.h so there's little point
  conditionalizing it
- avoid yet more system.h pollution
2010-01-05 11:26:14 +02:00
Panu Matilainen 834551d246 Clean up poll() vs select() tests
- move the includes out of system.h, not commonly needed
- <poll.h> is conditional as we actually provide a fallback through select(),
  but for <sys/select.h> missing there's no fallback so doesn't make
  much sense to test for (and both poll.h and sys/select.h are posix anyway...)
2010-01-04 17:15:26 +02:00
Panu Matilainen 2753a5e934 Dont include <pwd.h> from system.h, dont bother checking for it either
- no much point conditionalizing something we can't live without
- just three places need, no point polluting include space everywhere
2009-12-23 13:40:10 +02:00
Panu Matilainen a39dc445fc Dont include grp.h from system.h, dont bother checking in configure either
- no much point conditionalizing something we can't live without
- just two places need, no point polluting include space everywhere
2009-12-23 13:15:59 +02:00
Panu Matilainen 4d328c0b69 Use %{__mkdir_p} macro in build instead of hardwired RPM_MKDIR_P 2009-12-22 15:32:17 +02:00
Panu Matilainen 507f21f6bb Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)
- For now, let %{} characters through our valid character set checks
  on specs. This isn't right really, but unexpanded, unrelated macros
  in spec can now cause failure to parse out buildrequires which would
  allow those macros to be expanded. This needs a better fix.
2009-12-17 08:43:31 +02:00
Panu Matilainen 50d1b52edb Avoid exposing libmagic dependency in public headers 2009-12-08 16:22:42 +02:00
Panu Matilainen 7a2395941e Bump soname for all our libraries
- while the "really public" API of librpmio has only been enhanced,
  librpm and librpmbuild use some supposedly internal bits which *have*
  changed considerably, so just to prevent anybody thinking they can
  combine librpmio from rpm 4.7 and librpm from this...
- librpmbuild hasn't seen much real change but some (unfortunately)
  exposed struct members have changed so...
- librpm is mostly compatible but as rpmal has become internal API,
  we need to bump (annoyingly, as nothing actually uses rpmal ... sigh)
2009-12-07 13:35:53 +02:00
Panu Matilainen 1adb46a9f8 Back out overly strict file type check on %ghost files
- we currently only support creating regular files for %ghosts which
  dont exist in the buildroot, but for files that do exist in the buildroot
  there's no reason to place such limits (eg its perfectly ok to have
  symlinks marked as %ghosts)
2009-12-02 13:35:53 +02:00
Panu Matilainen cfcd1f9bd9 Dont fail build on unrecognized non-executable files (ticket #105)
- Generally only executable files are critical for dependency extraction,
  whereas oddball application data files can cause unnecessary build
  failure due to libmagic misdetections etc, so just let non-executables
  pass with a warning and mark them as unknown data
2009-11-26 10:22:41 +02:00
Panu Matilainen 9fbaedd1ac Ensure rpmlib() dependency sanity on build
- only requires on rpmlib(foo) are allowed
- make sure any rpmlib() foo dependencies have RPMSENSE_RPMLIB bit set,
  rpmdeps as external dependency generator can create rpmlib() dependencies
  without the bit set, and also any manual rpmlib() deps wont have it
2009-10-21 12:23:50 +03:00