From 842946749488c80f0e08ad3c9d782f3e85cbc63b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 26 Aug 2014 14:29:35 +0200 Subject: make it compatible with rpm-4.12.0 rpm-4.12.0 introduces a new weak deps implementation (the 3rd one to be used in mdv/mga!) The tag we used to use (RPMTAG_SUGGESTSNAME) is now OLDSUGGESTSNAME => we need to handle both old & new tags Hopefully rpm-4.12.x enables to check both old & new tags when using xxxNVRS variants We thus have a choice between RECOMMEND & SUGGEST tags, that both fallback on older SUGGESTS tags if no new ones are found. The difference is that they filter old suggests depending on RPMSENSE_STRONG hint. As we used suggests in the recommends role, this is the perfect time to switch from suggests to recommends (with a patch on rpm in order to fallback RECOMMEND on weak (old) SUGGESTS instead of on strong (old) ENHANCES as we didn't used the later in mga) Our rpm is patched so that RECOMMENDNAME fallbacks too. In Suse, only RECOMMENDNEVRS is the only RECOMMEND variant that handle the fallback on old tags. However, using RPMTAG_RECOMMENDNEVRS makes URPM->suggest_nosense to return versionated suggests, which while not supported by urpmi, do are used by a couple packages (such as git or gnome-user-share) This breaks urpmi as suggests on "foo >= x.y" is not interpreted by urpmi which thinks that "foo" is a new suggests and reinstalls a previously removed suggests Hence we patched rpm. Conflicts: NEWS URPM.xs --- NEWS | 3 +++ URPM.xs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index eff85e4..d7d7572 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- make it compatible with rpm-4.12.0 +- use new recommends tags instead of suggests ones + Version 3.40.3 - 15 April 2013 - add basic support for --downgrade (mga#6655) diff --git a/URPM.xs b/URPM.xs index 0e4966e..0b68444 100644 --- a/URPM.xs +++ b/URPM.xs @@ -806,7 +806,7 @@ pack_header(URPM__Package pkg) { if (has_old_suggests) pkg->suggests = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, is_old_suggests); else - pkg->suggests = pack_list(pkg->h, RPMTAG_SUGGESTSNAME, 0, 0, NULL); + pkg->suggests = pack_list(pkg->h, RPMTAG_RECOMMENDNAME, 0, 0, NULL); if (pkg->obsoletes == NULL) pkg->obsoletes = pack_list(pkg->h, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETEVERSION, NULL); if (pkg->conflicts == NULL) @@ -1979,7 +1979,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); + int count = return_list_str(pkg->suggests, pkg->h, RPMTAG_RECOMMENDNAME, 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); -- cgit v1.2.1