Commit Graph

78 Commits

Author SHA1 Message Date
Thierry Vignaud c080226a60 add short summaries to headers that miss one 2016-01-28 14:42:47 +01:00
fin@linux.vnet.ibm.com b7e9a60370 Add rpmtags for file signatures and their length
This patch adds rpmtags for file signatures and their length, so they
can be stored in the package header.

Changelog:
- update rpmtag values (rebase error) - Mimi
- fix test case 0004 - Florian
- update rpmtag values again - Fin

[lkardos@redhat.com: tag numbers was changed in order not to conflict]
Signed-off-by: Lubos Kardos <lkardos@redhat.com>
2015-08-12 13:50:14 +02:00
Lubos Kardos d18fdd7f89 Add --filetriggers option to show info about file triggers. 2015-08-06 15:16:30 +02:00
Lubos Kardos aef80dc151 Parse file trigger priorities in spec files 2015-07-23 12:43:02 +02:00
Florian Festi 0bfa52dc74 Add Recommendname, Suggestname, Supplementname, Enhancename indexes to rpmdb 2015-06-01 09:33:00 +02:00
Florian Festi 415aa42566 Add support for the RemovePathPostfixes tag in the spec file
It may contain colon separated lists of path snippets that are removed from the end of the file name when adding the file to the package. This allows creating sub packages containing conflicting files. The path snippets are processed left to right.
2015-02-05 13:16:14 +01:00
Lubos Kardos 9e8f57bf7a Add parsing file triggers from spec file and saving them into header. 2015-02-05 08:08:12 +01: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 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
Florian Festi e308ddc917 Export RPMTAG_OLDSUGGESTS, OLDENHANCES and friends
This allows reading packages with SUSE's old style weak dependencies
2014-03-13 11:23:16 +01:00
Florian Festi 4360e7e131 Add RPMTAG_RECOMMENDNEVRS, RPMTAG_SUGGESTNEVRS, RPMTAG_SUPPLEMENTNEVRS and RPMTAG_ENHANCENEVRS extension tags 2014-02-19 12:11:27 +01:00
Florian Festi 2283152413 Add tags for a new implementation of weak requirements 2014-02-19 12:11:27 +01:00
Florian Festi d6ecdb33c5 Rename RPMTAG_SUGGESTS, RPMTAG_ENHANCES and friends to RPMTAG_OLD*
This allows keeping this tags in use by distributions already using them while we add new ones for the upstream implementation of weak dependencies
2014-02-19 12:11:27 +01:00
Panu Matilainen eb3e20b5f4 Fix RPMTAG_NOSOURCE and NOPATCH tag types, they are arrays (RhBug:991329) 2013-08-02 10:36:44 +03:00
Panu Matilainen f258e6089a Add tag extension to calculate hardlink count for files 2012-02-08 15:40:02 +02:00
Panu Matilainen 009c87cc7a Scriptlet argument tags are really arrays
- While the vast majority of scriptlet interpreters only consist
  of the interpreter name itself, they all can consist of arbitrary
  number of extra arguments. Rpm itself doesn't really care whether
  the tags are strings or string arrays but the scalar definition
  causes the rest of arguments to be invisible from eg python.
  Also having the type shown as string array hints at the proper
  query format when accessing these (and rpm itself is doing it
  wrong too in --scripts alias). Related to ticket #847.
2011-09-12 11:48:27 +03:00
Panu Matilainen 628ad2fae2 Add four new extension tags for pretty-formatting dependencies
- The current method that --requires and friends use is kinda
  cumbersome and outputs extra whitespace for dependencies which
  dont have flags+version attached. Adding extensions for this
  is likely to be easier than teaching query formatting to
  permit conditionalizing on current value instead of just tag existence.
2011-09-06 15:58:35 +03:00
Panu Matilainen 3a309d8f1b Add RPMTAG_INSTFILENAMES tag extension for state-aware file lists
- For a more consistent experience wrt all the state-awareness stuff,
  this needs to be easily querifiable too.
- Also makes the tagnames kludgery from commit
  cac8c38960 unnecessary
2011-09-01 12:11:13 +03:00
Panu Matilainen 0e01c697dc Add a new pseudo index for actually installed files
- RPMDBI_BASENAMES (ugh) returns all headers with matching filenames,
  whether the files are actually installed or not, which can be
  rather misleading when dealing with file dependencies. The new
  RPMDBI_INSTFILENAMES only returns headers with matching filenames
  whose state indicates they are actually present on the system.
2011-08-29 15:52:16 +03:00
Panu Matilainen 115717d96f Tag reservation for MeeGo's security framework (from Tero Aho)
- As per http://lists.rpm.org/pipermail/rpm-maint/2011-January/002988.html,
  reserving the MSSF tags (but marked unimplemented for now)
2011-03-01 12:10:23 +02:00
Panu Matilainen 5c43095e1d Implement transaction ordering hinting
- Add support for new "OrderWithRequires: foo" spec syntax
  which has "if and only if foo is present in transaction, order
  the transaction as if this package required foo" semantics.
  While it looks, and in some ways is, a soft dependency, this
  is not the same as recommends/suggests etc: those have unknown
  depsolver policy dependent semantics attached to them, whereas
  ordering hints have a clear definition and is only relevant for rpm
  itself, depsolvers should not even look at the data.
- This allows packages to express correct ordering for optional
  functionality, such as

      %post
      if [ -x %{_bindir}/register-component ]; then
          %{_bindir}/register-component %{name}
      fi

  If the package containing %{_bindir}/register-component is included
  in the same transaction, it makes sense to have it installed before the
  package(s) that use it. But as it is fully optional, Requires would
  not be appropriate. Using OrderWithRequires allows this to be expressed
  without dragging in extraneous dependencies for optional functionality.
2010-12-13 12:26:06 +02:00
Panu Matilainen dc2ee980bc Remove RPMTAG_FILESTATUS tag extension
- This is a bad "API" for verification, it can't be controlled and
  causes heavy IO where one would not expect it. Getting rid of it now
  before anybody starts relying on it...
- Leaving :fstatus format extension alone however, it's at least harmless
  and produces a more predictable output than :vflags extension so it
  might be actually useful in scripts.
2010-11-15 11:12:50 +02:00
Panu Matilainen 61a7640100 Document our supported rpmdb indexes in the API via an enum of their own
- Now that our indexes are actually hardwired in the code we can
  properly separate rpmtag vs db index names.
- Defined similarly to rpmTags, with rpmDbiTag being the "true enum"
  and rpmDbiTagVal the integral type they present. As many of the
  indexes are defined via RPMTAG values (and need to remain that
  way to avoid breaking every single API user) we need to have a
  compatible type with rpmTags.
- These would logically belong to rpmdb.h but keeping in rpmtag.h
  to have them available "everywhere", we can't go including rpmdb.h
  from rpmtag.h so keeping them here avoids potential unnecessary breakage.
2010-10-22 10:17:55 +03:00
Panu Matilainen 935d0654a6 rpmTagFoo() getters take arbitrary integers, not rpmTag enums
- Another step to clean up the enum braindamage...
- rpmTag values are the only values that will be found, but it doesn't
  mean the values passed are rpmTag enum members - eg anything from
  a header is not. rpmTagGetValue() does come close to returning true
  enums, but there's RPMDBI_PACKAGES and then RPMTAG_NOT_FOUND, neither
  of which are actually tags.
- Introducing a new rpmTagVal typedef. It's just an alias for the
  "lowlevel" rpm_tag_t type but visually more in line with the other
  rpmTagFoo bits - to be used with the "higher level" tags whereas
  rpm_tag_t is the "physical" type. Not that it makes any difference...
2010-10-22 09:40:43 +03:00
Colin Walters 22053e0dae Add 'VCS' key
Spec files have a lot of metadata about a project.  However one of the
most key components is the upstream version control system which was
notably lacking.

Resolve this by adding a "VCS" key.  There is no specification
for contents of this key, given that the set of version control
systems (and features thereof) are not well-defined.  However,
recommendations are:

 * git: This URL should be in a form that can be passed to "git clone",
   with the additional feature that an optional fragment identifier "#foo"
   denotes a branch or tag.
2010-10-12 16:10:07 +03:00
Panu Matilainen cb13c43986 Move RPMTAG_NOT_FOUND into rpmTag enumeration
- Permits presenting "invalid tag" cleanly via the rpmTag enum type
  on function returns etc
2010-09-21 13:11:08 +03:00
Panu Matilainen bf4a383892 Add yet more rpmTagTagTagFoo() functions
- Two stupid new getters: one for the real tag type, and another
  for the return type. rpmTagGetType() returns both requiring bitmasking
  all over the place
2010-09-21 12:30:05 +03:00
Panu Matilainen 2fb15a5443 Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield
  itself is not an enumeration. Add a separate typedef on "rpmFlags"
  type (presenting a bitfield of flags) for all of these. Compilers
  hardly care, but the typedefs give a nice visual clue for
  us humans using these flags far away from ho^H^H definitions.
2010-09-21 11:10:14 +03:00
Steve Lawrence 383e275648 Add new %sepolicy section to the spec file format
The %sepolicy section is used to describe SELinux policy to be included
in a package. It's syntax is similar to other sections (%files, %pre,
%post, etc.) in that you can provide a string and -n after the
declaration to specify policy should be added to a subpackage.

For example:

%sepolicy
 # policy in this section will be added to the main package

%sepolicy foo
 # policy in this section will be added to the '<mainpackage>-foo' subpackage

%sepolicy -n bar
 # policy in this section will be added to the 'bar' subpackage

The %sepolicy section contains zero or more %semodule directives, with the
following format:

%semodule [OPTIONS] path/to/module.pp

The available options are:

-b, --base
	The module is a base module

-n, --name=NAME
	The name of the module. If not given, assumes the name is the basename of
	the module file with file extensions removed.

-t, --types=TYPES
	One or more comma-separated strings specifying which policy types the
	module can work with. To explicitly state that a module can work with any
	policy type, "default" can be specified as the value. If not specified,
	assumes the module can work with any policy type, and assigns the types as
	"default".

Below is an example of this new format:

  %sepolicy
  %semodule -n foo -t mls policy/foo.pp
  %semodule -n bar -t strict,targeted,mls -b policy/bar.pp

This also adds new header tags to store the new information:
 RPMTAG_POLICYNAMES        (string array)
 RPMTAG_POLICYTYPES        (string array)
 RPMTAG_POLICYTYPESINDEXES (uint32 array)
 RPMTAG_POLICYFLAGS        (uint32 array)

The index of NAMES and FLAGS maps directly to the index of RPMTAG_POLICIES.
However, because a single policy can have multiple types, the mapping for
TYPES is not direct. For this, the index maps to TYPESINDEXES, which
contains the index of the policy that the type maps to. This is similar to
how DIRINDEXES is used to map DIRNAMES and BASENAMES. As an example, the
previous %sepolicy section would have the following header tags:

RPMTAG_POLICIES:
 0: <foo.pp data, base64 encoded>
 1: <bar.pp data, base64 encoded>

RPMTAG_POLICYNAMES:
 0: foo
 1: bar

RPMTAG_POLICYFLAGS:
 0: 0
 1: 1	# assumes flag 1 == BASE

RPMTAG_POILCYTYPES:        RPMTAG_POLICYTYPESINDEXES:
 0: mls                     0: 0
 1: strict                  1: 1
 2: targeted                2: 1
 3: mls                     3: 1
