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_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_set_seqfile(opts, "seqfile.txt");
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
#define DRPM_TYPE_RPMONLY
rpm-only deltarpm
Definition drpm.h:91
#define DRPM_COMP_XZ
xz
Definition drpm.h:102
struct drpm_make_options drpm_make_options
Options for drpm_make()
Definition drpm.h:170
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_VISIBLE int drpm_make_options_set_seqfile(drpm_make_options *opts, const char *seqfile)
Specifies file to which to write DeltaRPM sequence ID.
DRPM_VISIBLE int drpm_make_options_init(drpm_make_options **opts)
Initializes drpm_make_options with default options.
DRPM_VISIBLE int drpm_make_options_set_type(drpm_make_options *opts, unsigned short type)
Sets DeltaRPM type.
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_add_patches(opts, "foo-print.rpml", "foo-patch.rpml");
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
#define DRPM_COMP_LEVEL_DEFAULT
default compression level for given compression type
Definition drpm.h:148
#define DRPM_COMP_GZIP
gzip
Definition drpm.h:99
DRPM_VISIBLE int drpm_make_options_set_version(drpm_make_options *opts, unsigned short version)
Sets DeltaRPM version.
DRPM_VISIBLE int drpm_make_options_forbid_addblk(drpm_make_options *opts)
Forbids add block creation.
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("foo.rpm", "goo.rpm", "fg.drpm", &opts);
#define DRPM_COMP_BZIP2
bzip2
Definition drpm.h:100
#define DRPM_COMP_NONE
no compression
Definition drpm.h:98
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]oldrpmName of old RPM file.
[in]newrpmName of new RPM file.
[in]deltarpmName of DeltaRPM file to be created.
[in]optsOptions (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.