11 #define _MIRE_INTERNAL
15 #define _RPMEVR_INTERNAL
18 #define _RPMNS_INTERNAL
21 #define _RPMFC_INTERNAL
24 #define _RPMDS_INTERNAL
56 for (i = 0; i < ac; i++)
58 argv[argc + ac] = NULL;
64 #if defined(HAVE_SIG_T) && !defined(SIGHANDLER_T)
65 typedef sig_t sighandler_t;
80 const char * writePtr,
size_t writeBytesLeft,
89 sighandler_t oldhandler = signal(SIGPIPE, SIG_IGN);
93 toProg[0] = toProg[1] = 0;
94 fromProg[0] = fromProg[1] = 0;
95 if (pipe(toProg) < 0 || pipe(fromProg) < 0) {
100 if (!(child = fork())) {
101 (void) close(toProg[1]);
102 (void) close(fromProg[0]);
104 (void) dup2(toProg[0], STDIN_FILENO);
105 (void) dup2(fromProg[1], STDOUT_FILENO);
107 (void) close(toProg[0]);
108 (void) close(fromProg[1]);
115 argv[0], (
unsigned)getpid());
118 (void) execvp(argv[0], (
char *
const *)argv);
121 argv[0], strerror(
errno));
126 argv[0], strerror(
errno));
130 (void) close(toProg[0]);
131 (void) close(fromProg[1]);
134 (void) fcntl(fromProg[0], F_SETFL, O_NONBLOCK);
135 (void) fcntl(toProg[1], F_SETFL, O_NONBLOCK);
151 if (fromProg[0] >= 0) {
152 FD_SET(fromProg[0], &ibits);
154 if (toProg[1] >= 0) {
155 FD_SET(toProg[1], &obits);
160 nfd = ((fromProg[0] > toProg[1]) ? fromProg[0] : toProg[1]);
161 if ((rc = select(nfd, &ibits, &obits, NULL, &tv)) < 0) {
168 if (toProg[1] >= 0 && FD_ISSET(toProg[1], &obits)) {
169 if (writePtr && writeBytesLeft > 0) {
170 if ((nbw = write(toProg[1], writePtr,
171 ((
size_t)1024<writeBytesLeft) ? (
size_t)1024 : writeBytesLeft)) < 0)
173 if (
errno != EAGAIN) {
174 perror(
"getOutputFrom()");
179 writeBytesLeft -= nbw;
181 }
else if (toProg[1] >= 0) {
182 (void) close(toProg[1]);
188 {
char buf[BUFSIZ+1];
189 while ((nbr = read(fromProg[0], buf,
sizeof(buf)-1)) > 0) {
196 done = (nbr == 0 || (nbr < 0 &&
errno != EAGAIN));
202 (void) close(toProg[1]);
203 if (fromProg[0] >= 0)
204 (void) close(fromProg[0]);
205 (void) signal(SIGPIPE, oldhandler);
208 reaped = waitpid(child, &status, 0);
210 (
unsigned)child, (
unsigned)reaped, status);
212 if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) {
213 const char *cmd =
argvJoin(argv,
' ');
214 int rc = (WIFEXITED(status) ? WEXITSTATUS(status) : -1);
221 if (writeBytesLeft) {
232 const char * s = NULL;
238 const char * buf_stdin = NULL;
239 size_t buf_stdin_len = 0;
254 xx = poptParseArgvString(s, &pac, (
const char ***)&pav);
255 if (!(xx == 0 && pac > 0 && pav != NULL))
264 if (iob_stdin != NULL) {
270 iob =
getOutputFrom(NULL, xav, buf_stdin, buf_stdin_len, failnonzero);
272 if (iob_stdoutp != NULL) {
327 sprintf(buf,
"%08u%c %s %s 0x%08x", (
unsigned)ix, deptype,
348 xx = poptParseArgvString(s, &ac, (
const char ***)&av);
351 if (ac == 0 || av == NULL || *av == NULL) {
356 for (i = 0; i < ac; i++) {
361 _(
"Compilation of pattern '%s'"
362 " (expanded from '%s') failed. Skipping ...\n"),
378 const char * str,
char deptype)
385 for (i = 0; i < nmire; i++) {
420 const char * fn = fc->fn[fc->ix];
444 xx =
snprintf(buf,
sizeof(buf),
"%%{?__%s_provides}", nsdep);
445 depsp = &fc->provides;
446 dsContext = RPMSENSE_FIND_PROVIDES;
448 mire = (
miRE) fc->Pmires;
454 xx =
snprintf(buf,
sizeof(buf),
"%%{?__%s_requires}", nsdep);
455 depsp = &fc->requires;
456 dsContext = RPMSENSE_FIND_REQUIRES;
458 mire = (
miRE) fc->Rmires;
462 buf[
sizeof(buf)-1] =
'\0';
469 xx =
rpmfcExec(av, iob_stdin, &iob_stdout, 0);
472 if (xx == 0 && iob_stdout != NULL) {
477 for (i = 0; i < pac; i++) {
481 if (pav[i+1] && strchr(
"=<>", *pav[i+1])) {
483 for (s = pav[i]; *s; s++) {
510 #if defined(RPM_VENDOR_MANDRIVA)
521 #define RPMSENSE_SCRIPTS (RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN|RPMSENSE_SCRIPT_VERIFY)
526 (((*depsp)->Flags[(*depsp)->i] & RPMSENSE_GREATER) && (Flags &
RPMSENSE_LESS))) &&
528 !(((Flags & RPMSENSE_SCRIPTS) && !((*depsp)->Flags[(*depsp)->i] & RPMSENSE_SCRIPTS)) ||
529 (((*depsp)->Flags[(*depsp)->i] & RPMSENSE_SCRIPTS) && !(Flags & RPMSENSE_SCRIPTS))))
531 #undef RPMSENSE_SCRIPTS
539 if (!(Flags & RPMSENSE_MISSINGOK) || !((*depsp)->Flags[(*depsp)->i] & RPMSENSE_MISSINGOK)) {
540 (*depsp)->Flags[(*depsp)->i] &= ~RPMSENSE_MISSINGOK;
541 Flags &= ~RPMSENSE_MISSINGOK;
545 newflags = (((*depsp)->Flags[(*depsp)->i]| Flags) & _ALL_REQUIRES_MASK);
552 rEVR->Flags = (*depsp)->Flags[(*depsp)->i];
560 (*depsp)->Flags[(*depsp)->i] = Flags;
561 (*depsp)->EVR[(*depsp)->i] = strdup(EVR);
565 else if ((*depsp)->Flags[(*depsp)->i] != Flags) {
567 (*depsp)->Flags[(*depsp)->i] &= ~(RPMSENSE_GREATER|
RPMSENSE_LESS);
571 (*depsp)->Flags[(*depsp)->i] |= newflags;
574 for (ix = 0; ix <
argvCount(fc->ddict); ix++) {
575 if (!strcmp(strchr(fc->ddict[ix],
' '), oldVal)) {
576 size_t fcix = atol(fc->ddict[ix]);
577 _free(fc->ddict[ix]);
723 for (fct = rpmfcTokens; fct->token != NULL; fct++) {
724 if (strstr(fmstr, fct->token) == NULL)
726 fcolor |= fct->colors;
744 if (fp == NULL) fp = stderr;
747 fprintf(fp,
"===================================== %s\n", msg);
753 for (fx = 0; fx < fc->nfiles; fx++) {
754 assert(fx < fc->fcdictx->nvals);
755 cx = fc->fcdictx->vals[fx];
756 assert(fx < fc->fcolor->nvals);
757 fcolor = fc->fcolor->vals[fx];
759 fprintf(fp,
"%3d %s", (
int)fx, fc->fn[fx]);
761 fprintf(fp,
"\t0x%x", fc->fcolor->vals[fx]);
763 fprintf(fp,
"\t%s", fc->cdict[cx]);
766 if (fc->fddictx == NULL || fc->fddictn == NULL)
769 assert(fx < fc->fddictx->nvals);
770 dx = fc->fddictx->vals[fx];
771 assert(fx < fc->fddictn->nvals);
772 ndx = fc->fddictn->vals[fx];
776 unsigned char deptype;
779 ix = fc->ddictx->vals[dx++];
780 deptype = ((ix >> 24) & 0xff);
785 assert(depval != NULL);
789 assert(ix < nprovides);
797 assert(ix < nrequires);
805 fprintf(fp,
"\t%s\n", depval);
819 const char * fn = fc->fn[fc->ix];
831 const char * defaultdocdir =
rpmExpand(
"%{?_defaultdocdir}", NULL);
832 if (defaultdocdir == NULL || *defaultdocdir ==
'\0')
833 defaultdocdir = strdup(
"/usr/share/doc");
834 xx = !strncmp(fn+fc->brlen, defaultdocdir, strlen(defaultdocdir));
835 defaultdocdir =
_free(defaultdocdir) ;
841 {
struct stat sb, * st = &sb;
842 if (stat(fn, st) != 0)
844 is_executable = (int)(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
848 if (fp == NULL || ferror(fp)) {
849 if (fp) (void) fclose(fp);
854 for (i = 0; i < 10; i++) {
856 s = fgets(buf,
sizeof(buf) - 1, fp);
857 if (s == NULL || ferror(fp) || feof(fp))
859 s[
sizeof(buf)-1] =
'\0';
860 if (!(s[0] ==
'#' && s[1] ==
'!'))
864 while (*s && strchr(
" \t\n\r", *s) != NULL)
871 for (se = s+1; *se; se++) {
872 if (strchr(
" \t\n\r", *se) != NULL)
885 strncmp(bn,
"bash",
sizeof(
"bash")-1) &&
887 strncmp(bn,
"perl",
sizeof(
"perl")-1) &&
888 strncmp(bn,
"python",
sizeof(
"python")-1) &&
889 strncmp(bn,
"ruby",
sizeof(
"ruby")-1) &&
900 }
else if (!strcmp(bn,
"env") && strlen(se)) {
902 strsep(&se,
" \t\n\r");
909 if (!strcmp(bn,
"perl"))
911 else if (!strncmp(bn,
"python",
sizeof(
"python")-1))
913 else if (!strncmp(bn,
"php",
sizeof(
"php")-1))
915 else if (!strncmp(bn,
"ruby",
sizeof(
"ruby")-1))
926 if (is_executable || (fc->fcolor->vals[fc->ix] &
RPMFC_MODULE))
932 if (is_executable || (fc->fcolor->vals[fc->ix] &
RPMFC_MODULE))
956 if (fc->fcolor->vals[fc->ix] &
RPMFC_PHP) {
971 if (is_executable || (fc->fcolor->vals[fc->ix] &
RPMFC_MODULE))
991 strstr(fn,
"/gstreamer")) {
995 #if defined(RPM_VENDOR_MANDRIVA)
999 if (!
mireRegcomp(mire,
"^.*((/lib/modules/|/var/lib/dkms/).*\\.ko(\\.gz|\\.xz)?|(/var/lib/dkms-binary/[^/]+/[^/]+|/usr/src)/[^/]+/dkms.conf)$"))
1000 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0) {
1010 if (!
mireRegcomp(mire,
"^.*/usr/share/applications/.*\\.desktop$"))
1011 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0) {
1040 fprintf(stderr,
"*** rpmfcMergePR(%p, %p) %s\n", context, ds,
tagName(
rpmdsTagN(ds)));
1084 const char * fn = fc->fn[fc->ix];
1095 #if defined(RPM_VENDOR_MANDRIVA)
1105 extern int rpmdsSymlink(
const char * fn,
int flags,
1106 int (*add) (
void * context,
rpmds ds),
void * context)
1110 static int rpmfcSYMLINK(
rpmfc fc)
1114 const char * fn = fc->fn[fc->ix];
1161 unsigned char deptype;
1172 int skipProv = fc->skipProv;
1173 int skipReq = fc->skipReq;
1176 if (_filter_execs) {
1179 if (fc->PFnmire > 0)
1184 if (fc->RFnmire > 0)
1200 assert(fc->fn != NULL);
1202 for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
1206 { fn = strstr(fc->fn[fc->ix],
"/usr/lib");
1208 fn +=
sizeof(
"/usr/lib")-1;
1209 if ((fn[0] ==
'3' && fn[1] ==
'2') ||
1210 (fn[0] ==
'6' && fn[1] ==
'4'))
1212 if (!strncmp(fn,
"/python",
sizeof(
"/python")-1)) {
1214 if (strstr(fn,
"site-packages"))
1216 else if (strstr(fn,
".egg")) {
1218 if (!
mireRegcomp(mire,
".*/.*\\.egg(|-info|-link)(|/.*)$"))
1219 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0)
1224 else if (!strncmp(fn,
"/ruby",
sizeof(
"/ruby")-1)) {
1226 if ((strstr(fn,
".gemspec") || strstr(fn,
"rbconfig.rb"))) {
1228 if (!
mireRegcomp(mire,
".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$"))
1229 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0)
1235 else if (!strncmp(fn,
"/gstreamer",
sizeof(
"/gstreamer")-1) &&
1238 #if defined(RPM_VENDOR_MANDRIVA)
1241 if (!
mireRegcomp(mire,
"^.*((/lib/modules/|/var/lib/dkms/).*\\.ko(\\.gz|\\.xz)?|(/var/lib/dkms-binary/[^/]+/[^/]+|/usr/src)/[^/]+/dkms.conf)$"))
1242 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0)
1247 if (!
mireRegcomp(mire,
"^.*/usr/share/applications/.*\\.desktop$"))
1248 if (
mireRegexec(mire, fc->fn[fc->ix], (
size_t) 0) >= 0)
1256 { fn = strstr(fc->fn[fc->ix],
"/usr/share/haskell-deps");
1261 if (fc->fcolor->vals[fc->ix])
1262 for (fcat = rpmfcApplyTable; fcat->
func != NULL; fcat++) {
1263 if (!(fc->fcolor->vals[fc->ix] & fcat->
colormask))
1266 if (_filter_execs) {
1267 fc->skipProv = skipProv;
1268 fc->skipReq = skipReq;
1269 if ((mire = (
miRE)fc->PFmires) != NULL)
1270 for (j = 0; j < fc->PFnmire; j++, mire++) {
1271 fn = fc->fn[fc->ix] + fc->brlen;
1279 if ((mire = (
miRE)fc->RFmires) != NULL)
1280 for (j = 0; j < fc->RFnmire; j++, mire++) {
1281 fn = fc->fn[fc->ix] + fc->brlen;
1291 struct stat sb, * st = &sb;
1292 if (stat(fc->fn[fc->ix], st) == 0 && !(st->st_mode & (S_IFBLK|S_IFCHR)))
1293 xx = (*fcat->
func) (fc);
1297 if (_filter_execs) {
1303 fc->skipProv = skipProv;
1304 fc->skipReq = skipReq;
1309 for (i = 0; i < nddict; i++) {
1313 ix = strtol(s, &se, 10);
1318 while (*se && *se !=
' ')
1322 while (*se && *se !=
' ')
1325 Flags = (
evrFlags) strtol(se, NULL, 16);
1333 skipping = fc->skipProv;
1340 skipping = fc->skipReq;
1356 val = (deptype << 24) | (dix & 0x00ffffff);
1357 xx =
argiAdd(&fc->ddictx, -1, val);
1363 if (fc->fddictn && fc->fddictn->vals && !skipping)
1364 fc->fddictn->vals[ix]++;
1375 const char * s, * se;
1379 const char * magicfile = NULL;
1381 if (fc == NULL || argv == NULL)
1384 magicfile =
rpmExpand(
"%{?_rpmfc_magic_path}", NULL);
1385 if (magicfile == NULL || *magicfile ==
'\0')
1386 magicfile =
_free(magicfile);
1394 xx =
argiAdd(&fc->fddictx, fc->nfiles-1, 0);
1395 xx =
argiAdd(&fc->fddictn, fc->nfiles-1, 0);
1399 xx =
argvAdd(&fc->cdict,
"directory");
1401 for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) {
1407 ftype =
""; freeftype = 0;
1408 urltype =
urlPath(argv[fc->ix], &s);
1409 assert(s != NULL && *s ==
'/');
1412 switch (mode & S_IFMT) {
1413 case S_IFCHR: ftype =
"character special";
break;
1414 case S_IFBLK: ftype =
"block special";
break;
1415 #if defined(S_IFIFO)
1416 case S_IFIFO: ftype =
"fifo (named pipe)";
break;
1418 #if defined(S_IFSOCK)
1420 case S_IFSOCK: ftype =
"socket";
break;
1428 #define _suffix(_s, _x) \
1429 (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x)))
1433 ftype =
"Perl5 module source text";
1437 ftype =
"Java archive file";
1440 else if (
_suffix(s,
".class"))
1441 ftype =
"Java class file";
1445 ftype =
"libtool library file";
1449 ftype =
"pkgconfig file";
1453 ftype =
"PHP script text";
1456 else if (
_suffix(s,
".typelib"))
1457 ftype =
"G-IR binary database";
1461 ftype =
"G-IR binary database";
1464 else if (slen >= fc->brlen+
sizeof(
"/dev/") && !strncmp(s+fc->brlen,
"/dev/",
sizeof(
"/dev/")-1))
1466 else if (magicfile) {
1468 assert(ftype != NULL);
1491 #if defined(RPM_VENDOR_MANDRIVA)
1495 if ((fn = strrchr(s,
'.')) && !strcmp(fn,
".so")) {
1496 FILE * fp = fopen(s,
"r");
1499 if (fp == NULL || ferror(fp)) {
1500 if (fp) (void) fclose(fp);
1502 while ((in = fgets(buf,
sizeof(buf) - 1, fp))) {
1503 in[
sizeof(buf)-1] =
'\0';
1504 if (ferror(fp) || feof(fp))
1506 if ((fn = strstr(in,
"GROUP")) &&
1507 (fn = strchr(fn,
'(')) && (fn = strchr(in,
'/'))) {
1517 xx =
argiAdd(&fc->fcolor, (
int)fc->ix, fcolor);
1524 ftype =
_free(ftype);
1530 for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) {
1536 xx =
argiAdd(&fc->fcdictx, (
int)fc->ix, (dav - fc->cdict));
1539 xx =
argiAdd(&fc->fcdictx, (
int)fc->ix, 0);
1548 D_(
"categorized %d files into %u classes (using %s).\n"),
1549 (
unsigned)fc->nfiles,
argvCount(fc->cdict), magicfile);
1550 magicfile =
_free(magicfile);
1578 {
"Provides", {
"%{?__find_provides}", NULL, NULL, NULL },
1581 {
"Requires(interp)", { NULL,
"interp", NULL, NULL },
1583 _notpre(RPMSENSE_INTERP), 0 },
1584 {
"Requires(rpmlib)", { NULL,
"rpmlib", NULL, NULL },
1586 _notpre(RPMSENSE_RPMLIB), 0 },
1587 {
"Requires(verify)", { NULL,
"verify", NULL, NULL },
1589 RPMSENSE_SCRIPT_VERIFY, 0 },
1590 {
"Requires(pre)", { NULL,
"pre", NULL, NULL },
1592 _notpre(RPMSENSE_SCRIPT_PRE), 0 },
1593 {
"Requires(post)", { NULL,
"post", NULL, NULL },
1595 _notpre(RPMSENSE_SCRIPT_POST), 0 },
1596 {
"Requires(preun)", { NULL,
"preun", NULL, NULL },
1598 _notpre(RPMSENSE_SCRIPT_PREUN), 0 },
1599 {
"Requires(postun)", { NULL,
"postun", NULL, NULL },
1601 _notpre(RPMSENSE_SCRIPT_POSTUN), 0 },
1602 {
"Requires", {
"%{?__find_requires}", NULL, NULL, NULL },
1604 RPMSENSE_FIND_REQUIRES|RPMSENSE_TRIGGERIN|RPMSENSE_TRIGGERUN|RPMSENSE_TRIGGERPOSTUN|RPMSENSE_TRIGGERPREIN, 0 },
1605 {
"Conflicts", {
"%{?__find_conflicts}", NULL, NULL, NULL },
1608 {
"Obsoletes", {
"%{?__find_obsoletes}", NULL, NULL, NULL },
1633 for (dm = DepMsgs; dm->
msg != NULL; dm++) {
1634 if ((
int)dm->
ntag != -1) {
1677 int failnonzero = 0;
1689 for (dm = DepMsgs; dm->
msg != NULL; dm++) {
1704 tagflags = RPMSENSE_FIND_PROVIDES;
1710 tagflags = RPMSENSE_FIND_REQUIRES;
1717 xx =
rpmfcExec(dm->
argv, iob_stdin, &iob_stdout, failnonzero);
1726 if (iob_stdout == NULL) {
1754 {
"Requires(pre)", {
"%{?__scriptlet_requires}", NULL, NULL, NULL },
1756 RPMSENSE_SCRIPT_PRE, 0 },
1757 {
"Requires(post)", {
"%{?__scriptlet_requires}", NULL, NULL, NULL },
1759 RPMSENSE_SCRIPT_POST, 0 },
1760 {
"Requires(preun)", {
"%{?__scriptlet_requires}", NULL, NULL, NULL },
1762 RPMSENSE_SCRIPT_PREUN, 0 },
1763 {
"Requires(postun)", {
"%{?__scriptlet_requires}", NULL, NULL, NULL },
1765 RPMSENSE_SCRIPT_POSTUN, 0 },
1781 rpmiob iob_stdout = NULL;
1783 int failnonzero = 0;
1787 for (dm = ScriptMsgs; dm->
msg != NULL; dm++) {
1798 if (!xx || he->
p.
str == NULL)
1800 xx = strcmp(he->
p.
str,
"/bin/sh") && strcmp(he->
p.
str,
"/bin/bash");
1808 if (!xx || he->
p.
str == NULL)
1815 xx =
rpmfcExec(dm->
argv, iob_stdin, &iob_stdout, failnonzero);
1821 if (s != NULL && *s !=
'\0') {
1824 while ((se = strstr(se,
"executable(/")) != NULL) {
1829 se = strchr(se,
')');
1835 rc = spec->
_parseRCPOT(spec, pkg, s, tag, 0, tagflags);
1847 HE_t he = memset(
alloca(
sizeof(*he)), 0,
sizeof(*he));
1849 unsigned i, rnum, removed = 0;
1850 const char **deps = NULL;
1851 const char **versions = NULL;
1853 int *newpos = NULL, *ddictxPos = NULL;
1862 versions = he->
p.
argv;
1868 if (fc && fc->requires != NULL && fc->ddictx != NULL) {
1869 newpos =
alloca(he->
c*
sizeof(newpos[0]));
1871 ddictxPos =
alloca(fc->ddictx->nvals*
sizeof(ddictxPos[0]));
1873 for (i = 0; i < rnum-removed; i++) {
1875 deps[i] = deps[i+removed];
1876 versions[i] = versions[i+removed];
1877 flags[i] = flags[i+removed];
1879 fc->requires->N[i] = fc->requires->N[i+removed];
1880 fc->requires->EVR[i] = fc->requires->EVR[i+removed];
1881 fc->requires->Flags[i] = fc->requires->Flags[i+removed];
1884 if (fc && fc->requires != NULL && fc->ddictx != NULL)
1885 newpos[i+removed] = i;
1889 if (flags[i] & RPMSENSE_SCRIPT_PRE)
1892 if (fc && fc->requires != NULL && fc->ddictx != NULL)
1893 newpos[i+removed] = -1;
1902 if (fc && fc->requires != NULL && fc->ddictx != NULL && removed) {
1903 fc->requires->Count -= removed;
1905 for (i = 0; i < fc->ddictx->nvals-rx; i++) {
1907 unsigned char deptype;
1909 ix = fc->ddictx->vals[i+rx];
1910 deptype = ((ix >> 24) & 0xff);
1913 if (deptype ==
'P') {
1914 ddictxPos[i+rx] = i;
1915 fc->ddictx->vals[i] = fc->ddictx->vals[i+rx];
1918 if (newpos[ix] == -1) {
1919 ddictxPos[i+rx] = -1;
1924 ddictxPos[i+rx] = i;
1925 fc->ddictx->vals[i] = (deptype << 24) | (newpos[ix] & 0x00ffffff);
1928 fc->ddictx->nvals -= rx;
1930 for (i = 0; i < fc->fddictn->nvals; i++) {
1932 if (fc->fddictn->vals[i]) {
1933 unsigned j, ix = fc->fddictx->vals[i];
1934 for (j = 0, rx = 0; j < fc->fddictn->vals[i]; j++, ix++) {
1935 if (ddictxPos[ix] == -1)
1937 if (j == 0 || fc->fddictx->vals[i] == -1)
1938 fc->fddictx->vals[i] = ddictxPos[ix];
1942 fc->fddictn->vals[i] -= rx;
1943 if (fc->fddictn->vals[i] == 0)
1944 fc->fddictx->vals[i] = 0;
1956 he->
p.
argv = versions;
1961 he->
p.
ui32p = (uint32_t*)flags;
1983 int genConfigDeps, internaldeps;
1998 if (internaldeps == 0) {
2007 if (internaldeps > 1)
2034 {
const char * buildRootURL;
2035 const char * buildRoot;
2037 (void)
urlPath(buildRootURL, &buildRoot);
2038 if (buildRoot && !strcmp(buildRoot,
"/")) buildRoot = NULL;
2039 fc->brlen = (buildRoot ? strlen(buildRoot) : 0);
2040 buildRootURL =
_free(buildRootURL);
2044 if (!fc->skipProv) {
2057 if (genConfigDeps) {
2062 assert(EVR != NULL);
2063 sprintf(buf,
"config(%s)", N);
2084 if (genConfigDeps) {
2089 assert(EVR != NULL);
2090 sprintf(buf,
"config(%s)", N);
2109 assert(ac == (
int)he->
c);
2110 if (he->
p.
ptr != NULL && he->
c > 0) {
2114 for (i = 0; i < (int)he->
c; i++)
2125 if (he->
p.
ptr != NULL && he->
c > 0) {
2134 assert(ac == (
int)he->
c);
2135 if (he->
p.
ptr != NULL && he->
c > 0) {
2140 if (fc->provides != NULL && (he->
c =
rpmdsCount(fc->provides)) > 0
2145 he->
p.
argv = fc->provides->N;
2152 he->
p.
argv = fc->provides->EVR;
2153 assert(he->
p.
ptr != NULL);
2159 assert(he->
p.
ptr != NULL);
2165 if (fc->requires != NULL && (he->
c =
rpmdsCount(fc->requires)) > 0
2170 he->
p.
argv = fc->requires->N;
2171 assert(he->
p.
ptr != NULL);
2178 he->
p.
argv = fc->requires->EVR;
2179 assert(he->
p.
ptr != NULL);
2185 assert(he->
p.
ptr != NULL);
2197 if (he->
p.
ptr != NULL) {
2206 assert(ac == (
int)he->
c);
2207 if (he->
p.
ptr != NULL) {
2215 assert(ac == (
int)he->
c);
2216 if (he->
p.
ptr != NULL) {
2224 sprintf(msg,
"final: files %u cdict[%d] %u%% ddictx[%d]", (
unsigned int)fc->nfiles,
argvCount(fc->cdict), (
unsigned int)((100 * fc->fknown)/fc->nfiles),
argiCount(fc->ddictx));
2229 fmode =
_free(fmode);
2244 fc->fcdictx =
argiFree(fc->fcdictx);
2245 fc->fddictx =
argiFree(fc->fddictx);
2246 fc->fddictn =
argiFree(fc->fddictn);
2252 fc->provides = NULL;
2254 fc->requires = NULL;
2272 if (_rpmfcPool == NULL) {
2278 memset(((
char *)fc)+
sizeof(fc->_item), 0,
sizeof(*fc)-
sizeof(fc->_item));