Commit Graph

29 Commits

Author SHA1 Message Date
Panu Matilainen c68fa9ab0b Rip rpm 4.4.x API compatibility
It's been deprecated and hidden behind compat defines for eight
years now, more than enough time for folks to port their stuff
to new APIs. If they ain't done by now ... well its time now.
2016-10-24 12:38:21 +03:00
Florian Festi 51e8b94e95 Move RPMERR_* inst new rpmarchive.h 2014-01-31 09:49:43 +02:00
Panu Matilainen 05eeece43a Move file related defines and typedefs to a new public rpmfiles.h header
- Preparation for making the indexed rpmfiles API public, API users
  are not affected as rpmfiles.h is included from rpmfi.h now. rpmfi.h
  is for the iterator part only.
2013-12-11 16:00:34 +02:00
Panu Matilainen 9e47043b2d First cut of a libsolv-style string <-> id pool API
- The pool stores "arbitrary" number of strings in a space-efficient
  manner, with near constant (hashed) string -> id lookup/store and
  constant time id -> string and id -> string length lookups.
- Credits for the idea go to the Suse developers working on libsolv,
  the basic concept is directly lifted from there but details
  differ due to using rpm's own hash table implementation etc.
  Another minor difference is using size_t for offsets to permit over
  4GB total data size on 64bit systems, the total number of id's in
  the pool is limited to uint32 max however (like in libsolv).
- Any (re)implementation bugs by yours truly, this is almost certainly
  going to need further tuning and tweaking, API and otherwise.
2012-09-07 13:34:27 +03:00
Panu Matilainen 70f063cb77 Make base64 encoding/decoding part of rpmio public API
- Base64 is present in headers and all, it's only reasonable that
  our API users have access to this functionality without having
  to link to other libraries. Even if we didn't want to carry the
  implementation forever in our codebase, we should provide a wrapping
  for this (much like the other crypto stuff) for the reason stated above.
- A bigger issue is that our dirty little (badly hidden) secret was using
  non-namespaced function names, clashing with at least beecrypt. And we
  couldn't have made these internal-only symbols even on platforms that
  support it, because they are used all over the place outside rpmio.
  So... rename the b64 functions to rpmLikeNamingStyle and make 'em public.
  No functional changes, just trivial renaming despite touching numerous
  places.
2011-11-09 15:16:28 +02:00
Panu Matilainen d10b403011 Make rpmplugins.h private for now
- We'll probably want to make some changes to the plugin type system
  before considered "ready", the current plugin slots are limited
  to 32 and Meego folks apparently want to use a largish number
  of slots. So we might want something like separate plugin type
  (collection, security... etc) and then have 32 slots per each type.
  Making this private for now to avoid having to potentially break
  the API shortly after introduction.
2010-12-22 13:11:40 +02:00
Panu Matilainen 9f2c1bd909 Move librpmsign to its own subdirectory in the sources 2010-10-22 15:00:49 +03:00
Panu Matilainen 6d04be21eb And finally split the signing support into a separate library
- For a library with just one public function this might seem like
  a huge overkill but it permits cleanly separating dependencies:
  nothing but package signing requires GnuPG. This lets the signing
  support be stuffed into a separate package, avoiding having to
  drag gpg in on every installation (signing isn't something everybody
  does) and without having potentially broken interfaces in the API,
  essentially solving RhBug:624585.

  It also liberates signing to use libraries that might be off-limits
  for the core rpm, such as perhaps in the future doing signing
  by ourselves with the help of something like gpgme (which requires
  far too many things to drag into core rpm).
2010-09-29 12:12:58 +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
Steve Lawrence 883f13c8b7 Update the plugin architecture to allow for remembering state
This moves most of the plugin logic to a new rpmplugins file with a
struct and functions for managing plugins, allowing for plugins to carry
state. This also adds init and cleanup hooks for plugins to initialize
and cleanup their state, and a new 'open te' hook allowing plugins to
read and save information from transaction elements.

This also generalizes the plugin architecture a bit so it isn't so
specific to collections.
2010-09-01 09:04:05 +03:00
Panu Matilainen 37ed237fbe Split rpm problem type + its "methods" to separate source + header
- rpmps is just something that stores rpm problems, problems themselves
  are individual and opaque "objects", deserving their own module
2010-03-25 16:46:39 +02:00
Panu Matilainen 7628c31bb9 Fix fallout from rpmgi.h moving to internal path 2010-03-23 16:32:46 +02:00
Panu Matilainen 26ac9b3d94 Make rpmal header & all internal
- rpmal is hardly useful outside rpm itself, avoid exporting stuff
  unnecessarily
2009-04-03 13:07:42 +03:00
Panu Matilainen 27a6edd36d Add a new legacy compatibility header, kill rpmints.h
- build-time generated rpmints.h causes issues with distcheck and is
  not really worth the trouble
- we have all sorts of legacy junk to deal with, sticking them all into
  rpmints.h would be just wrong...
2008-07-08 18:54:28 +03:00
Panu Matilainen 710750ebff Make rpmkeyring.h public header 2008-07-02 14:23:30 +03:00
Panu Matilainen a83cfce188 New "tag data" container struct + some basic methods to deal with it
- to be used for passing around header and extension data
- inspired by similar changes in rpm5.org, details and implementation differ
2008-05-13 11:02:45 +03:00
Panu Matilainen 90e10708f8 Fixup paths and Makefiles for rpmdb/ elimination 2008-05-12 12:28:12 +03:00
Panu Matilainen 37543ee040 Remove rollback support
- not possible to do reliably within rpm
- effort is better wasted on investigating fs-level snapshots, which
  is way beyond rpm scope except for hooks to interact with the snapshot
  mechanism to communicate beginning/end of transaction and such
2008-03-17 11:53:27 +02:00
Panu Matilainen c46876daa4 Add new header for collecting utility macros
- atm consists of portability wrappers to various gcc extensions like
  __attribute__() to provide additional warnings and checks
- copied from glib to avoid an extra build dependency just for the silly
  macros, renamed to avoid namespace clashing
2008-02-25 11:02:07 +02:00
Panu Matilainen 50e2d4c26f Split non-cli verify bits from rpmcli to separate header 2008-02-05 13:49:13 +02:00
Panu Matilainen 0760e7389f Add stub rpmtypes.h header stub
- place to stick in common typedefs to untangle header cross-include jungle
2008-01-30 10:13:09 +02:00
Panu Matilainen a96f817d50 Split RPMTAG_* and related functions out of rpmlib.h to rpmtag.h 2007-12-03 10:47:25 +02:00
Panu Matilainen fc53d307ad Add separate public header for callback declarations
- rpmmessages is empty, lose it
- adjust includes
2007-12-01 10:08:13 +02:00
Ralf Corsépius f33505085a Regenerate. 2007-11-26 15:18:02 +01:00
Panu Matilainen eb72616113 Regenerate preinstall.am 2007-11-23 09:06:45 +02:00
Panu Matilainen d6990c3ab1 Move stringbuf into librpmio, rename header
- rename header to more generic rpmstring.h for collecting misc string
  helper functions
2007-11-23 08:11:42 +02:00
Ralf Corsépius 7fb2899b84 Fix typo in preinstall.am generation. 2007-11-23 06:28:09 +01:00
Ralf Corsépius 32f29c4cbf Regenerate. 2007-11-22 17:22:22 +01:00
Ralf Corsépius 5831404601 Add header preinstallation. 2007-11-22 15:54:42 +01:00