From: jbj Date: Wed, 24 Nov 1999 16:16:17 +0000 (+0000) Subject: build/files.c: Remove dead code. X-Git-Tag: tznext/4.11.0.1.tizen20130304~8716 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5144525bbc1936f7e0288718a7614ffa1c6ca63b;p=tools%2Flibrpm-tizen.git build/files.c: Remove dead code. lib/cpio.c: Open file to be installed with "w" not "r+". lib/fprint.c: Use variable length string keys for rpmdbFindByFile cache. CVS patchset: 3433 CVS date: 1999/11/24 16:16:17 --- diff --git a/build/files.c b/build/files.c index 8d9d2b9..87b1db1 100644 --- a/build/files.c +++ b/build/files.c @@ -932,26 +932,7 @@ static int addFile(struct FileList *fl, const char * diskURL, struct stat *statp const char *fileGname; char *lang; -if (_debug) -fprintf(stderr, "*** AF ENTRY buildRootURL %s fileURL %s diskURL %s\n", fl->buildRootURL, fileURL, diskURL); /* Path may have prepended buildRootURL, so locate the original filename. */ -#ifdef DYING - { const char *s; - char c; - - if ((s = fl->buildRootURL) != NULL) { - c = '\0'; - while (*s) { - if (c == '/' && !(s[0] == '/' && s[1] == ':')) - while(*s && *s == '/') s++; - if (*s) { - fileURL++; - c = *s++; - } - } - } - } -#else /* * XXX There are 3 types of entry into addFile: * @@ -967,9 +948,6 @@ fprintf(stderr, "*** AF ENTRY buildRootURL %s fileURL %s diskURL %s\n", fl->buil if (fl->buildRootURL && strcmp(fl->buildRootURL, "/")) fileURL += strlen(fl->buildRootURL); } -#endif -if (_debug) -fprintf(stderr, "*** AF STRIP buildRootURL %s fileURL %s diskURL %s\n", fl->buildRootURL, fileURL, diskURL); /* If we are using a prefix, validate the file */ if (!fl->inFtw && fl->prefix) { @@ -1137,46 +1115,14 @@ fprintf(stderr, "*** PBF fileURL %s\n", fileURL); } /* Copy file name or glob pattern removing multiple "/" chars. */ -#ifdef DYING - { const char *s; - char c, *t = alloca((fl->buildRootURL ? strlen(fl->buildRootURL) : 0) + - strlen(fileURL) + 1); - - fn = t; - *t = c = '\0'; - - /* With a buildroot, prepend the buildRootURL now. */ - if ((s = fl->buildRootURL) != NULL) { - while (*s) { - if (c == '/' && !(s[0] == '/' && s[1] == ':')) - while(*s && *s == '/') s++; - if (*s) - *t++ = c = *s++; - } - while (t > fn && t[-1] == '/') t--; - *t = '\0'; - } - if ((s = fileName) != NULL) { - while (*s) { - if (c == '/' && !(s[0] == '/' && s[1] == ':')) - while(*s && *s == '/') s++; - if (*s) - *t++ = c = *s++; - } - while (t > fn && t[-1] == '/') t--; - *t = '\0'; - } - } -#else /* * Note: rpmGetPath should guarantee a "canonical" path. That means * that the following pathologies should be weeded out: * //bin//sh * //usr//bin/ - * /.././../usr/../bin//./sh (XXX FIXME: dots not handled yet) + * /.././../usr/../bin//./sh */ diskURL = rpmGenPath(fl->buildRootURL, NULL, fileURL); -#endif if (doGlob) { const char * diskRoot; diff --git a/lib/cpio.c b/lib/cpio.c index 48b22fc..2f5f676 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -341,8 +341,8 @@ static int expandRegular(FD_t cfd, struct cpioHeader * hdr, } } - ofd = Fopen(hdr->path, "r+.ufdio"); - if (ofd == NULL || Ferror(ofd)) + ofd = Fopen(hdr->path, "w.ufdio"); + if (ofd == NULL || Ferror(ofd)) return CPIOERR_OPEN_FAILED; cbInfo.file = hdr->path; diff --git a/lib/fprint.c b/lib/fprint.c index 41d91a7..73cde45 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -8,7 +8,7 @@ fingerPrintCache fpCacheCreate(int sizeHint) fingerPrintCache fpc; fpc = xmalloc(sizeof(*fpc)); - fpc->ht = htCreate(sizeHint * 2, sizeof(char *), 1, hashFunctionString, + fpc->ht = htCreate(sizeHint * 2, 0, 1, hashFunctionString, hashEqualityString); return fpc; } diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 08436b7..e76e604 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -399,7 +399,7 @@ int rpmdbFindByFile(rpmdb db, const char * filespec, dbiIndexSet * matches) strcat(otherFile, baseNames[num]); fp2 = fpLookup(fpc, otherFile, 1); - if (FP_EQUAL(fp1, fp2)) + if (FP_EQUAL(fp1, fp2)) dbiAppendIndexRecord(matches, allMatches.recs[i]); free(otherFile); diff --git a/po/rpm.pot b/po/rpm.pot index 04cbeaf..0c9c023 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-11-23 18:43-0500\n" +"POT-Creation-Date: 1999-11-24 11:06-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1382,82 +1382,82 @@ msgstr "" msgid "File listed twice: %s" msgstr "" -#: build/files.c:987 +#: build/files.c:965 #, c-format msgid "File doesn't match prefix (%s): %s" msgstr "" -#: build/files.c:997 +#: build/files.c:975 #, c-format msgid "File not found: %s" msgstr "" -#: build/files.c:1040 +#: build/files.c:1018 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: build/files.c:1054 +#: build/files.c:1032 #, c-format msgid "File %4d: %07o %s.%s\t %s\n" msgstr "" -#: build/files.c:1133 +#: build/files.c:1111 #, c-format msgid "File needs leading \"/\": %s" msgstr "" -#: build/files.c:1194 +#: build/files.c:1140 #, c-format msgid "File not found by glob: %s" msgstr "" -#: build/files.c:1273 +#: build/files.c:1219 msgid "Could not open %%files file %s: %s" msgstr "" -#: build/files.c:1280 build/pack.c:480 +#: build/files.c:1226 build/pack.c:480 #, c-format msgid "line: %s" msgstr "" -#: build/files.c:1623 build/parsePrep.c:30 +#: build/files.c:1569 build/parsePrep.c:30 #, c-format msgid "Bad owner/group: %s" msgstr "" #. XXX this error message is probably not seen. -#: build/files.c:1678 +#: build/files.c:1624 #, c-format msgid "Couldn't exec %s: %s" msgstr "" -#: build/files.c:1683 +#: build/files.c:1629 #, c-format msgid "Couldn't fork %s: %s" msgstr "" -#: build/files.c:1765 +#: build/files.c:1711 #, c-format msgid "%s failed" msgstr "" -#: build/files.c:1769 +#: build/files.c:1715 #, c-format msgid "failed to write all data to %s" msgstr "" -#: build/files.c:1858 +#: build/files.c:1804 #, c-format msgid "Finding %s: (using %s)...\n" msgstr "" -#: build/files.c:1886 build/files.c:1895 +#: build/files.c:1832 build/files.c:1841 #, c-format msgid "Failed to find %s:" msgstr "" -#: build/files.c:2001 +#: build/files.c:1947 #, c-format msgid "Processing files: %s-%s-%s\n" msgstr "" @@ -1938,41 +1938,41 @@ msgstr "" msgid "can't unlink %s: %s\n" msgstr "" -#: lib/cpio.c:527 +#: lib/cpio.c:529 #, c-format msgid "getNextHeader: %s\n" msgstr "" -#: lib/cpio.c:992 +#: lib/cpio.c:996 #, c-format msgid "(error 0x%x)" msgstr "" -#: lib/cpio.c:995 +#: lib/cpio.c:999 msgid "Bad magic" msgstr "" -#: lib/cpio.c:996 +#: lib/cpio.c:1000 msgid "Bad/unreadable header" msgstr "" -#: lib/cpio.c:1014 +#: lib/cpio.c:1018 msgid "Header size too big" msgstr "" -#: lib/cpio.c:1015 +#: lib/cpio.c:1019 msgid "Unknown file type" msgstr "" -#: lib/cpio.c:1016 +#: lib/cpio.c:1020 msgid "Missing hard link" msgstr "" -#: lib/cpio.c:1017 +#: lib/cpio.c:1021 msgid "Internal error" msgstr "" -#: lib/cpio.c:1026 +#: lib/cpio.c:1030 msgid " failed - " msgstr "" @@ -2857,76 +2857,76 @@ msgid "" "database" msgstr "" -#: lib/rpmdb.c:462 +#: lib/rpmdb.c:471 #, c-format msgid "package %s not listed in %s" msgstr "" -#: lib/rpmdb.c:473 +#: lib/rpmdb.c:482 #, c-format msgid "package %s not found in %s" msgstr "" -#: lib/rpmdb.c:497 lib/uninstall.c:86 +#: lib/rpmdb.c:506 lib/uninstall.c:86 #, c-format msgid "cannot read header at %d for uninstall" msgstr "" -#: lib/rpmdb.c:505 +#: lib/rpmdb.c:514 msgid "package has no name" msgstr "" -#: lib/rpmdb.c:507 +#: lib/rpmdb.c:516 msgid "removing name index\n" msgstr "" -#: lib/rpmdb.c:512 +#: lib/rpmdb.c:521 msgid "package has no group\n" msgstr "" -#: lib/rpmdb.c:514 +#: lib/rpmdb.c:523 msgid "removing group index\n" msgstr "" -#: lib/rpmdb.c:521 +#: lib/rpmdb.c:530 #, c-format msgid "removing provides index for %s\n" msgstr "" -#: lib/rpmdb.c:536 +#: lib/rpmdb.c:545 #, c-format msgid "removing requiredby index for %s\n" msgstr "" -#: lib/rpmdb.c:548 +#: lib/rpmdb.c:557 #, c-format msgid "removing trigger index for %s\n" msgstr "" -#: lib/rpmdb.c:559 +#: lib/rpmdb.c:568 #, c-format msgid "removing conflict index for %s\n" msgstr "" -#: lib/rpmdb.c:570 +#: lib/rpmdb.c:579 #, c-format msgid "removing file index for %s\n" msgstr "" -#: lib/rpmdb.c:579 +#: lib/rpmdb.c:588 msgid "package has no files\n" msgstr "" -#: lib/rpmdb.c:662 +#: lib/rpmdb.c:671 msgid "cannot allocate space for database" msgstr "" -#: lib/rpmdb.c:721 +#: lib/rpmdb.c:730 #, c-format msgid "cannot read header at %d for update" msgstr "" -#: lib/rpmdb.c:730 +#: lib/rpmdb.c:739 msgid "header changed size!" msgstr "" @@ -3027,59 +3027,59 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmio.c:686 +#: lib/rpmio.c:679 msgid "Success" msgstr "" -#: lib/rpmio.c:689 +#: lib/rpmio.c:682 msgid "Bad server response" msgstr "" -#: lib/rpmio.c:692 +#: lib/rpmio.c:685 msgid "Server IO error" msgstr "" -#: lib/rpmio.c:695 +#: lib/rpmio.c:688 msgid "Server timeout" msgstr "" -#: lib/rpmio.c:698 +#: lib/rpmio.c:691 msgid "Unable to lookup server host address" msgstr "" -#: lib/rpmio.c:701 +#: lib/rpmio.c:694 msgid "Unable to lookup server host name" msgstr "" -#: lib/rpmio.c:704 +#: lib/rpmio.c:697 msgid "Failed to connect to server" msgstr "" -#: lib/rpmio.c:707 +#: lib/rpmio.c:700 msgid "Failed to establish data connection to server" msgstr "" -#: lib/rpmio.c:710 +#: lib/rpmio.c:703 msgid "IO error to local file" msgstr "" -#: lib/rpmio.c:713 +#: lib/rpmio.c:706 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/rpmio.c:716 +#: lib/rpmio.c:709 msgid "File not found on server" msgstr "" -#: lib/rpmio.c:719 +#: lib/rpmio.c:712 msgid "Abort in progress" msgstr "" -#: lib/rpmio.c:723 +#: lib/rpmio.c:716 msgid "Unknown or unexpected error" msgstr "" -#: lib/rpmio.c:1244 +#: lib/rpmio.c:1237 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr ""