From: jbj Date: Tue, 30 Nov 1999 14:49:45 +0000 (+0000) Subject: lib/install.c: Check errno and mkdir specdir/sourcedir only for local fs. X-Git-Tag: tznext/4.11.0.1.tizen20130304~8707 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e56943831a57ab9cc00182007ee55c6fc46ba1e;p=tools%2Flibrpm-tizen.git lib/install.c: Check errno and mkdir specdir/sourcedir only for local fs. lib/rpmio.c: Create ftpOpen/httpOpen from ufdOpen case's. lib/rpmio.c: ftpStat et al uses ftpOpen and NLST w/o path. lib/query.c: Don't Fclose(fd) if fd == NULL. CVS patchset: 3442 CVS date: 1999/11/30 14:49:45 --- diff --git a/lib/install.c b/lib/install.c index e2835b5..f965e7e 100644 --- a/lib/install.c +++ b/lib/install.c @@ -92,8 +92,8 @@ static void freeFileMemory( /*@only@*/ struct fileMemory *fileMem) } /* files should not be preallocated */ -static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr, - /*@out@*/ int * fileCountPtr, /*@out@*/ struct fileInfo ** filesPtr, +static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr, + /*@out@*/ int * fileCountPtr, /*@out@*/ struct fileInfo ** filesPtr, int stripPrefixLength, enum fileActions * actions) { uint_32 * fileFlags; @@ -107,7 +107,7 @@ static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr, *memPtr = mem; - if (!headerIsEntry(h, RPMTAG_COMPFILELIST)) return 0; + if (!headerIsEntry(h, RPMTAG_COMPFILELIST)) return 0; buildFileList(h, &mem->names, fileCountPtr); @@ -120,7 +120,7 @@ static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr, fileCount = *fileCountPtr; files = *filesPtr = mem->files = xcalloc(fileCount, sizeof(*mem->files)); - + headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); headerGetEntry(h, RPMTAG_FILEMODES, NULL, (void **) &fileModes, NULL); headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, NULL); @@ -157,7 +157,7 @@ static void setFileOwners(Header h, struct fileInfo * files, int fileCount) for (i = 0; i < fileCount; i++) { if (unameToUid(fileOwners[i], &files[i].uid)) { - rpmError(RPMERR_NOUSER, _("user %s does not exist - using root"), + rpmError(RPMERR_NOUSER, _("user %s does not exist - using root"), fileOwners[i]); files[i].uid = 0; /* turn off the suid bit */ @@ -165,7 +165,7 @@ static void setFileOwners(Header h, struct fileInfo * files, int fileCount) } if (gnameToGid(fileGroups[i], &files[i].gid)) { - rpmError(RPMERR_NOGROUP, _("group %s does not exist - using root"), + rpmError(RPMERR_NOGROUP, _("group %s does not exist - using root"), fileGroups[i]); files[i].gid = 0; /* turn off the sgid bit */ @@ -210,17 +210,17 @@ static void trimChangelog(Header h) return; } - if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, + if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count) || count < numToKeep) return; headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count); headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count); - headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, + headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, numToKeep); - headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, + headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, numToKeep); - headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, + headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, numToKeep); free(names); @@ -253,13 +253,13 @@ static int markReplacedFiles(rpmdb db, struct sharedFileInfo * replList) headerFree(sh); } - headerGetEntry(secHeader, RPMTAG_FILESTATES, &type, + headerGetEntry(secHeader, RPMTAG_FILESTATES, &type, (void **) &secStates, &count); } /* by now, secHeader is the right header to modify, secStates is the right states list to modify */ - + secStates[fileInfo->otherFileNum] = RPMFILE_STATE_REPLACED; } @@ -280,20 +280,20 @@ static void callback(struct cpioCallbackInfo * cpioInfo, void * data) if (ourInfo->notify) (void)ourInfo->notify(ourInfo->h, RPMCALLBACK_INST_PROGRESS, - cpioInfo->bytesProcessed, - ourInfo->archiveSize, ourInfo->pkgKey, + cpioInfo->bytesProcessed, + ourInfo->archiveSize, ourInfo->pkgKey, ourInfo->notifyData); if (ourInfo->specFilePtr) { chptr = cpioInfo->file + strlen(cpioInfo->file) - 5; - if (!strcmp(chptr, ".spec")) + if (!strcmp(chptr, ".spec")) *ourInfo->specFilePtr = xstrdup(cpioInfo->file); } } /* NULL files means install all files */ static int installArchive(FD_t fd, struct fileInfo * files, - int fileCount, rpmCallbackFunction notify, + int fileCount, rpmCallbackFunction notify, void * notifyData, const void * pkgKey, Header h, /*@out@*/const char ** specFile, int archiveSize) { @@ -336,7 +336,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, map[mappedFiles].finalMode = files[i].mode; map[mappedFiles].finalUid = files[i].uid; map[mappedFiles].finalGid = files[i].gid; - map[mappedFiles].mapFlags = CPIO_MAP_PATH | CPIO_MAP_MODE | + map[mappedFiles].mapFlags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID; mappedFiles++; } @@ -345,13 +345,13 @@ static int installArchive(FD_t fd, struct fileInfo * files, } if (notify) - (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, + (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, notifyData); (void) Fflush(fd); cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio"); - rc = cpioInstallArchive(cfd, map, mappedFiles, - ((notify && archiveSize) || specFile) ? callback : NULL, + rc = cpioInstallArchive(cfd, map, mappedFiles, + ((notify && archiveSize) || specFile) ? callback : NULL, &info, &failedFile); Fclose(cfd); headerFree(info.h); @@ -359,7 +359,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, if (rc) { /* this would probably be a good place to check if disk space was used up - if so, we should return a different error */ - rpmError(RPMERR_CPIO, _("unpacking of archive failed%s%s: %s"), + rpmError(RPMERR_CPIO, _("unpacking of archive failed%s%s: %s"), (failedFile != NULL ? _(" on file ") : ""), (failedFile != NULL ? failedFile : ""), cpioStrerror(rc)); @@ -383,7 +383,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, /* 0 success */ /* 1 bad magic */ /* 2 error */ -static int installSources(Header h, const char * rootdir, FD_t fd, +static int installSources(Header h, const char * rootdir, FD_t fd, const char ** specFilePtr, rpmCallbackFunction notify, void * notifyData) { @@ -407,18 +407,25 @@ static int installSources(Header h, const char * rootdir, FD_t fd, realSourceDir = rpmGenPath(rootdir, "%{_sourcedir}", ""); if ((rc = Stat(realSourceDir, &st)) < 0) { - switch (errno) { - case ENOENT: - /* XXX this will only create last component of directory path */ - if (Mkdir(realSourceDir, 0755) == 0) + int ut = urlPath(realSourceDir, NULL); + switch (ut) { + case URL_IS_PATH: + case URL_IS_UNKNOWN: + if (errno != ENOENT) break; /*@fallthrough@*/ - default: - rpmError(RPMERR_CREATE, _("cannot create %s: %s"), - realSourceDir, strerror(errno)); + case URL_IS_FTP: + case URL_IS_HTTP: + /* XXX this will only create last component of directory path */ + rc = Mkdir(realSourceDir, 0755); + break; + case URL_IS_DASH: + break; + } + if (rc < 0) { + rpmError(RPMERR_CREATE, _("cannot create sourcedir %s"), realSourceDir); rc = 2; goto exit; - /*@notreached@*/ break; } } if ((rc = Access(realSourceDir, W_OK))) { @@ -430,17 +437,25 @@ static int installSources(Header h, const char * rootdir, FD_t fd, realSpecDir = rpmGenPath(rootdir, "%{_specdir}", ""); if ((rc = Stat(realSpecDir, &st)) < 0) { - switch (errno) { - case ENOENT: - /* XXX this will only create last component of directory path */ - if (mkdir(realSpecDir, 0755) == 0) + int ut = urlPath(realSpecDir, NULL); + switch (ut) { + case URL_IS_PATH: + case URL_IS_UNKNOWN: + if (errno != ENOENT) break; /*@fallthrough@*/ - default: - rpmError(RPMERR_CREATE, _("cannot create %s"), realSpecDir); + case URL_IS_FTP: + case URL_IS_HTTP: + /* XXX this will only create last component of directory path */ + rc = Mkdir(realSpecDir, 0755); + break; + case URL_IS_DASH: + break; + } + if (rc < 0) { + rpmError(RPMERR_CREATE, _("cannot create specdir %s"), realSpecDir); rc = 2; goto exit; - /*@notreached@*/ break; } } if ((rc = Access(realSpecDir, W_OK))) { @@ -474,7 +489,7 @@ static int installSources(Header h, const char * rootdir, FD_t fd, } if (i < fileCount) { - char *t = alloca(strlen(realSpecDir) + + char *t = alloca(strlen(realSpecDir) + strlen(files[i].cpioPath) + 5); strcpy(t, realSpecDir); strcat(t, "/"); @@ -501,7 +516,7 @@ static int installSources(Header h, const char * rootdir, FD_t fd, chdir(realSourceDir); if (installArchive(fd, fileCount > 0 ? files : NULL, fileCount, notify, notifyData, NULL, h, - specFileIndex >=0 ? NULL : &specFile, + specFileIndex >=0 ? NULL : &specFile, archiveSizePtr ? *archiveSizePtr : 0)) { rc = 2; goto exit; @@ -531,7 +546,7 @@ static int installSources(Header h, const char * rootdir, FD_t fd, xfree(specFile); if (strcmp(instSpecFile, correctSpecFile)) { - rpmMessage(RPMMESS_DEBUG, + rpmMessage(RPMMESS_DEBUG, _("renaming %s to %s\n"), instSpecFile, correctSpecFile); if ((rc = Rename(instSpecFile, correctSpecFile))) { rpmError(RPMERR_RENAME, _("rename of %s to %s failed: %s"), @@ -565,13 +580,13 @@ int rpmVersionCompare(Header first, Header second) if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (void **) &epochOne, NULL)) epochOne = NULL; - if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo, + if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo, NULL)) epochTwo = NULL; - if (epochOne && !epochTwo) + if (epochOne && !epochTwo) return 1; - else if (!epochOne && epochTwo) + else if (!epochOne && epochTwo) return -1; else if (epochOne && epochTwo) { if (*epochOne < *epochTwo) @@ -579,7 +594,7 @@ int rpmVersionCompare(Header first, Header second) else if (*epochOne > *epochTwo) return 1; } - + headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); @@ -589,7 +604,7 @@ int rpmVersionCompare(Header first, Header second) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); - + return rpmvercmp(one, two); } @@ -613,8 +628,8 @@ const char *const fileActionString(enum fileActions a) /* 0 success */ /* 1 bad magic */ /* 2 error */ -int rpmInstallSourcePackage(const char * rootdir, FD_t fd, - const char ** specFile, rpmCallbackFunction notify, +int rpmInstallSourcePackage(const char * rootdir, FD_t fd, + const char ** specFile, rpmCallbackFunction notify, void * notifyData, char ** cookie) { int rc, isSource; @@ -645,12 +660,12 @@ int rpmInstallSourcePackage(const char * rootdir, FD_t fd, } rpmInstallLoadMacros(h); - + rc = installSources(h, rootdir, fd, specFile, notify, notifyData); if (h != NULL) { headerFree(h); } - + return rc; } @@ -658,9 +673,9 @@ int rpmInstallSourcePackage(const char * rootdir, FD_t fd, /* 1 bad magic */ /* 2 error */ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, - int flags, rpmCallbackFunction notify, - void * notifyData, const void * pkgKey, - enum fileActions * actions, + int flags, rpmCallbackFunction notify, + void * notifyData, const void * pkgKey, + enum fileActions * actions, struct sharedFileInfo * sharedList, FD_t scriptFd) { int rc; @@ -682,7 +697,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, headerNVR(h, &name, &version, &release); - rpmMessage(RPMMESS_DEBUG, _("package: %s-%s-%s files test = %d\n"), + rpmMessage(RPMMESS_DEBUG, _("package: %s-%s-%s files test = %d\n"), name, version, release, flags & RPMTRANS_FLAG_TEST); rc = rpmdbFindPackage(db, name, &matches); @@ -724,7 +739,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, if (!(flags & RPMTRANS_FLAG_JUSTDB) && headerIsEntry(h, RPMTAG_COMPFILELIST)) { const char * defaultPrefix; /* old format relocateable packages need the entire default - prefix stripped to form the cpio list, while all other packages + prefix stripped to form the cpio list, while all other packages need the leading / stripped */ if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &defaultPrefix, NULL)) { @@ -741,7 +756,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, } else { files = NULL; } - + if (flags & RPMTRANS_FLAG_TEST) { rpmMessage(RPMMESS_DEBUG, _("stopping install as we're running --test\n")); rc = 0; @@ -749,7 +764,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, } rpmMessage(RPMMESS_DEBUG, _("running preinstall script (if any)\n")); - if (runInstScript("/", h, RPMTAG_PREIN, RPMTAG_PREINPROG, scriptArg, + if (runInstScript("/", h, RPMTAG_PREIN, RPMTAG_PREINPROG, scriptArg, flags & RPMTRANS_FLAG_NOSCRIPTS, scriptFd)) { rc = 2; goto exit; @@ -809,7 +824,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, newpath = alloca(strlen(files[i].relativePath) + 20); strcpy(newpath, files[i].relativePath); strcat(newpath, ext); - rpmError(RPMMESS_BACKUP, _("warning: %s saved as %s"), + rpmError(RPMMESS_BACKUP, _("warning: %s saved as %s"), files[i].relativePath, newpath); if (rename(files[i].relativePath, newpath)) { @@ -823,7 +838,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, { uint_32 * archiveSizePtr; - if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, &type, + if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, &type, (void **) &archiveSizePtr, &count)) archiveSizePtr = NULL; @@ -844,7 +859,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, for (i = 0; i < fileCount; i++) fileStates[i] = files[i].state; - headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates, + headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates, fileCount); free(fileStates); @@ -854,7 +869,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, if (headerGetEntry(h, RPMTAG_COMPFILELIST, NULL, NULL, &fileCount)) { fileStates = xmalloc(sizeof(*fileStates) * fileCount); memset(fileStates, RPMFILE_STATE_NORMAL, fileCount); - headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates, + headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates, fileCount); free(fileStates); } @@ -906,7 +921,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, } } - if (sharedList) + if (sharedList) markReplacedFiles(db, sharedList); rc = 0; diff --git a/lib/query.c b/lib/query.c index 7d552e2..ee7cf4f 100644 --- a/lib/query.c +++ b/lib/query.c @@ -471,7 +471,8 @@ int rpmQueryVerify(QVA_t *qva, enum rpmQVSources source, const char * arg, #else Fstrerror(fd)); #endif - Fclose(fd); + if (fd) + Fclose(fd); retcode = 1; break; } diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 89ea954..28ee091 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -137,6 +137,7 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; #define RPMTAG_AUTOPROV 1104 /* internal */ #define RPMTAG_CAPABILITY 1105 #define RPMTAG_SOURCEPACKAGE 1106 /* internal */ +#define RPMTAG_OLDORIGFILENAMES 1107 /* obsolete */ #define RPMTAG_BUILDPREREQ 1108 /* internal */ #define RPMTAG_BUILDREQUIRES 1109 /* internal */ #define RPMTAG_BUILDCONFLICTS 1110 /* internal */ diff --git a/po/rpm.pot b/po/rpm.pot index 22ec1ea..34a536a 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-29 09:36-0500\n" +"POT-Creation-Date: 1999-11-30 09:22-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,59 +65,59 @@ msgstr "" msgid "Building for target %s\n" msgstr "" -#: build.c:344 +#: build.c:346 msgid "buildroot already specified" msgstr "" -#: build.c:351 +#: build.c:353 msgid "--buildarch has been obsoleted. Use the --target option instead.\n" msgstr "" -#: build.c:355 +#: build.c:357 msgid "--buildos has been obsoleted. Use the --target option instead.\n" msgstr "" -#: build.c:376 +#: build.c:378 msgid "override build architecture" msgstr "" -#: build.c:378 +#: build.c:380 msgid "override build operating system" msgstr "" -#: build.c:380 +#: build.c:382 msgid "override build root" msgstr "" -#: build.c:382 rpm.c:493 +#: build.c:384 rpm.c:493 msgid "remove build tree when done" msgstr "" -#: build.c:384 +#: build.c:386 msgid "do not execute any stages of the build" msgstr "" -#: build.c:386 +#: build.c:388 msgid "do not accept I18N msgstr's from specfile" msgstr "" -#: build.c:388 +#: build.c:390 msgid "remove sources when done" msgstr "" -#: build.c:390 +#: build.c:392 msgid "remove specfile when done" msgstr "" -#: build.c:392 rpm.c:491 +#: build.c:394 rpm.c:491 msgid "skip straight to specified stage (only for c,i)" msgstr "" -#: build.c:394 +#: build.c:396 msgid "override target platform" msgstr "" -#: build.c:396 +#: build.c:398 msgid "lookup I18N strings in specfile catalog" msgstr "" @@ -2229,73 +2229,73 @@ msgstr "" msgid "installing a source package\n" msgstr "" -#: lib/install.c:417 +#: lib/install.c:416 #, c-format -msgid "cannot create %s: %s" +msgid "cannot create sourcedir %s" msgstr "" -#: lib/install.c:425 lib/install.c:447 +#: lib/install.c:422 lib/install.c:442 #, c-format msgid "cannot write to %s" msgstr "" -#: lib/install.c:429 +#: lib/install.c:426 #, c-format msgid "sources in: %s\n" msgstr "" -#: lib/install.c:440 +#: lib/install.c:436 #, c-format -msgid "cannot create %s" +msgid "cannot create specdir %s" msgstr "" -#: lib/install.c:451 +#: lib/install.c:446 #, c-format msgid "spec file in: %s\n" msgstr "" -#: lib/install.c:485 lib/install.c:513 +#: lib/install.c:480 lib/install.c:508 msgid "source package contains no .spec file" msgstr "" -#: lib/install.c:535 +#: lib/install.c:530 #, c-format msgid "renaming %s to %s\n" msgstr "" -#: lib/install.c:537 lib/install.c:816 lib/uninstall.c:27 +#: lib/install.c:532 lib/install.c:811 lib/uninstall.c:27 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" -#: lib/install.c:628 +#: lib/install.c:623 msgid "source package expected, binary found" msgstr "" -#: lib/install.c:685 +#: lib/install.c:680 #, c-format msgid "package: %s-%s-%s files test = %d\n" msgstr "" -#: lib/install.c:746 +#: lib/install.c:741 msgid "stopping install as we're running --test\n" msgstr "" -#: lib/install.c:751 +#: lib/install.c:746 msgid "running preinstall script (if any)\n" msgstr "" -#: lib/install.c:776 +#: lib/install.c:771 #, c-format msgid "warning: %s created as %s" msgstr "" -#: lib/install.c:812 +#: lib/install.c:807 #, c-format msgid "warning: %s saved as %s" msgstr "" -#: lib/install.c:886 +#: lib/install.c:881 msgid "running postinstall scripts (if any)\n" msgstr "" @@ -2543,145 +2543,145 @@ msgstr "" msgid "open of %s failed: %s\n" msgstr "" -#: lib/query.c:486 +#: lib/query.c:487 msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:495 lib/rpminstall.c:227 +#: lib/query.c:496 lib/rpminstall.c:227 #, c-format msgid "%s does not appear to be a RPM package\n" msgstr "" -#: lib/query.c:498 +#: lib/query.c:499 #, c-format msgid "query of %s failed\n" msgstr "" -#: lib/query.c:526 +#: lib/query.c:527 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:551 +#: lib/query.c:552 msgid "could not read database record!\n" msgstr "" -#: lib/query.c:562 +#: lib/query.c:563 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:572 +#: lib/query.c:573 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:582 +#: lib/query.c:583 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:592 +#: lib/query.c:593 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:607 +#: lib/query.c:608 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:610 +#: lib/query.c:611 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:623 +#: lib/query.c:624 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:626 +#: lib/query.c:627 #, c-format msgid "package record number: %d\n" msgstr "" -#: lib/query.c:629 +#: lib/query.c:630 #, c-format msgid "record %d could not be read\n" msgstr "" -#: lib/query.c:641 lib/rpminstall.c:417 +#: lib/query.c:642 lib/rpminstall.c:417 #, c-format msgid "package %s is not installed\n" msgstr "" -#: lib/query.c:644 +#: lib/query.c:645 #, c-format msgid "error looking for package %s\n" msgstr "" -#: lib/query.c:666 +#: lib/query.c:667 msgid "rpmQuery: rpmdbOpen() failed\n" msgstr "" -#: lib/query.c:725 +#: lib/query.c:726 msgid "query package owning file" msgstr "" -#: lib/query.c:727 +#: lib/query.c:728 msgid "query packages in group" msgstr "" -#: lib/query.c:729 +#: lib/query.c:730 msgid "query a package file" msgstr "" -#: lib/query.c:733 +#: lib/query.c:734 msgid "query a spec file" msgstr "" -#: lib/query.c:735 +#: lib/query.c:736 msgid "query the pacakges triggered by the package" msgstr "" -#: lib/query.c:737 +#: lib/query.c:738 msgid "query the packages which require a capability" msgstr "" -#: lib/query.c:739 +#: lib/query.c:740 msgid "query the packages which provide a capability" msgstr "" -#: lib/query.c:778 +#: lib/query.c:779 msgid "list all configuration files" msgstr "" -#: lib/query.c:780 +#: lib/query.c:781 msgid "list all documentation files" msgstr "" -#: lib/query.c:782 +#: lib/query.c:783 msgid "dump basic file information" msgstr "" -#: lib/query.c:784 +#: lib/query.c:785 msgid "list files in package" msgstr "" -#: lib/query.c:788 +#: lib/query.c:789 msgid "use the following query format" msgstr "" -#: lib/query.c:790 +#: lib/query.c:791 msgid "substitute i18n sections from the following catalogue" msgstr "" -#: lib/query.c:793 +#: lib/query.c:794 msgid "display the states of the listed files" msgstr "" -#: lib/query.c:795 +#: lib/query.c:796 msgid "display a verbose file listing" msgstr "" @@ -3027,59 +3027,59 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmio.c:751 +#: lib/rpmio.c:750 msgid "Success" msgstr "" -#: lib/rpmio.c:754 +#: lib/rpmio.c:753 msgid "Bad server response" msgstr "" -#: lib/rpmio.c:757 +#: lib/rpmio.c:756 msgid "Server IO error" msgstr "" -#: lib/rpmio.c:760 +#: lib/rpmio.c:759 msgid "Server timeout" msgstr "" -#: lib/rpmio.c:763 +#: lib/rpmio.c:762 msgid "Unable to lookup server host address" msgstr "" -#: lib/rpmio.c:766 +#: lib/rpmio.c:765 msgid "Unable to lookup server host name" msgstr "" -#: lib/rpmio.c:769 +#: lib/rpmio.c:768 msgid "Failed to connect to server" msgstr "" -#: lib/rpmio.c:772 +#: lib/rpmio.c:771 msgid "Failed to establish data connection to server" msgstr "" -#: lib/rpmio.c:775 +#: lib/rpmio.c:774 msgid "IO error to local file" msgstr "" -#: lib/rpmio.c:778 +#: lib/rpmio.c:777 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/rpmio.c:781 +#: lib/rpmio.c:780 msgid "File not found on server" msgstr "" -#: lib/rpmio.c:784 +#: lib/rpmio.c:783 msgid "Abort in progress" msgstr "" -#: lib/rpmio.c:788 +#: lib/rpmio.c:787 msgid "Unknown or unexpected error" msgstr "" -#: lib/rpmio.c:1309 +#: lib/rpmio.c:1308 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" diff --git a/tools/dump.c b/tools/dump.c index 5012208..d3e866b 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -9,12 +9,12 @@ int main(int argc, char ** argv) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { - fdi = fdDup(STDIN_FILENO); + fdi = Fopen("-", "r.ufdio"); } else { fdi = Fopen(argv[1], "r.ufdio"); } - if (Ferror(fdi)) { + if (fdi == NULL || Ferror(fdi)) { fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno)); exit(EXIT_FAILURE); } diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c index 21856cc..e599b48 100644 --- a/tools/rpmarchive.c +++ b/tools/rpmarchive.c @@ -16,17 +16,21 @@ int main(int argc, char **argv) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { - fdi = fdDup(STDIN_FILENO); + fdi = Fopen("-", "r.ufdio"); } else { fdi = Fopen(argv[1], "r.ufdio"); } + if (fdi == NULL || Ferror(fdi)) { + perror("input"); + exit(EXIT_FAILURE); + } readLead(fdi, &lead); rpmReadSignature(fdi, NULL, lead.signature_type); hd = headerRead(fdi, (lead.major >= 3) ? HEADER_MAGIC_YES : HEADER_MAGIC_NO); - fdo = fdDup(STDOUT_FILENO); + fdo = Fopen("-", "w.ufdio"); while ((ct = Fread(buffer, sizeof(buffer), 1, fdi))) { Fwrite(buffer, ct, 1, fdo); } diff --git a/tools/rpmheader.c b/tools/rpmheader.c index 12aacde..39bf01a 100644 --- a/tools/rpmheader.c +++ b/tools/rpmheader.c @@ -15,20 +15,21 @@ int main(int argc, char **argv) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { - fdi = fdDup(STDIN_FILENO); + fdi = Fopen("-", "r.ufdio"); } else { fdi = Fopen(argv[1], "r.ufdio"); - if (Ferror(fdi)) { - perror(argv[1]); - exit(EXIT_FAILURE); - } + } + + if (fdi == NULL || Ferror(fdi)) { + perror("input"); + exit(EXIT_FAILURE); } readLead(fdi, &lead); rpmReadSignature(fdi, NULL, lead.signature_type); hd = headerRead(fdi, (lead.major >= 3) ? HEADER_MAGIC_YES : HEADER_MAGIC_NO); - fdo = fdDup(STDOUT_FILENO); + fdo = Fopen("-", "w.ufdio"); rc = headerWrite(fdo, hd, HEADER_MAGIC_YES); return rc; diff --git a/tools/rpmlead.c b/tools/rpmlead.c index 7b2a88d..4770ea1 100644 --- a/tools/rpmlead.c +++ b/tools/rpmlead.c @@ -12,17 +12,17 @@ int main(int argc, char **argv) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { - fdi = fdDup(STDIN_FILENO); + fdi = Fopen("-", "r.ufdio"); } else { fdi = Fopen(argv[1], "r.ufdio"); - if (Ferror(fdi)) { - perror(argv[1]); - exit(EXIT_FAILURE); - } + } + if (fdi == NULL || Ferror(fdi)) { + perror(argv[1]); + exit(EXIT_FAILURE); } readLead(fdi, &lead); - fdo = fdDup(STDOUT_FILENO); + fdo = Fopen("-", "w.ufdio"); writeLead(fdo, &lead); return 0; diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 50d6850..0723dff 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -13,13 +13,13 @@ int main(int argc, char **argv) setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { - fdi = fdDup(STDIN_FILENO); + fdi = Fopen("-", "r.ufdio"); } else { fdi = Fopen(argv[1], "r.ufdio"); - if (Ferror(fdi)) { - perror(argv[1]); - exit(1); - } + } + if (Ferror(fdi)) { + perror("input"); + exit(1); } readLead(fdi, &lead); @@ -29,7 +29,7 @@ int main(int argc, char **argv) fprintf(stderr, _("No signature available.\n")); break; default: - fdo = fdDup(STDOUT_FILENO); + fdo = Fopen("-", "w.ufdio"); rpmWriteSignature(fdo, sig); }