]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- package requirements based on capability requirements are back, reimplemented in...
authorJacek Konieczny <jajcus@pld-linux.org>
Sun, 4 Jan 2004 13:11:27 +0000 (13:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-find_required_pkgs_on_build.patch -> 1.1
    rpm.spec -> 1.501

rpm-find_required_pkgs_on_build.patch [new file with mode: 0644]
rpm.spec

diff --git a/rpm-find_required_pkgs_on_build.patch b/rpm-find_required_pkgs_on_build.patch
new file mode 100644 (file)
index 0000000..c94ca9f
--- /dev/null
@@ -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 <rpmds.h>
+ #include <rpmfi.h>
++#include <rpmts.h>
++#include <rpmdb.h>
+ #if HAVE_GELF_H
+ #include <gelf.h>
+@@ -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);
index f5e339ed18d1b2e12037fabd8a8197dff064e488..0e5ef6ac7ad90bea0af827287bf99777e41ad38d 100644 (file)
--- 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
This page took 0.046568 seconds and 4 git commands to generate.