aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs29
-rw-r--r--perl-URPM.spec6
2 files changed, 31 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index a8bdbe2..fc0544a 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -45,7 +45,7 @@ typedef struct s_Package* URPM__Package;
#define FLAG_REQUESTED 0x08000000U
#define FLAG_REQUIRED 0x10000000U
#define FLAG_UPGRADE 0x20000000U
-#define FLAG_RESERVED 0x40000000U
+#define FLAG_OBSOLETE 0x40000000U
#define FLAG_NO_HEADER_FREE 0x80000000U
#define FLAG_ID_MAX 0x00fffffe
@@ -833,10 +833,12 @@ Pkg_compare_pkg(lpkg, rpkg)
compare = rpmvercmp(lrelease, rrelease);
if (!compare) {
int lscore, rscore;
+ char *eolarch = strchr(larch, '@');
+ char *eorarch = strchr(rarch, '@');
read_config_files();
- lscore = rpmMachineScore(RPM_MACHTABLE_INSTARCH, larch);
- rscore = rpmMachineScore(RPM_MACHTABLE_INSTARCH, rarch);
+ if (eolarch) *eolarch = 0; lscore = rpmMachineScore(RPM_MACHTABLE_INSTARCH, larch);
+ if (eorarch) *eorarch = 0; rscore = rpmMachineScore(RPM_MACHTABLE_INSTARCH, rarch);
if (lscore == 0) {
if (rscore == 0)
compare = strcmp(larch, rarch);
@@ -848,6 +850,8 @@ Pkg_compare_pkg(lpkg, rpkg)
else
compare = rscore - lscore; /* score are lower for better */
}
+ if (eolarch) *eolarch = '@';
+ if (eorarch) *eorarch = '@';
}
}
}
@@ -1300,6 +1304,25 @@ Pkg_set_flag_upgrade(pkg, value=1)
OUTPUT:
RETVAL
+int
+Pkg_flag_obsolete(pkg)
+ URPM::Package pkg
+ CODE:
+ RETVAL = pkg->flag & FLAG_OBSOLETE;
+ OUTPUT:
+ RETVAL
+
+int
+Pkg_set_flag_obsolete(pkg, value=1)
+ URPM::Package pkg
+ int value
+ CODE:
+ RETVAL = pkg->flag & FLAG_OBSOLETE;
+ if (value) pkg->flag |= FLAG_OBSOLETE;
+ else pkg->flag &= ~FLAG_OBSOLETE;
+ OUTPUT:
+ RETVAL
+
MODULE = URPM PACKAGE = URPM::DB PREFIX = Db_
diff --git a/perl-URPM.spec b/perl-URPM.spec
index d016862..e34be73 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.04
-%define release 2mdk
+%define release 3mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -48,6 +48,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Jun 13 2002 François Pons <fpons@mandrakesoft.com> 0.04-3mdk
+- fixed compare_pkg (invalid arch comparisons sometimes).
+- added (still unused) obsolete flag.
+
* Thu Jun 13 2002 François Pons <fpons@mandrakesoft.com> 0.04-2mdk
- added ranges_overlap method (uses rpmRangesOverlap in rpmlib).
- made Resolve module to be operational (and usable).