aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-28 14:06:35 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-28 14:06:35 +0000
commiteab47b151d2489eea8b0a633b5e9a1dbaa493a56 (patch)
treed89145cb2a5bddf7009e574f17619406a423da68 /URPM.xs
parent7860a9828ba608e67bff059f77d53370a400b569 (diff)
downloadperl-URPM-eab47b151d2489eea8b0a633b5e9a1dbaa493a56.tar
perl-URPM-eab47b151d2489eea8b0a633b5e9a1dbaa493a56.tar.gz
perl-URPM-eab47b151d2489eea8b0a633b5e9a1dbaa493a56.tar.bz2
perl-URPM-eab47b151d2489eea8b0a633b5e9a1dbaa493a56.tar.xz
perl-URPM-eab47b151d2489eea8b0a633b5e9a1dbaa493a56.zip
0.70-3mdk
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs33
1 files changed, 27 insertions, 6 deletions
diff --git a/URPM.xs b/URPM.xs
index 860c9d9..faeb4d2 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -607,7 +607,7 @@ parse_line(AV *depslist, HV *provides, URPM__Package pkg, char *buff) {
}
static int
-update_header(char *filename, URPM__Package pkg, HV *provides, int packing) {
+update_header(char *filename, URPM__Package pkg, HV *provides, int packing, int keep_all_tags) {
int d = open(filename, O_RDONLY);
if (d >= 0) {
@@ -642,7 +642,7 @@ update_header(char *filename, URPM__Package pkg, HV *provides, int packing) {
update_provides_files(pkg, provides);
}
if (packing) pack_header(pkg);
- else {
+ else if (!keep_all_tags) {
headerRemoveEntry(pkg->h, RPMTAG_POSTIN);
headerRemoveEntry(pkg->h, RPMTAG_POSTUN);
headerRemoveEntry(pkg->h, RPMTAG_PREIN);
@@ -1383,17 +1383,37 @@ Pkg_upgrade_files(pkg)
SP = xreturn_files(SP, pkg->h, FILTER_MODE_UPGRADE_FILES);
void
+Pkg_changelog_time(pkg)
+ URPM::Package pkg
+ PPCODE:
+ SP = xreturn_list_int_32(SP, pkg->h, RPMTAG_CHANGELOGTIME);
+
+void
+Pkg_changelog_name(pkg)
+ URPM::Package pkg
+ PPCODE:
+ SP = xreturn_list_str(SP, NULL, pkg->h, RPMTAG_CHANGELOGNAME, 0, 0);
+
+void
+Pkg_changelog_text(pkg)
+ URPM::Package pkg
+ PPCODE:
+ SP = xreturn_list_str(SP, NULL, pkg->h, RPMTAG_CHANGELOGTEXT, 0, 0);
+
+void
Pkg_pack_header(pkg)
URPM::Package pkg
CODE:
pack_header(pkg);
int
-Pkg_update_header(pkg, filename)
+Pkg_update_header(pkg, filename, packing=0, keep_all_tags=0)
URPM::Package pkg
char *filename
+ int packing
+ int keep_all_tags
CODE:
- RETVAL = update_header(filename, pkg, NULL, 0);
+ RETVAL = update_header(filename, pkg, NULL, packing, keep_all_tags);
OUTPUT:
RETVAL
@@ -2242,10 +2262,11 @@ Urpm_parse_hdlist(urpm, filename, packing=0)
} else croak("first argument should be a reference to HASH");
void
-Urpm_parse_rpm(urpm, filename, packing=0)
+Urpm_parse_rpm(urpm, filename, packing=0, keep_all_tags=0)
SV *urpm
char *filename
int packing
+ int keep_all_tags
PPCODE:
if (SvROK(urpm) && SvTYPE(SvRV(urpm)) == SVt_PVHV) {
SV **fdepslist = hv_fetch((HV*)SvRV(urpm), "depslist", 8, 0);
@@ -2258,7 +2279,7 @@ Urpm_parse_rpm(urpm, filename, packing=0)
memset(&pkg, 0, sizeof(struct s_Package));
pkg.flag = 1 + av_len(depslist);
- if (update_header(filename, &pkg, provides, packing)) {
+ if (update_header(filename, &pkg, provides, packing, keep_all_tags)) {
av_push(depslist, sv_setref_pv(newSVpv("", 0), "URPM::Package",
memcpy(malloc(sizeof(struct s_Package)), &pkg, sizeof(struct s_Package))));