drpm
A library for making, reading and applying deltarpm packages
Modules | Functions
DRPM Make

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

Modules

 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. The DeltaRPM can later be used to recreate the new RPM from either filesystem data or the old RPM. More...
 

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);
// 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);
// 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);
// makedeltarpm -z uncompressed,bzip2.9 foo.rpm goo.rpm fg.drpm
drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
// 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.
drpm_make_options_forbid_addblk
DRPM_VISIBLE int drpm_make_options_forbid_addblk(drpm_make_options *opts)
Forbids add block creation.
drpm_make_options_destroy
DRPM_VISIBLE int drpm_make_options_destroy(drpm_make_options **opts)
Frees drpm_make_options.
DRPM_COMP_NONE
#define DRPM_COMP_NONE
no compression
Definition: drpm.h:98
DRPM_TYPE_RPMONLY
#define DRPM_TYPE_RPMONLY
rpm-only deltarpm
Definition: drpm.h:91
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_set_version
DRPM_VISIBLE int drpm_make_options_set_version(drpm_make_options *opts, unsigned short version)
Sets DeltaRPM version.
DRPM_COMP_GZIP
#define DRPM_COMP_GZIP
gzip
Definition: drpm.h:99
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 ...
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.
DRPM_COMP_BZIP2
#define DRPM_COMP_BZIP2
bzip2
Definition: drpm.h:100
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
struct drpm_make_options drpm_make_options
Options for drpm_make()
Definition: drpm.h:170
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.
DRPM_COMP_LEVEL_DEFAULT
#define DRPM_COMP_LEVEL_DEFAULT
default compression level for given compression type
Definition: drpm.h:148
drpm_make_options_init
DRPM_VISIBLE int drpm_make_options_init(drpm_make_options **opts)
Initializes drpm_make_options with default options.
DRPM_COMP_XZ
#define DRPM_COMP_XZ
xz
Definition: drpm.h:102