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

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

Detailed Description

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

Function Documentation

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):

1 // makedeltarpm foo.rpm goo.rpm fg.drpm
2 drpm_make("foo.rpm", "goo.rpm", "fg.drpm", NULL);
1 // makedeltarpm -r -z xz.6 -s seqfile.txt foo.rpm goo.rpm fg.drpm
2 
3 drpm_make_options *opts;
4 
5 drpm_make_options_init(&opts);
6 drpm_make_options_set_type(opts, DRPM_TYPE_RPMONLY);
7 drpm_make_options_set_seqfile(opts, "seqfile.txt");
8 drpm_make_options_set_delta_comp(opts, DRPM_COMP_XZ, 6);
9 
10 drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
11 
12 drpm_make_options_destroy(&opts);
1 // makedeltarpm -V 2 -z gzip,off -p foo-print.rpml foo-patch.rpml foo.rpm goo.rpm fg.drpm
2 
3 drpm_make_options *opts;
4 
5 drpm_make_options_init(&opts);
6 drpm_make_options_set_version(opts, 2);
7 drpm_make_options_set_delta_comp(opts, DRPM_COMP_GZIP, DRPM_COMP_LEVEL_DEFAULT);
8 drpm_make_options_forbid_addblk(opts);
9 drpm_make_options_add_patches(opts, "foo-print.rpml", "foo-patch.rpml");
10 
11 drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
12 
13 drpm_make_options_destroy(&opts);
1 // makedeltarpm -z uncompressed,bzip2.9 foo.rpm goo.rpm fg.drpm
2 
3 drpm_make_options *opts;
4 
5 drpm_make_options_init(&opts);
6 drpm_make_options_set_delta_comp(opts, DRPM_COMP_NONE, 0);
7 drpm_make_options_set_addblk_comp(opts, DRPM_COMP_BZIP2, 9);
8 
9 drpm_make("foo.rpm", "goo.rpm", "fg.drpm", &opts);
10 
11 drpm_make_options_destroy(&opts);
1 // makedeltarpm -u foo.rpm foo.drpm
2 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.