From 8119ee01ac990cd70f2a018d90cd825025fa3840 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Fri, 23 Nov 2007 10:26:50 +0300 Subject: [PATCH] reqprov.c (addReqProv): eliminate dependencies on the package name perl-base will no longer require 'perl-base >= 1:5.7.3'. --- build/reqprov.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/build/reqprov.c b/build/reqprov.c index 2c939e4..a25e494 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -454,9 +454,34 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, hfd(dn, dnt); hfd(di, dit); hfd(bn, bnt); - if (skip) - return 0; } + else { + const char *N = NULL, *V = NULL, *R = NULL; + headerNVR(h, &N, &V, &R); + if (N && strcmp(depName, N) == 0) { + if (!(depFlags & RPMSENSE_SENSEMASK)) + skip = 1; + else if (V && R) { + int_32 *E = NULL; + char EVR[BUFSIZ]; + hge(h, RPMTAG_EPOCH, NULL, (void**) &E, NULL); + if (E) + snprintf(EVR, sizeof(EVR), "%d:%s-%s", *E, V, R); + else + snprintf(EVR, sizeof(EVR), "%s-%s", V, R); + if (rpmRangesOverlap("", EVR, RPMSENSE_EQUAL, + "", depEVR, depFlags)) + skip = 1; + } + if (skip) + rpmMessage (RPMMESS_DEBUG, + "new dep \"%s\" is the package name, optimized out\n", + depName); + } + } + + if (skip) + return 0; } /* Remove OLD provided requires. */