aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--URPM.xs33
-rw-r--r--URPM/Resolve.pm2
-rw-r--r--perl-URPM.spec7
3 files changed, 34 insertions, 8 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))));
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 25a3617..fe18957 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -263,7 +263,7 @@ sub resolve_requested {
my ($p) = @_;
if ($pkg->compare_pkg($p) < 0) {
$allow or update_state_provides($state, $pkg);
- $allow = 1;
+ $allow = ++$state->{oldpackage};
$options{keep_state} or
$urpm->resolve_closure_ask_remove($db, $state, $p,
{ old_requested => 1, id => $pkg->id });
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 7a4b896..80d0409 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.70
-%define release 2mdk
+%define release 3mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -48,6 +48,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Wed Aug 28 2002 François Pons <fpons@mandrakesoft.com> 0.70-3mdk
+- setup state to know if an old package will be upgraded.
+- added optional parameter to keep all tags from an rpm.
+- added URPM::Package::changelog_* method.
+
* Mon Aug 26 2002 François Pons <fpons@mandrakesoft.com> 0.70-2mdk
- added more flags to URPM::Transaction::run (oldpackage, test).
- fixed choices to prefer right locales dependent packages.