aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--URPM.xs10
2 files changed, 12 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 116ce3b..2bc3215 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix compiling with rpm-4.10 (eg: Debian 7 Wheezy)
+
Version 5.27 - 29 April 2020
- fix testing on pre UsrMove Linuxes (eg: mga2)
diff --git a/URPM.xs b/URPM.xs
index 8871082..11dbf15 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -137,6 +137,10 @@ typedef struct s_Package* URPM__Package;
#endif
#endif
+#if defined(RPM4_12_0) || defined(PATCHED_MGA) || defined(PATCHED_RH)
+#define WEAK_DEPS_ARE_SUPPORTED
+#endif
+
static ssize_t write_nocheck(int fd, const void *buf, size_t count) {
return write(fd, buf, count);
}
@@ -794,8 +798,10 @@ pack_header(const URPM__Package pkg) {
if (pkg->filesize == 0) pkg->filesize = get_filesize(pkg->h);
if (pkg->requires == NULL)
pkg->requires = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION);
+#ifdef WEAK_DEPS_ARE_SUPPORTED
if (pkg->recommends == NULL)
pkg->recommends = pack_list(pkg->h, RPMTAG_RECOMMENDNAME, 0, 0);
+#endif
if (pkg->obsoletes == NULL)
pkg->obsoletes = pack_list(pkg->h, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETEVERSION);
if (pkg->conflicts == NULL)
@@ -1919,7 +1925,9 @@ Pkg_obsoletes(pkg)
case 1: tag = RPMTAG_CONFLICTNAME; s = pkg->conflicts; flags = RPMTAG_CONFLICTFLAGS; tag_version = RPMTAG_CONFLICTVERSION; break;
case 2: tag = RPMTAG_PROVIDENAME; s = pkg->provides; flags = RPMTAG_PROVIDEFLAGS; tag_version = RPMTAG_PROVIDEVERSION; break;
case 3: tag = RPMTAG_REQUIRENAME; s = pkg->requires; flags = RPMTAG_REQUIREFLAGS; tag_version = RPMTAG_REQUIREVERSION; break;
+#ifdef WEAK_DEPS_ARE_SUPPORTED
case 4: tag = RPMTAG_RECOMMENDNAME;s = pkg->recommends;flags = RPMTAG_RECOMMENDFLAGS;tag_version = RPMTAG_RECOMMENDVERSION;break;
+#endif
default: tag = RPMTAG_OBSOLETENAME; s = pkg->obsoletes; flags = RPMTAG_OBSOLETEFLAGS; tag_version = RPMTAG_OBSOLETEVERSION; break;
}
return_list_str(s, pkg->h, tag, flags, tag_version, callback_list_str_xpush, NULL);
@@ -1942,7 +1950,9 @@ Pkg_obsoletes_nosense(pkg)
case 1: tag = RPMTAG_CONFLICTNAME; s = pkg->conflicts; break;
case 2: tag = RPMTAG_PROVIDENAME; s = pkg->provides; break;
case 3: tag = RPMTAG_REQUIRENAME; s = pkg->requires; break;
+#ifdef WEAK_DEPS_ARE_SUPPORTED
case 4: tag = RPMTAG_RECOMMENDNAME;s = pkg->recommends; break;
+#endif
default: tag = RPMTAG_OBSOLETENAME; s = pkg->obsoletes; break;
}
return_list_str(s, pkg->h, tag, 0, 0, callback_list_str_xpush, NULL);