diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch')
| -rw-r--r-- | meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch | 194 |
1 files changed, 0 insertions, 194 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch deleted file mode 100644 index 9bdd1d4908..0000000000 --- a/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch +++ /dev/null | |||
| @@ -1,194 +0,0 @@ | |||
| 1 | Add an "rpmdeps-oecore" binary which allows batch processing of individual file | ||
| 2 | dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing | ||
| 3 | each line of output with the filename that has the dependency. | ||
| 4 | |||
| 5 | This is much faster than individually calling rpmdeps on each file. | ||
| 6 | |||
| 7 | This binary is used by package.bbclass. | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [OE Specific] | ||
| 10 | |||
| 11 | RP 2012/2/7 | ||
| 12 | |||
| 13 | --- | ||
| 14 | tools/Makefile.am | 6 ++- | ||
| 15 | tools/rpmdeps-oecore.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| 16 | 2 files changed, 152 insertions(+), 1 deletions(-) | ||
| 17 | create mode 100644 tools/rpmdeps-oecore.c | ||
| 18 | |||
| 19 | Index: rpm-5.4.14/tools/Makefile.am | ||
| 20 | =================================================================== | ||
| 21 | --- rpm-5.4.14.orig/tools/Makefile.am | ||
| 22 | +++ rpm-5.4.14/tools/Makefile.am | ||
| 23 | @@ -62,7 +62,7 @@ pkgbin_PROGRAMS = \ | ||
| 24 | @WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \ | ||
| 25 | @WITH_SEMANAGE_SEMODULE@ wget \ | ||
| 26 | rpmcache rpmdigest rpmrepo rpmspecdump \ | ||
| 27 | - rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ | ||
| 28 | + rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ | ||
| 29 | if WITH_DB | ||
| 30 | pkgbin_PROGRAMS += dbconvert | ||
| 31 | endif | ||
| 32 | @@ -172,6 +172,10 @@ rpmdeps_SOURCES = rpmdeps.c | ||
| 33 | rpmdeps_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
| 34 | rpmdeps_LDADD = $(RPM_LDADD_COMMON) | ||
| 35 | |||
| 36 | +rpmdeps_oecore_SOURCES = rpmdeps-oecore.c | ||
| 37 | +rpmdeps_oecore_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
| 38 | +rpmdeps_oecore_LDADD = $(RPM_LDADD_COMMON) | ||
| 39 | + | ||
| 40 | rpmdigest_SOURCES = rpmdigest.c | ||
| 41 | rpmdigest_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS) | ||
| 42 | rpmdigest_LDADD = $(RPMIO_LDADD_COMMON) | ||
| 43 | Index: rpm-5.4.14/tools/rpmdeps-oecore.c | ||
| 44 | =================================================================== | ||
| 45 | --- /dev/null | ||
| 46 | +++ rpm-5.4.14/tools/rpmdeps-oecore.c | ||
| 47 | @@ -0,0 +1,147 @@ | ||
| 48 | +#include "system.h" | ||
| 49 | +const char *__progname; | ||
| 50 | + | ||
| 51 | +#include <rpmio.h> | ||
| 52 | +#include <rpmiotypes.h> | ||
| 53 | +#include <rpmcb.h> | ||
| 54 | +#include <argv.h> | ||
| 55 | +#include <rpmtypes.h> | ||
| 56 | +#include <rpmtag.h> | ||
| 57 | + | ||
| 58 | +#include <rpmds.h> | ||
| 59 | +#define _RPMFC_INTERNAL /* XXX for debugging */ | ||
| 60 | +#include <rpmfc.h> | ||
| 61 | + | ||
| 62 | +#include <rpmcli.h> | ||
| 63 | + | ||
| 64 | +#include "debug.h" | ||
| 65 | + | ||
| 66 | +/*@unchecked@*/ | ||
| 67 | +char *progname; | ||
| 68 | + | ||
| 69 | +#define RPMDEP_RPMFC 1 | ||
| 70 | + | ||
| 71 | +static int rpmdepPrint(char *filename, rpmds ds, FILE * fp) | ||
| 72 | +{ | ||
| 73 | + if (fp == NULL) fp = stderr; | ||
| 74 | + | ||
| 75 | + ds = rpmdsInit(ds); | ||
| 76 | + while (rpmdsNext(ds) >= 0) { | ||
| 77 | + fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2); | ||
| 78 | + } | ||
| 79 | + return 0; | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +static struct poptOption optionsTable[] = { | ||
| 83 | + | ||
| 84 | + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, | ||
| 85 | + N_("Common options:"), | ||
| 86 | + NULL }, | ||
| 87 | + | ||
| 88 | + POPT_AUTOALIAS | ||
| 89 | + POPT_AUTOHELP | ||
| 90 | + POPT_TABLEEND | ||
| 91 | +}; | ||
| 92 | + | ||
| 93 | + | ||
| 94 | +int | ||
| 95 | +main(int argc, char *argv[]) | ||
| 96 | +{ | ||
| 97 | + poptContext optCon; | ||
| 98 | + ARGV_t av = NULL; | ||
| 99 | + rpmfc fc = NULL; | ||
| 100 | + FILE * fp = NULL; | ||
| 101 | + int flags = 0; | ||
| 102 | + int ac = 0; | ||
| 103 | + int ec = 1; | ||
| 104 | + int xx; | ||
| 105 | + int i; | ||
| 106 | + char buf[BUFSIZ]; | ||
| 107 | + int nddict; | ||
| 108 | + const char * s; | ||
| 109 | + char * se; | ||
| 110 | + const char * fn; | ||
| 111 | + const char * N; | ||
| 112 | + const char * EVR; | ||
| 113 | + evrFlags Flags; | ||
| 114 | + unsigned char deptype; | ||
| 115 | + int ix; | ||
| 116 | + rpmds ds; | ||
| 117 | + | ||
| 118 | +/*@-modobserver@*/ | ||
| 119 | + if ((progname = strrchr(argv[0], '/')) != NULL) | ||
| 120 | + progname++; | ||
| 121 | + else | ||
| 122 | + progname = argv[0]; | ||
| 123 | +/*@=modobserver@*/ | ||
| 124 | + | ||
| 125 | + optCon = rpmcliInit(argc, argv, optionsTable); | ||
| 126 | + if (optCon == NULL) | ||
| 127 | + goto exit; | ||
| 128 | + | ||
| 129 | + av = poptGetArgs(optCon); | ||
| 130 | + ac = argvCount(av); | ||
| 131 | + | ||
| 132 | + if (ac == 0) { | ||
| 133 | + av = NULL; | ||
| 134 | + xx = argvFgets(&av, NULL); | ||
| 135 | + ac = argvCount(av); | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + /* Make sure file names are sorted. */ | ||
| 139 | + xx = argvSort(av, NULL); | ||
| 140 | + | ||
| 141 | + /* Build file class dictionary. */ | ||
| 142 | + fc = rpmfcNew(); | ||
| 143 | + xx = rpmfcClassify(fc, av, NULL); | ||
| 144 | + | ||
| 145 | + /* Build file/package dependency dictionary. */ | ||
| 146 | + xx = rpmfcApply(fc); | ||
| 147 | + | ||
| 148 | + /* Generate per-file indices into package dependencies. */ | ||
| 149 | + nddict = argvCount(fc->ddict); | ||
| 150 | + | ||
| 151 | + for (i = 0; i < nddict; i++) { | ||
| 152 | + s = fc->ddict[i]; | ||
| 153 | + | ||
| 154 | + /* Parse out (file#,deptype,N,EVR,Flags) */ | ||
| 155 | + ix = strtol(s, &se, 10); | ||
| 156 | + assert(se != NULL); | ||
| 157 | + deptype = *se++; | ||
| 158 | + se++; | ||
| 159 | + N = se; | ||
| 160 | + while (*se && *se != ' ') | ||
| 161 | + se++; | ||
| 162 | + *se++ = '\0'; | ||
| 163 | + EVR = se; | ||
| 164 | + while (*se && *se != ' ') | ||
| 165 | + se++; | ||
| 166 | + *se++ = '\0'; | ||
| 167 | + Flags = strtol(se, NULL, 16); | ||
| 168 | + | ||
| 169 | + switch (deptype) { | ||
| 170 | + default: | ||
| 171 | + /*@switchbreak@*/ break; | ||
| 172 | + case 'P': | ||
| 173 | + ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); | ||
| 174 | + rpmdepPrint((char *)fc->fn[ix], ds, stdout); | ||
| 175 | + (void)rpmdsFree(ds); | ||
| 176 | + ds = NULL; | ||
| 177 | + /*@switchbreak@*/ break; | ||
| 178 | + case 'R': | ||
| 179 | + ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags); | ||
| 180 | + rpmdepPrint((char *)fc->fn[ix], ds, stdout); | ||
| 181 | + (void)rpmdsFree(ds); | ||
| 182 | + ds = NULL; | ||
| 183 | + /*@switchbreak@*/ break; | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + fc = rpmfcFree(fc); | ||
| 188 | + | ||
| 189 | + ec = 0; | ||
| 190 | + | ||
| 191 | +exit: | ||
| 192 | + optCon = rpmcliFini(optCon); | ||
| 193 | + return ec; | ||
| 194 | +} | ||
