drpm: DRPM Make

drpm A library for making, reading and applying deltarpm packages

Loading...
Searching...
No Matches
Topics | Functions
DRPM Make

Tools for creating a DeltaRPM file from two RPM files, providing the same functionality as makedeltarpm(8). More...

## Topics
| DRPM Make Options
| Tools for customizing DeltaRPM creation.

## Functions
DRPM_VISIBLE int | drpm_make (const char *oldrpm, const char *newrpm, const char *deltarpm, const drpm_make_options *opts)
| Creates a DeltaRPM from two RPMs.

## Detailed Description

Tools for creating a DeltaRPM file from two RPM files, providing the same functionality as makedeltarpm(8).

## Function Documentation

## ◆ drpm_make()

DRPM_VISIBLE int drpm_make | ( | const char * | oldrpm,
|  | const char * | newrpm,
|  | const char * | deltarpm,
|  | const drpm_make_options * | opts )

Creates a DeltaRPM from two RPMs.

The DeltaRPM can later be used to recreate the new RPM from either filesystem data or the old RPM.

Does the same thing as the makedeltarpm(8) command-line utility.

Examples of function calls (without error handling):

// makedeltarpm foo.rpm goo.rpm fg.drpm
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", NULL);
drpm_make
DRPM_VISIBLE int drpm_make(const char *oldrpm, const char *newrpm, const char *deltarpm, const drpm_make_options *opts)
Creates a DeltaRPM from two RPMs.
// makedeltarpm -r -z xz.6 -s seqfile.txt foo.rpm goo.rpm fg.drpm
drpm_make_options *opts;
drpm_make_options_init(&opts);
drpm_make_options_set_type(opts, DRPM_TYPE_RPMONLY);
drpm_make_options_set_seqfile(opts, "seqfile.txt");
drpm_make_options_set_delta_comp(opts, DRPM_COMP_XZ, 6);
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
drpm_make_options_destroy(&opts);
DRPM_TYPE_RPMONLY
#define DRPM_TYPE_RPMONLY
rpm-only deltarpm
Definition drpm.h:91
DRPM_COMP_XZ
#define DRPM_COMP_XZ
xz
Definition drpm.h:102
drpm_make_options
struct drpm_make_options drpm_make_options
Options for drpm_make()
Definition drpm.h:170
drpm_make_options_set_delta_comp
DRPM_VISIBLE int drpm_make_options_set_delta_comp(drpm_make_options *opts, unsigned short comp, unsigned short level)
Sets DeltaRPM compression type and level.
drpm_make_options_set_seqfile
DRPM_VISIBLE int drpm_make_options_set_seqfile(drpm_make_options *opts, const char *seqfile)
Specifies file to which to write DeltaRPM sequence ID.
drpm_make_options_init
DRPM_VISIBLE int drpm_make_options_init(drpm_make_options **opts)
Initializes drpm_make_options with default options.
drpm_make_options_set_type
DRPM_VISIBLE int drpm_make_options_set_type(drpm_make_options *opts, unsigned short type)
Sets DeltaRPM type.
drpm_make_options_destroy
DRPM_VISIBLE int drpm_make_options_destroy(drpm_make_options **opts)
Frees drpm_make_options.
// makedeltarpm -V 2 -z gzip,off -p foo-print.rpml foo-patch.rpml foo.rpm goo.rpm fg.drpm
drpm_make_options *opts;
drpm_make_options_init(&opts);
drpm_make_options_set_version(opts, 2);
drpm_make_options_set_delta_comp(opts, DRPM_COMP_GZIP, DRPM_COMP_LEVEL_DEFAULT);
drpm_make_options_forbid_addblk(opts);
drpm_make_options_add_patches(opts, "foo-print.rpml", "foo-patch.rpml");
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
drpm_make_options_destroy(&opts);
DRPM_COMP_LEVEL_DEFAULT
#define DRPM_COMP_LEVEL_DEFAULT
default compression level for given compression type
Definition drpm.h:148
DRPM_COMP_GZIP
#define DRPM_COMP_GZIP
gzip
Definition drpm.h:99
drpm_make_options_set_version
DRPM_VISIBLE int drpm_make_options_set_version(drpm_make_options *opts, unsigned short version)
Sets DeltaRPM version.
drpm_make_options_forbid_addblk
DRPM_VISIBLE int drpm_make_options_forbid_addblk(drpm_make_options *opts)
Forbids add block creation.
drpm_make_options_add_patches
DRPM_VISIBLE int drpm_make_options_add_patches(drpm_make_options *opts, const char *oldrpmprint, const char *oldpatchrpm)
Requests incorporation of RPM patch files for the old RPM.
// makedeltarpm -z uncompressed,bzip2.9 foo.rpm goo.rpm fg.drpm
drpm_make_options *opts;
drpm_make_options_init(&opts);
drpm_make_options_set_delta_comp(opts, DRPM_COMP_NONE, 0);
drpm_make_options_set_addblk_comp(opts, DRPM_COMP_BZIP2, 9);
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
drpm_make_options_destroy(&opts);
DRPM_COMP_BZIP2
#define DRPM_COMP_BZIP2
bzip2
Definition drpm.h:100
DRPM_COMP_NONE
#define DRPM_COMP_NONE
no compression
Definition drpm.h:98
drpm_make_options_set_addblk_comp
DRPM_VISIBLE int drpm_make_options_set_addblk_comp(drpm_make_options *opts, unsigned short comp, unsigned short level)
Sets add block compression type and level.
// makedeltarpm -u foo.rpm foo.drpm
drpm_make("foo.rpm", NULL, "foo.drpm", NULL);

Parameters

  [in] | oldrpm | Name of old RPM file.
  [in] | newrpm | Name of new RPM file.
  [in] | deltarpm | Name of DeltaRPM file to be created.
  [in] | opts | Options (if `NULL`, defaults used).

Returns
  Error code.

Note
  If either `old_rpm` or `new_rpm` is `NULL`, an "identity" deltarpm is created (may be useful to just replace the signature of an RPM or to reconstruct an RPM from the filesystem).

Warning
  If not `NULL`, `opts` should have been initialized with drpm_make_options_init(), otherwise behaviour is undefined.