From: Jacek Konieczny Date: Sun, 4 Jan 2004 13:11:27 +0000 (+0000) Subject: - package requirements based on capability requirements are back, reimplemented in... X-Git-Tag: auto/ac/rpm-4_3-0_20040107_1~6 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=commitdiff_plain;h=ce54a647ec667797391d58a1db71f9c73e91902f - package requirements based on capability requirements are back, reimplemented in rpm (no _noautodepreq yet) Changed files: rpm-find_required_pkgs_on_build.patch -> 1.1 rpm.spec -> 1.501 --- diff --git a/rpm-find_required_pkgs_on_build.patch b/rpm-find_required_pkgs_on_build.patch new file mode 100644 index 0000000..c94ca9f --- /dev/null +++ b/rpm-find_required_pkgs_on_build.patch @@ -0,0 +1,119 @@ +diff -durN rpm-4.3.orig/build/rpmfc.c rpm-4.3/build/rpmfc.c +--- rpm-4.3.orig/build/rpmfc.c 2004-01-04 13:53:29.000000000 +0100 ++++ rpm-4.3/build/rpmfc.c 2004-01-04 13:54:54.860259000 +0100 +@@ -9,6 +9,8 @@ + #define _RPMDS_INTERNAL + #include + #include ++#include ++#include + + #if HAVE_GELF_H + #include +@@ -1058,6 +1060,97 @@ + { NULL, 0 } + }; + ++int rpmfcFindRequiredPackages(rpmfc fc) ++{ ++ rpmts ts=NULL; ++ const char * s; ++ char * se; ++ rpmds ds; ++ const char * N; ++ const char * EVR; ++ int_32 Flags; ++ unsigned char deptype; ++ int nddict; ++ int previx; ++ unsigned int val; ++ int dix; ++ int ix; ++ int i; ++ int xx; ++ int r; ++ const char * hname; ++ rpmdbMatchIterator it; ++ Header hdr; ++ ++ ts = rpmtsCreate(); /* XXX ts created in main() should be used */ ++ ++ rpmMessage(RPMMESS_NORMAL, "Searching for required packages....\n"); ++ ++ nddict = argvCount(fc->ddict); ++ previx = -1; ++ for (i = 0; i < nddict; i++) { ++ s = fc->ddict[i]; ++ ++ /* Parse out (file#,deptype,N,EVR,Flags) */ ++ ix = strtol(s, &se, 10); ++ assert(se != NULL); ++ deptype = *se++; ++ se++; ++ N = se; ++ while (*se && *se != ' ') ++ se++; ++ *se++ = '\0'; ++ EVR = se; ++ while (*se && *se != ' ') ++ se++; ++ *se++ = '\0'; ++ Flags = strtol(se, NULL, 16); ++ ++ if (deptype!='R') continue; ++ ++ rpmMessage(RPMMESS_DEBUG, "#%i requires: %s,%s,%i\n",ix,N,EVR,Flags); ++ if (EVR && EVR[0]) { ++ rpmMessage(RPMMESS_DEBUG, "skipping #%i require\n"); ++ continue; ++ } ++ if (N[0]=='/') { ++ rpmMessage(RPMMESS_DEBUG, "skipping #%i require (is file requirement)\n"); ++ continue; ++ } ++ it=rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, N, 0); ++ if (!it) { ++ rpmMessage(RPMMESS_DEBUG, "%s -> not found\n",N); ++ continue; ++ } ++ rpmMessage(RPMMESS_NORMAL, "Iterator: %p\n",it); ++ if (rpmdbGetIteratorCount(it)>1) { ++ rpmMessage(RPMMESS_DEBUG, "%s -> multiple (skipping)\n",N); ++ rpmdbFreeIterator(it); ++ continue; ++ } ++ hdr=rpmdbNextIterator(it); ++ assert(hdr!=NULL); ++ r=rpmHeaderGetEntry(hdr,RPMTAG_NAME,NULL,(void **)&hname, NULL); ++ assert(r<2); ++ if (!strcmp(hname,N)) { ++ rpmMessage(RPMMESS_DEBUG, "%s -> %s (skipping)\n",N,hname); ++ rpmdbFreeIterator(it); ++ continue; ++ } ++ ++ rpmMessage(RPMMESS_DEBUG, "%s -> %s\n",N,hname); ++ ++ ds = rpmdsSingle(RPMTAG_REQUIRENAME, hname, "", RPMSENSE_FIND_REQUIRES); ++ xx = rpmdsMerge(&fc->requires, ds); ++ ds = rpmdsFree(ds); ++ ++ rpmdbFreeIterator(it); ++ } ++ ++ ts = rpmtsFree(ts); ++ return 0; ++} ++ + int rpmfcApply(rpmfc fc) + { + rpmfcApplyTbl fcat; +@@ -1086,6 +1179,8 @@ + } + } + ++ rpmfcFindRequiredPackages(fc); ++ + /*@-boundswrite@*/ + /* Generate per-file indices into package dependencies. */ + nddict = argvCount(fc->ddict); diff --git a/rpm.spec b/rpm.spec index f5e339e..0e5ef6a 100644 --- a/rpm.spec +++ b/rpm.spec @@ -87,6 +87,7 @@ Patch38: %{name}-hack-norpmlibdep.patch Patch40: %{name}-makefile-no_myLDADD_deps.patch Patch41: %{name}-libdir64.patch Patch42: %{name}-libdir-links.patch +Patch43: %{name}-find_required_pkgs_on_build.patch URL: http://www.rpm.org/ Icon: rpm.gif BuildRequires: autoconf >= 2.52 @@ -577,6 +578,7 @@ cat %{SOURCE14} >> macros.in %patch40 -p1 %patch41 -p1 %patch42 -p1 +%patch43 -p1 cd scripts; mv -f perl.req perl.req.in