The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / rpm / 0007-parentdir-vs-requires.patch
1 Avoid looking up files or directories that this package provides
2 Included upstream
3 diff -u --new-file --recursive rpm-5.2.0_vanilla/lib/depends.c rpm-5.2.0_parentdir-vs-requires/lib/depends.c
4 --- rpm-5.2.0_vanilla/lib/depends.c     2009-05-23 01:23:46.000000000 +0000
5 +++ rpm-5.2.0_parentdir-vs-requires/lib/depends.c       2009-09-22 17:00:24.880956271 +0000
6 @@ -2095,6 +2095,7 @@
7      rpmtsi qi; rpmte q;
8      tsortInfo tsi;
9      nsType NSType = rpmdsNSType(requires);
10 +    const char * N = rpmdsN(requires);
11      fnpyKey key;
12      int teType = rpmteType(p);
13      alKey pkgKey;
14 @@ -2128,6 +2129,23 @@
15         break;
16      }
17  
18 +    /* Avoid looking up files/directories that are "owned" by _THIS_ package. */
19 +    if (*N == '/') {
20 +    rpmfi fi = rpmteFI(p, RPMTAG_BASENAMES);
21 +    int bingo = 0;
22 +
23 +    fi = rpmfiInit(fi, 0);
24 +    while (rpmfiNext(fi) >= 0) {
25 +        const char * fn = rpmfiFN(fi);
26 +        if (strcmp(N, fn))
27 +        continue;
28 +        bingo = 1;
29 +        break;
30 +    }
31 +    if (bingo)
32 +        return 0;
33 +    }
34 +
35      pkgKey = RPMAL_NOMATCH;
36      key = rpmalSatisfiesDepend(al, requires, &pkgKey);
37