aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-17 20:38:45 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-17 20:38:45 +0000
commit3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb (patch)
treee0f24f5eb963455a48b829097b3f6dd197f0f9d4
parent26eabb446703c00f9385011e0f4c269842016383 (diff)
downloadperl-URPM-3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb.tar
perl-URPM-3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb.tar.gz
perl-URPM-3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb.tar.bz2
perl-URPM-3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb.tar.xz
perl-URPM-3bc2a9a3a9c5e2bcbaadf7b8f59495887a5af5eb.zip
drop support for old mdv2008.0 suggests (RPMTAG_REQUIRENAME +
RPMSENSE_MISSINGOK) drop suport for old suggests: RPMTAG_REQUIRENAME + RPMSENSE_MISSINGOK (as done in Mandriva 2008.0) since mdv 2008.1, we use SuSE style suggets (RPMTAG_SUGGESTSNAME) we don't support them since that (and we dropped them from testsuite in december 2008)
-rw-r--r--NEWS1
-rw-r--r--URPM.xs38
2 files changed, 4 insertions, 35 deletions
diff --git a/NEWS b/NEWS
index 7a5fdae..420d477 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- drop support for old mdv2008.0 suggests (RPMTAG_REQUIRENAME + RPMSENSE_MISSINGOK)
- internal cleanups
Version 4.4 - 15 June 2012
diff --git a/URPM.xs b/URPM.xs
index 4a06fb3..f098bf0 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -302,16 +302,6 @@ ranges_overlap(rpmsenseFlags aflags, char *sa, rpmsenseFlags bflags, char *sb) {
}
}
-static rpmsenseFlags has_old_suggests;
-rpmsenseFlags is_old_suggests(rpmsenseFlags flags) {
- rpmsenseFlags is = flags & RPMSENSE_MISSINGOK;
- if (is) has_old_suggests = is;
- return is;
-}
-rpmsenseFlags is_not_old_suggests(rpmsenseFlags flags) {
- return !is_old_suggests(flags);
-}
-
typedef int (*callback_list_str)(char *s, int slen, const char *name, const rpmsenseFlags flags, const char *evr, void *param);
static int
@@ -334,22 +324,7 @@ callback_list_str_xpush_requires(char *s, int slen, const char *name, const rpms
dSP;
if (s)
mXPUSHs(newSVpv(s, slen));
- else if (is_not_old_suggests(flags)) {
- char buff[4096];
- int len = print_list_entry(buff, sizeof(buff)-1, name, flags, evr);
- if (len >= 0)
- mXPUSHs(newSVpv(buff, len));
- }
- PUTBACK;
- /* returning zero indicates to continue processing */
- return 0;
-}
-static int
-callback_list_str_xpush_old_suggests(char *s, int slen, const char *name, rpmsenseFlags flags, const char *evr, __attribute__((unused)) void *param) {
- dSP;
- if (s)
- mXPUSHs(newSVpv(s, slen));
- else if (is_old_suggests(flags)) {
+ else {
char buff[4096];
int len = print_list_entry(buff, sizeof(buff)-1, name, flags, evr);
if (len >= 0)
@@ -831,11 +806,7 @@ pack_header(const URPM__Package pkg) {
}
if (pkg->filesize == 0) pkg->filesize = get_filesize(pkg->h);
if (pkg->requires == NULL && pkg->suggests == NULL)
- has_old_suggests = 0;
- pkg->requires = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, is_not_old_suggests);
- if (has_old_suggests)
- pkg->suggests = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, is_old_suggests);
- else
+ pkg->requires = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, NULL);
pkg->suggests = pack_list(pkg->h, RPMTAG_SUGGESTSNAME, 0, 0, NULL);
if (pkg->obsoletes == NULL)
pkg->obsoletes = pack_list(pkg->h, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETEVERSION, NULL);
@@ -1953,10 +1924,7 @@ Pkg_suggests(pkg)
URPM::Package pkg
PPCODE:
PUTBACK;
- int count = return_list_str(pkg->suggests, pkg->h, RPMTAG_SUGGESTSNAME, 0, 0, callback_list_str_xpush, NULL);
- if (count == 0)
- return_list_str(pkg->suggests, pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, 0,
- callback_list_str_xpush_old_suggests, NULL);
+ return_list_str(pkg->suggests, pkg->h, RPMTAG_SUGGESTSNAME, 0, 0, callback_list_str_xpush, NULL);
SPAGAIN;
void