strcpy(t, s);
stripTrailingSlashes(t);
relocations[i].newPath = t;
- } else {
- relocations[i].newPath = NULL;
- }
- if (relocations[i].newPath) {
/* Verify that the relocation's old path is in the header. */
for (j = 0; j < numValid; j++)
if (!strcmp(validRelocations[j],
if (j == numValid && !allowBadRelocate)
psAppend(probs, RPMPROB_BADRELOCATE, alp->key, alp->h,
relocations[i].oldPath, NULL,0 );
+ } else {
+ relocations[i].newPath = NULL;
}
}
static void skipFiles(struct fileInfo * fi, int noDocs)
{
- int i, j;
- char ** netsharedPaths = NULL, ** nsp;
- char ** fileLangs, ** languages, ** lang;
- char * oneLang[2] = { NULL, NULL };
+ int i;
+ char ** netsharedPaths = NULL;
+ const char ** fileLangs;
+ const char ** languages;
+ const char * oneLang[2] = { NULL, NULL };
int freeLanguages = 0;
- char * chptr;
if (!noDocs)
noDocs = rpmExpandNumeric("%{_excludedocs}");
NULL))
fileLangs = NULL;
- if ((chptr = getenv("LINGUAS"))) {
- languages = splitString(chptr, strlen(chptr), ':');
+ if ((oneLang[0] = getenv("LINGUAS"))) {
+ languages = (const char **)
+ splitString(oneLang[0] , strlen(oneLang[0] ), ':');
freeLanguages = 1;
} else if ((oneLang[0] = getenv("LANG"))) {
languages = oneLang;
}
for (i = 0; i < fi->fc; i++) {
+ char **nsp;
+
+ /* Don't bother with skipped files */
if (fi->actions[i] == FA_SKIP || fi->actions[i] == FA_SKIPNSTATE)
continue;
- /* netsharedPaths are not relative to the current root (though
- they do need to take package relocations into account) */
+ /*
+ * Skip net shared paths.
+ * Net shared paths are not relative to the current root (though
+ * they do need to take package relocations into account).
+ */
for (nsp = netsharedPaths; nsp && *nsp; nsp++) {
- j = strlen(*nsp);
- if (!strncmp(fi->fl[i], *nsp, j) &&
- (fi->fl[i][j] == '\0' ||
- fi->fl[i][j] == '/'))
- break;
+ int len;
+ len = strlen(*nsp);
+ if (strncmp(fi->fl[i], *nsp, len))
+ continue;
+
+ /* Only directories or complete file paths can be net shared */
+ if (!(fi->fl[i][len] == '/' || fi->fl[i][len] == '\0'))
+ continue;
+ break;
}
if (nsp && *nsp) {
continue;
}
+ /*
+ * Skip i18n language specific files.
+ */
if (fileLangs && languages && *fileLangs[i]) {
+ const char **lang, *l, *le;
for (lang = languages; *lang; lang++) {
- const char *l, *le;
for (l = fileLangs[i]; *l; l = le) {
for (le = l; *le && *le != '|'; le++)
;
}
}
lingo:
- if (!*lang) {
+ if (*lang == NULL) {
fi->actions[i] = FA_SKIPNSTATE;
continue;
}
}
+ /*
+ * Skip documentation if requested.
+ */
if (noDocs && (fi->fflags[i] & RPMFILE_DOC))
fi->actions[i] = FA_SKIPNSTATE;
}
if (netsharedPaths) freeSplitString(netsharedPaths);
if (fileLangs) free(fileLangs);
- if (freeLanguages) freeSplitString(languages);
+ if (freeLanguages) freeSplitString((char **)languages);
}
#define NOTIFY(_x) if (notify) notify _x
}
/* actions is initialized earlier for added packages */
- if (!fi->actions)
+ if (fi->actions == NULL)
fi->actions = calloc(sizeof(*fi->actions), fi->fc);
headerGetEntry(fi->h, RPMTAG_FILEMODES, NULL,
}
/* There are too many returns to plug this leak. Use alloca instead. */
- { char *s = currentDirectory();
+ { const char *s = currentDirectory();
char *t = alloca(strlen(s) + 1);
strcpy(t, s);
currDir = t;
- free(s);
+ xfree(s);
}
chdir("/");
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-08-06 19:43-0400\n"
+"POT-Creation-Date: 1999-08-06 20:05-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "You must set \"%%_pgp_name\" in your macro file"
msgstr ""
-#: ../lib/transaction.c:350
+#: ../lib/transaction.c:348
#, c-format
msgid "relocating %s to %s\n"
msgstr ""
-#: ../lib/transaction.c:357
+#: ../lib/transaction.c:355
#, c-format
msgid "excluding %s\n"
msgstr ""
-#: ../lib/transaction.c:472
+#: ../lib/transaction.c:470
#, c-format
msgid "%s skipped due to missingok flag\n"
msgstr ""