2010-09-01 09:04:27 +03:00
Panu Matilainen 122cf542d1 Move collections tag to "known free" number, document reserved tags
- missed during review, oh well..
2010-06-24 14:38:20 +03:00
Steve Lawrence 0158708305 Add new Collections preamble tag
This adds a new Collections preamble tag, which contains a space separated list
of collection names that the package belongs to.
2010-06-22 11:12:43 +03:00
Panu Matilainen 00f1a6e0b1 Add header extension tag RPMTAG_FILESTATUS for file verification
- Permits basic file verification with just a headerGet(), with some
  caveats: there's no way to control which attributes get verified,
  and there's no filtering of mtime differences of shared files. Those
  aside, rpm -q --qf "[%{filestates:vflags} %{filenames}\n] <args>" now
  performs the same as "rpm -V --nodeps --noscripts <args>"
2010-05-28 12:21:34 +03:00
Panu Matilainen dcaec34d3f Update a few tag descriptions + visibility
- RPMTAG_CAPABILITY and RPMTAG_RHNPLATFORM are truly obsolete and
  should've been taken out a long time ago
2010-04-13 08:50:08 +03:00
Panu Matilainen 538ddff69c RPMTAG_NOSOURCE and NOPATCH aren't internal, they end up in nosrc headers 2010-04-13 08:32:49 +03:00
Panu Matilainen f46785b274 Lose leftover RPMDBI_ARGLIST rpmgi pseudo tag
- should've really been in commit a215637964
2010-03-22 15:48:54 +02:00
Panu Matilainen 89b3b38612 Lose unused temporary/pseudo rpmdbi tags
- we haven't had any temporary dbis since rpm 4.8.0 where Depends
  got axed, the rest were just nonexistent fluff anyway
2010-03-19 16:55:27 +02:00
Panu Matilainen 367c0d7014 Eliminate hysterical --hdlist query option and everything implementing it
- This hidden gem used "system hdlist", ie "/usr/share/comps/%{_arch}/hdlist
  as the source for queries. Such "system hdlist" hasn't existed anywhere
  since RHL 9/FC 1 times...
2010-03-19 16:54:00 +02:00
Panu Matilainen d87d831cdf Eliminate --wtfwalk .. err, --ftswalk and everything implementing it
- that's what find + xargs are for, this is just useless cruft
2010-03-19 16:52:19 +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
Florian Festi 51c96db046 Kill RPMTAG_FSNAMES and RPMTAG_FSSIZES and everything implementing them 2010-02-03 16:27:00 +01:00
Panu Matilainen d0eaa7c048 Add RPMTAG_EPOCHNUM tag extension
- return RPMTAG_EPOCH but convert non-existent epoch to 0, as rpm internals
  treat it
2009-11-20 10:32:47 +02:00
Panu Matilainen df61816c75 Add RPMTAG_VERBOSE extension
- hack to permit different query formatting based on rpm's verbosity level
2009-10-12 11:02:56 +03:00
Panu Matilainen 3661e1d525 Add header color tag extension, ie headerGetColor()
- use common numeric tag generation helper for header color
  and dbinstance tags
2009-09-02 13:57:54 +03:00
Panu Matilainen a5a9208b69 Add tag extensions for common name-[epoch:]version-release[.arch] combos
- RPMTAG_NVRA same as rpm5.org, others are new tags
2009-09-02 10:49:00 +03:00
Panu Matilainen 0fd95da2e7 Add dbinstance tag extension (port from rpm5.org) 2009-09-01 15:08:58 +03:00
Panu Matilainen a070010b7c Triggerprein has been implemented since January 2008, update comment 2009-09-01 11:38:06 +03:00
Panu Matilainen 86032bfbb6 Add an option bug reporting URL tag to packages (RhBug:512774) 2009-08-13 15:45:56 +03:00
Panu Matilainen b187977fee Doxygen parameter name mismatch 2009-03-18 11:57:16 +02:00
Jindrich Novy 7acdfded4a Add md5->filedigest aliases (rhbz#487597)
- add %verify(nofiledigest) as %verify(nomd5) file attribute alias
- reference digests as digests not checksums
- make old md5 related symbols obsolete and use newer reference
- update man page accordingly
2009-02-27 14:34:39 +01:00