From 3363604c7076329e431afdc975f205b54f088631 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 4 Nov 1999 21:26:08 +0000 Subject: [PATCH] Use Fopen almost everywhere. Rip out --enable-bzip2-payload, we'll use Fopen w macros instead. Work out ref counting for ftpControl so that control channel is persistent. build/build.c: Use fpio to write build stage script. parseSpec.c: Rework include stack to use FD_t, not FILE *. tread.c: Delete, use ufdio->read instead. rpmio.c: Filter out fdio fd == NULL assertion failures. rpmrc.c: Don't fail if HOME is not environment. rpmrc.c: Rework ufdio FTP rcfile I/O to be more similar to stdio. CVS patchset: 3417 CVS date: 1999/11/04 21:26:08 --- build.c | 2 +- build/build.c | 22 +++---- build/pack.c | 50 ++------------- build/parsePreamble.c | 2 +- build/parseSpec.c | 10 +-- build/rpmspec.h | 2 +- build/spec.c | 2 +- configure.in | 9 --- lib/Makefile.am | 2 +- lib/cpio.c | 5 +- lib/ftp.c | 17 +++-- lib/header.c | 4 +- lib/install.c | 4 -- lib/oldheader.c | 4 +- lib/query.c | 2 +- lib/rpminstall.c | 8 +-- lib/rpmio.h | 9 ++- lib/rpmlead.c | 2 +- lib/rpmrc.c | 173 ++++++++++++++++++++++++++++---------------------- lib/signature.c | 8 +-- lib/tread.c | 38 ----------- lib/uninstall.c | 2 +- lib/url.c | 11 ++-- po/POTFILES.in | 1 - po/rpm.pot | 161 +++++++++++++++++++++++----------------------- python/rpmmodule.c | 2 +- rpm2cpio.c | 2 +- tools/dump.c | 2 +- tools/rpmarchive.c | 2 +- tools/rpmgettext.c | 2 +- tools/rpmheader.c | 2 +- tools/rpmlead.c | 2 +- tools/rpmsignature.c | 2 +- 33 files changed, 251 insertions(+), 315 deletions(-) delete mode 100644 lib/tread.c diff --git a/build.c b/build.c index 1bd0901..2bfebb0 100644 --- a/build.c +++ b/build.c @@ -59,7 +59,7 @@ static int isSpecFile(const char *specfile) int count; int checking; - fd = ufdio->open(specfile, O_RDONLY, 0); + fd = Fopen(specfile, "r.ufdio"); if (Ferror(fd)) { /* XXX Fstrerror */ fprintf(stderr, _("Unable to open spec file: %s\n"), specfile); diff --git a/build/build.c b/build/build.c index 91f2b03..a40d696 100644 --- a/build/build.c +++ b/build/build.c @@ -45,7 +45,7 @@ static char *_preScriptChdir = int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) { FD_t fd; - FILE *f; + FD_t xfd; const char *scriptName; int pid; int status; @@ -85,34 +85,34 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) return RPMERR_SCRIPT; } #ifdef HAVE_FCHMOD - (void)fchmod(Fileno(fd), 0600); + (void)fchmod(Fileno(fd), 0600); /* XXX fubar on ufdio */ #endif - f = fdFdopen(fd, "w"); + xfd = Fdopen(fd, "w.fdio"); strcpy(buf, _preScriptEnvironment); expandMacros(spec, spec->macros, buf, sizeof(buf)); strcat(buf, "\n"); - fputs(buf, f); + fputs(buf, fpio->ffileno(xfd)); - fprintf(f, rpmIsVerbose() ? "set -x\n\n" : "exec > /dev/null\n\n"); + fprintf(fpio->ffileno(xfd), rpmIsVerbose() ? "set -x\n\n" : "exec > /dev/null\n\n"); /* XXX umask 022; cd %{_builddir} */ strcpy(buf, _preScriptChdir); expandMacros(spec, spec->macros, buf, sizeof(buf)); - fputs(buf, f); + fputs(buf, fpio->ffileno(xfd)); if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD) { if (spec->buildSubdir) - fprintf(f, "cd %s\n", spec->buildSubdir); + fprintf(fpio->ffileno(xfd), "cd %s\n", spec->buildSubdir); } if (what == RPMBUILD_RMBUILD) { if (spec->buildSubdir) - fprintf(f, "rm -rf %s\n", spec->buildSubdir); + fprintf(fpio->ffileno(xfd), "rm -rf %s\n", spec->buildSubdir); } else - fprintf(f, "%s", getStringBuf(sb)); - fprintf(f, "\nexit 0\n"); + fprintf(fpio->ffileno(xfd), "%s", getStringBuf(sb)); + fprintf(fpio->ffileno(xfd), "\nexit 0\n"); - fclose(f); + Fclose(xfd); if (test) { FREE(scriptName); diff --git a/build/pack.c b/build/pack.c index 7e734de..5ac6507 100644 --- a/build/pack.c +++ b/build/pack.c @@ -14,11 +14,7 @@ static StringBuf addFileToTagAux(Spec spec, char *file, StringBuf sb); static int addFileToTag(Spec spec, char *file, Header h, int tag); static int addFileToArrayTag(Spec spec, char *file, Header h, int tag); -#if ENABLE_BZIP2_PAYLOAD -static int cpio_bzip2(FD_t fdo, CSA_t *csa); -#endif /* ENABLE_BZIP2_PAYLOAD */ - -static int cpio_gzip(FD_t fdo, CSA_t *csa); +static int cpio_doio(FD_t fdo, CSA_t *csa, const char * fmode); static int cpio_copy(FD_t fdo, CSA_t *csa); static inline int genSourceRpmName(Spec spec) @@ -183,7 +179,7 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sig int rc; if (fileName != NULL) { - fdi = fdio->open(fileName, O_RDONLY, 0644); + fdi = Fopen(fileName, "r.fdio"); if (Ferror(fdi)) { /* XXX Fstrerror */ rpmError(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"), fileName, @@ -276,7 +272,7 @@ int writeRPM(Header h, const char *fileName, int type, rc = RPMERR_NOSPACE; } else { /* Write the archive and get the size */ if (csa->cpioList != NULL) { - rc = cpio_gzip(fd, csa); + rc = cpio_doio(fd, csa, "w9.gzdio"); } else if (Fileno(csa->cpioFdIn) >= 0) { rc = cpio_copy(fd, csa); } else { @@ -312,7 +308,7 @@ int writeRPM(Header h, const char *fileName, int type, } /* Open the output file */ - fd = fdio->open(fileName, O_WRONLY|O_CREAT|O_TRUNC, 0644); + fd = Fopen(fileName, "w.fdio"); if (Ferror(fd)) { /* XXX Fstrerror */ rpmError(RPMERR_CREATE, _("Could not open %s\n"), fileName); @@ -376,7 +372,7 @@ int writeRPM(Header h, const char *fileName, int type, rpmFreeSignature(sig); /* Append the header and archive */ - ifd = fdio->open(sigtarget, O_RDONLY, 0); + ifd = Fopen(sigtarget, "r.fdio"); while ((count = Fread(buf, sizeof(buf), 1, ifd)) > 0) { if (count == -1) { rpmError(RPMERR_READERROR, _("Unable to read sigtarget: %s"), @@ -409,45 +405,13 @@ int writeRPM(Header h, const char *fileName, int type, return 0; } -#if ENABLE_BZIP2_PAYLOAD -static int cpio_bzip2(FD_t fdo, CSA_t *csa) -{ - FD_t cfd; - int rc; - const char *failedFile = NULL; - -#if 0 - cfd = bzdFdopen(fdDup(Fileno(fdo)), "w9"); -#else - cfd = Fdopen(fdDup(Fileno(fdo)), "w9.bzdio"); -#endif - rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, - &csa->cpioArchiveSize, &failedFile); - if (rc) { - rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s"), - failedFile, cpioStrerror(rc)); - rc = 1; - } - - Fclose(cfd); - if (failedFile) - xfree(failedFile); - - return rc; -} -#endif /* ENABLE_BZIP2_PAYLOAD */ - -static int cpio_gzip(FD_t fdo, CSA_t *csa) +static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmode) { FD_t cfd; int rc; const char *failedFile = NULL; -#if 0 - cfd = gzdFdopen(fdDup(Fileno(fdo)), "w9"); -#else - cfd = Fdopen(fdDup(Fileno(fdo)), "w9.gzdio"); -#endif + cfd = Fdopen(fdDup(Fileno(fdo)), fmode); rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, &csa->cpioArchiveSize, &failedFile); if (rc) { diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 55f7691..e0063ff 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -244,7 +244,7 @@ static int readIcon(Header h, const char *file) icon = xmalloc(statbuf.st_size); *icon = '\0'; - fd = fdio->open(fn, O_RDONLY, 0); + fd = Fopen(fn, "r.fdio"); /* XXX Fstrerror */ /* XXX Ferror check */ nb = Fread(icon, statbuf.st_size, 1, fd); diff --git a/build/parseSpec.c b/build/parseSpec.c index ccca6a2..adaae0b 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -168,8 +168,8 @@ int readLine(Spec spec, int strip) retry: /* Make sure the current file is open */ - if (ofi->file == NULL) { - if (!(ofi->file = Fopen(ofi->fileName, "r"))) { + if (ofi->fd == NULL) { + if ((ofi->fd = Fopen(ofi->fileName, "r.ufdio")) == NULL) { /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("Unable to open: %s\n"), ofi->fileName); @@ -180,7 +180,7 @@ retry: /* Make sure we have something in the read buffer */ if (!(ofi->readPtr && *(ofi->readPtr))) { - if (!fgets(ofi->readBuf, BUFSIZ, ofi->file)) { + if (!fgets(ofi->readBuf, BUFSIZ, fpio->ffileno(ofi->fd))) { /* EOF */ if (spec->readStack->next) { rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if")); @@ -189,7 +189,7 @@ retry: /* remove this file from the stack */ spec->fileStack = ofi->next; - fclose(ofi->file); + Fclose(ofi->fd); FREE(ofi->fileName); free(ofi); @@ -317,7 +317,7 @@ void closeSpec(Spec spec) while (spec->fileStack) { ofi = spec->fileStack; spec->fileStack = spec->fileStack->next; - if (ofi->file) fclose(ofi->file); + if (ofi->fd) Fclose(ofi->fd); FREE(ofi->fileName); free(ofi); } diff --git a/build/rpmspec.h b/build/rpmspec.h index 63d2544..060ed6a 100644 --- a/build/rpmspec.h +++ b/build/rpmspec.h @@ -44,7 +44,7 @@ typedef struct ReadLevelEntry { typedef struct OpenFileInfo { /*@only@*/ char *fileName; - /*@dependent@*/ FILE *file; + /*@dependent@*/ FD_t fd; int lineNum; char readBuf[BUFSIZ]; /*@dependent@*/ char *readPtr; diff --git a/build/spec.c b/build/spec.c index 2bfce9c..2e9270f 100644 --- a/build/spec.c +++ b/build/spec.c @@ -519,7 +519,7 @@ void freeSpec(/*@only@*/ Spec spec) struct OpenFileInfo *ofi; ofi = xmalloc(sizeof(struct OpenFileInfo)); - ofi->file = NULL; + ofi->fd = NULL; ofi->fileName = NULL; ofi->lineNum = 0; ofi->readBuf[0] = '\0'; diff --git a/configure.in b/configure.in index 577967b..d52c379 100644 --- a/configure.in +++ b/configure.in @@ -258,15 +258,6 @@ AC_ARG_ENABLE(v4-packages, AC_MSG_RESULT($with_v4_packages) test "$with_v4_packages" = yes && AC_DEFINE(ENABLE_V4_PACKAGES) -### use option --enable-bzip2-payload to turn on support for packages with bzip2 payloads -AC_MSG_CHECKING(if you want support for packages with bzip2 payloads) -AC_ARG_ENABLE(bzip2-payload, - [ --enable-bzip2-payload[=no] [experimental] support for packages with bzip2 paylaods], - [with_bzip2_payload=$enableval], - [with_bzip2_payload=no]) -AC_MSG_RESULT($with_bzip2_payload) -test "$with_bzip2_payload" = yes && AC_DEFINE(ENABLE_BZIP2_PAYLOAD) - dnl Checks for libraries. AC_CHECK_FUNC(strcasecmp, [], [ diff --git a/lib/Makefile.am b/lib/Makefile.am index 4b78b2c..de979e4 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -24,7 +24,7 @@ librpm_la_SOURCES = \ messages.c misc.c oldheader.c package.c problems.c query.c \ rebuilddb.c rpmchecksig.c rpmdb.c rpmerr.c rpminstall.c \ rpmio.c rpmlead.c rpmmalloc.c rpmrc.c signature.c stringbuf.c \ - tagName.c tagtable.c transaction.c tread.c uninstall.c url.c verify.c + tagName.c tagtable.c transaction.c uninstall.c url.c verify.c tagtable.c: rpmlib.h @echo '#include "system.h"' > tagtable.c diff --git a/lib/cpio.c b/lib/cpio.c index f979546..f45ce5f 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -341,7 +341,7 @@ static int expandRegular(FD_t cfd, struct cpioHeader * hdr, } } - ofd = fdio->open(hdr->path, O_CREAT | O_WRONLY, 0); + ofd = Fopen(hdr->path, "w.fdio"); /* XXX Fopen adds O_TRUNC */ if (Ferror(ofd)) return CPIOERR_OPEN_FAILED; @@ -746,7 +746,8 @@ static int writeFile(FD_t cfd, struct stat sb, struct cpioFileMapping * map, size_t nmapped; #endif - datafd = fdio->open(map->fsPath, O_RDONLY, 0); + /* XXX unbuffered mmap generates *lots* of fdio debugging */ + datafd = Fopen(map->fsPath, "r.fdio"); if (Ferror(datafd)) return CPIOERR_OPEN_FAILED; diff --git a/lib/ftp.c b/lib/ftp.c index 175b342..fe6597b 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -178,7 +178,7 @@ static int checkResponse(int fd, int secs, int *ecp, /*@out@*/ char ** str) { int ftpCheckResponse(urlinfo u, /*@out@*/ char ** str) { int ec = 0; - int rc = checkResponse(Fileno(u->ftpControl), ftpTimeoutSecs, &ec, str); + int rc = checkResponse(fdio->fileno(u->ftpControl), ftpTimeoutSecs, &ec, str); switch (ec) { case 550: @@ -379,11 +379,11 @@ int ftpOpen(urlinfo u) } fdSetFdno(u->ftpControl, tcpConnect(host, port)); - if (Fileno(u->ftpControl) < 0) - return Fileno(u->ftpControl); + if (fdio->fileno(u->ftpControl) < 0) + return fdio->fileno(u->ftpControl); /* ftpCheckResponse() assumes the socket is nonblocking */ - if (fcntl(Fileno(u->ftpControl), F_SETFL, O_NONBLOCK)) { + if (fcntl(fdio->fileno(u->ftpControl), F_SETFL, O_NONBLOCK)) { rc = FTPERR_FAILED_CONNECT; goto errxit; } @@ -401,7 +401,8 @@ int ftpOpen(urlinfo u) if ((rc = ftpCommand(u, "TYPE", "I", NULL))) goto errxit; - return Fileno(u->ftpControl); + fdLink(u->ftpControl, "open ftpControl"); + return fdio->fileno(u->ftpControl); errxit: fdio->close(u->ftpControl); @@ -414,6 +415,7 @@ int ftpFileDone(urlinfo u) { if (u->ftpFileDoneNeeded) { u->ftpFileDoneNeeded = 0; + fdFree(u->ftpControl, "ftpFileDone (from ftpFileDone)"); if (ftpCheckResponse(u, NULL)) return FTPERR_BAD_SERVER_RESPONSE; } @@ -480,13 +482,13 @@ int ftpFileDesc(urlinfo u, const char *cmd, FD_t fd) return FTPERR_PASSIVE_ERROR; fdSetFdno(fd, socket(AF_INET, SOCK_STREAM, IPPROTO_IP)); - if (Fileno(fd) < 0) + if (fdio->fileno(fd) < 0) return FTPERR_FAILED_CONNECT; /* XXX setsockopt SO_LINGER */ /* XXX setsockopt SO_KEEPALIVE */ /* XXX setsockopt SO_TOS IPTOS_THROUGHPUT */ - while (connect(Fileno(fd), (struct sockaddr *) &dataAddress, + while (connect(fdio->fileno(fd), (struct sockaddr *) &dataAddress, sizeof(dataAddress)) < 0) { if (errno == EINTR) continue; @@ -505,5 +507,6 @@ int ftpFileDesc(urlinfo u, const char *cmd, FD_t fd) } u->ftpFileDoneNeeded = 1; + fdLink(u->ftpControl, "ftpFileDone"); return 0; } diff --git a/lib/header.c b/lib/header.c index a7dae62..ca7f52b 100644 --- a/lib/header.c +++ b/lib/header.c @@ -522,7 +522,7 @@ Header headerRead(FD_t fd, int magicp) if (magicp == HEADER_MAGIC_YES) i += 2; - if (timedRead(fd, block, i * sizeof(*block)) != (i * sizeof(*block))) + if (timedRead(fd, (char *)block, i * sizeof(*block)) != (i * sizeof(*block))) return NULL; i = 0; @@ -552,7 +552,7 @@ Header headerRead(FD_t fd, int magicp) *p++ = htonl(dl); totalSize -= sizeof(int_32) + sizeof(int_32); - if (timedRead(fd, p, totalSize) != totalSize) + if (timedRead(fd, (char *)p, totalSize) != totalSize) return NULL; h = headerLoad(dataBlock); diff --git a/lib/install.c b/lib/install.c index ac2b961..4b0e94e 100644 --- a/lib/install.c +++ b/lib/install.c @@ -342,11 +342,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, notifyData); -#if 0 - cfd = gzdFdopen(fdDup(Fileno(fd)), "r"); -#else cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio"); -#endif rc = cpioInstallArchive(cfd, map, mappedFiles, ((notify && archiveSize) || specFile) ? callback : NULL, &info, &failedFile); diff --git a/lib/oldheader.c b/lib/oldheader.c index 56de869..92f41fb 100644 --- a/lib/oldheader.c +++ b/lib/oldheader.c @@ -44,7 +44,7 @@ char * oldhdrReadFromStream(FD_t fd, struct oldrpmHeader * header) { unsigned int archiveOffset; unsigned int groupLength; - if (timedRead(fd, &lit, sizeof(lit)) != sizeof(lit)) { + if (timedRead(fd, (char *)&lit, sizeof(lit)) != sizeof(lit)) { return strerror(errno); } @@ -145,7 +145,7 @@ char * oldhdrReadFromFile(char * filename, struct oldrpmHeader * header) { char * rc; FD_t fd; - fd = fdio->open(filename, O_RDONLY, 0); + fd = Fopen(filename, "r.fdio"); if (Ferror(fd)) /* XXX Fstrerror */ return strerror(errno); diff --git a/lib/query.c b/lib/query.c index 9dd7bd0..f9a6b36 100644 --- a/lib/query.c +++ b/lib/query.c @@ -458,7 +458,7 @@ int rpmQueryVerify(QVA_t *qva, enum rpmQVSources source, const char * arg, case RPMQV_RPM: { FD_t fd; - fd = ufdio->open(arg, O_RDONLY, 0); + fd = Fopen(arg, "r.ufdio"); if (Ferror(fd)) { /* XXX Fstrerror */ fprintf(stderr, _("open of %s failed: %s\n"), arg,urlStrerror(arg)); diff --git a/lib/rpminstall.c b/lib/rpminstall.c index dc018ff..11a18e8 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -46,7 +46,7 @@ static void * showProgress(const Header h, const rpmCallbackType what, switch (what) { case RPMCALLBACK_INST_OPEN_FILE: - fd = fdio->open(filename, O_RDONLY, 0); + fd = Fopen(filename, "r.fdio"); return fd; case RPMCALLBACK_INST_CLOSE_FILE: @@ -186,7 +186,7 @@ int rpmInstall(const char * rootdir, const char ** argv, int transFlags, would create all sorts of confusion later. */ for (filename = packages; *filename; filename++) { - fd = fdio->open(*filename, O_RDONLY, 0); + fd = Fopen(*filename, "r.fdio"); if (Ferror(fd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), *filename); @@ -328,7 +328,7 @@ int rpmInstall(const char * rootdir, const char ** argv, int transFlags, if (numSourcePackages && !stopInstall) { for (i = 0; i < numSourcePackages; i++) { - fd = fdio->open(sourcePackages[i], O_RDONLY, 0); + fd = Fopen(sourcePackages[i], "r.fdio"); if (Ferror(fd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), @@ -456,7 +456,7 @@ int rpmInstallSource(const char * rootdir, const char * arg, const char ** specF FD_t fd; int rc; - fd = ufdio->open(arg, O_RDONLY, 0); + fd = Fopen(arg, "r.ufdio"); if (Ferror(fd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open %s\n"), arg); diff --git a/lib/rpmio.h b/lib/rpmio.h index 52db3ee..99459fe 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -61,7 +61,7 @@ size_t Fwrite (const void *buf, size_t size, size_t nmemb, FD_t fd); int Fseek (FD_t fd, long int offset, int whence); int Fclose ( /*@killref@*/ FD_t fd); FD_t Fdopen (FD_t fd, const char * fmode); -FILE * Fopen (const char * path, const char * fmode); +FD_t Fopen (const char * path, const char * fmode); int Ferror (FD_t fd); int Fileno (FD_t fd); @@ -87,7 +87,9 @@ void fdSetIoCookie(FD_t fd, FDIO_t iop); long int fdGetCpioPos(FD_t fd); extern /*@null@*/ FD_t fdDup(int fdno); void fdSetCpioPos(FD_t fd, long int cpioPos); +#ifdef UNUSED extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode); +#endif #if 0 #define fdRead fdio->read @@ -139,6 +141,7 @@ const char *const ftpStrerror(int errorNumber); #endif /*@observer@*/ extern FDIO_t ufdio; +#define timedRead ufdio->read /* * Support for first fit File Allocation I/O. @@ -158,8 +161,6 @@ void fadSetFirstFree(FD_t fd, unsigned int firstFree); #include -extern /*@null@*/ FD_t gzdFdopen( /*@only@*/ void * cookie, const char * mode); - /*@observer@*/ extern FDIO_t gzdio; #endif /* HAVE_ZLIB_H */ @@ -171,8 +172,6 @@ extern /*@null@*/ FD_t gzdFdopen( /*@only@*/ void * cookie, const char * mode); #include -extern /*@null@*/ FD_t bzdFdopen( /*@only@*/ void * cookie, const char * mode); - /*@observer@*/ extern FDIO_t bzdio; #endif /* HAVE_BZLIB_H */ diff --git a/lib/rpmlead.c b/lib/rpmlead.c index 574577f..e1a9706 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -44,7 +44,7 @@ int writeLead(FD_t fd, struct rpmlead *lead) int readLead(FD_t fd, struct rpmlead *lead) { - if (timedRead(fd, lead, sizeof(*lead)) != sizeof(*lead)) { + if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) { rpmError(RPMERR_READERROR, _("read failed: %s (%d)"), strerror(errno), errno); return 1; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 47585d4..1c485a5 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -270,9 +270,11 @@ static void machFindEquivs(struct machCache * cache, if (table->list) xfree(table->list); table->list = NULL; - /* We have a general graph built using strings instead of pointers. - Yuck. We have to start at a point at traverse it, remembering how - far away everything is. */ + /* + * We have a general graph built using strings instead of pointers. + * Yuck. We have to start at a point at traverse it, remembering how + * far away everything is. + */ machAddEquiv(table, key, 1); machCacheEntryVisit(cache, table, key, 2); } @@ -533,6 +535,9 @@ int rpmReadRC(const char * rcfiles) if (r[0] == '~' && r[1] == '/') { char *home = getenv("HOME"); if (home == NULL) { + /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */ + if (rcfiles == defrcfiles && myrcfiles != r) + continue; rpmError(RPMERR_RPMRC, _("Cannot expand %s"), r); rc = 1; break; @@ -543,8 +548,8 @@ int rpmReadRC(const char * rcfiles) strcat(fn, r); /* Read another rcfile */ - fd = ufdio->open(fn, O_RDONLY, 0); - if (Ferror(fd)) { + fd = Fopen(fn, "r.ufdio"); + if (fd == NULL || Ferror(fd)) { /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */ if (rcfiles == defrcfiles && myrcfiles != r) continue; @@ -553,9 +558,9 @@ int rpmReadRC(const char * rcfiles) fn, strerror(errno)); rc = 1; break; + } else { + rc = doReadRC(fd, fn); } - rc = doReadRC(fd, fn); - Fclose(fd); if (rc) break; } if (myrcfiles) free(myrcfiles); @@ -575,7 +580,7 @@ int rpmReadRC(const char * rcfiles) return rc; } -static int doReadRC(FD_t fd, const char * filename) +static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) { const char *s; char *se, *next; @@ -583,16 +588,25 @@ static int doReadRC(FD_t fd, const char * filename) struct rpmOption searchOption, * option; int rc; + /* XXX fstat doesn't work on ufdio, default to 64K */ { struct stat sb; - fstat(Fileno(fd), &sb); - next = alloca(sb.st_size + 2); - if (Fread(next, sb.st_size, 1, fd) != sb.st_size) { + int fdno = Fileno(fd); + size_t nb; + fstat(fdno, &sb); + nb = (sb.st_size > 0 ? sb.st_size : 8*BUFSIZ); + next = alloca(nb + 2); + next[0] = '\0'; + rc = Fread(next, nb, 1, fd); + if (Ferror(fd) || (sb.st_size > 0 && rc != nb)) { /* XXX Feof(fd) */ rpmError(RPMERR_RPMRC, _("Failed to read %s: %s."), filename, strerror(errno)); - return 1; - } - next[sb.st_size] = '\n'; - next[sb.st_size + 1] = '\0'; + rc = 1; + } else + rc = 0; + Fclose(fd); + if (rc) return rc; + next[nb] = '\n'; + next[nb + 1] = '\0'; } while (*next) { @@ -658,15 +672,14 @@ static int doReadRC(FD_t fd, const char * filename) /*@notreached@*/ } - fdinc = fdio->open(fn, O_RDONLY, 0); - if (Ferror(fdinc)) { + fdinc = Fopen(fn, "r.ufdio"); + if (fdinc == NULL || Ferror(fdinc)) { /* XXX Fstrerror */ rpmError(RPMERR_RPMRC, _("cannot open %s at %s:%d"), fn, filename, linenum); rc = 1; } else { rc = doReadRC(fdinc, fn); - Fclose(fdinc); } if (fn) xfree(fn); if (rc) return rc; @@ -789,68 +802,74 @@ static void defaultMachine(const char ** arch, const char ** os) { #if !defined(__linux__) #ifdef SNI - /* USUALLY un.sysname on sinix does start with the word "SINIX" - * let's be absolutely sure - */ - sprintf(un.sysname,"SINIX"); + /* USUALLY un.sysname on sinix does start with the word "SINIX" + * let's be absolutely sure + */ + sprintf(un.sysname,"SINIX"); #endif if (!strcmp(un.sysname, "AIX")) { strcpy(un.machine, __power_pc() ? "ppc" : "rs6000"); - sprintf(un.sysname,"aix%s.%s",un.version,un.release); + sprintf(un.sysname,"aix%s.%s",un.version,un.release); + } + else if (!strcmp(un.sysname, "SunOS")) { + if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ { + int fd; + for (fd = 0; + (un.release[fd] != 0 && (fd < sizeof(un.release))); + fd++) { + if (!isdigit(un.release[fd]) && (un.release[fd] != '.')) { + un.release[fd] = 0; + break; + } + } + sprintf(un.sysname,"sunos%s",un.release); + } + + else /* Solaris 2.x: n.x.x becomes n-3.x.x */ + sprintf(un.sysname, "solaris%1d%s", atoi(un.release)-3, + un.release+1+(atoi(un.release)/10)); + } + else if (!strcmp(un.sysname, "HP-UX")) + /*make un.sysname look like hpux9.05 for example*/ + sprintf(un.sysname, "hpux%s", strpbrk(un.release,"123456789")); + else if (!strcmp(un.sysname, "OSF1")) + /*make un.sysname look like osf3.2 for example*/ + sprintf(un.sysname,"osf%s",strpbrk(un.release,"123456789")); + else if (!strncmp(un.sysname, "IP", 2)) + un.sysname[2] = '\0'; + else if (!strncmp(un.sysname, "SINIX", 5)) { + sprintf(un.sysname, "sinix%s",un.release); + if (!strncmp(un.machine, "RM", 2)) + sprintf(un.machine, "mips"); + } + else if ((!strncmp(un.machine, "34", 2) || + !strncmp(un.machine, "33", 2)) && \ + !strncmp(un.release, "4.0", 3)) + { + /* we are on ncr-sysv4 */ + char *prelid = NULL; + FD_t fd; + fd = Fopen("/etc/.relid", "r.fdio"); + if (!Ferror(fd)) { + chptr = (char *) xcalloc(1, 256); + if (chptr != NULL) { + int irelid = Fread(chptr, 256, 1, fd); + Fclose(fd); + /* example: "112393 RELEASE 020200 Version 01 OS" */ + if (irelid > 0) { + if ((prelid=strstr(chptr, "RELEASE "))){ + prelid += strlen("RELEASE ")+1; + sprintf(un.sysname,"ncr-sysv4.%.*s",1,prelid); + } + } + free (chptr); + } + } + if (prelid == NULL) /* parsing /etc/.relid file failed? */ + strcpy(un.sysname,"ncr-sysv4"); + /* wrong, just for now, find out how to look for i586 later*/ + strcpy(un.machine,"i486"); } - else if (!strcmp(un.sysname, "SunOS")) { - if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ { - int fd; - for (fd=0;(un.release[fd] != 0 && (fd < sizeof(un.release)));fd++) - if (!isdigit(un.release[fd]) && (un.release[fd] != '.')) { - un.release[fd] = 0; - break; - } - sprintf(un.sysname,"sunos%s",un.release); - } - - else /* Solaris 2.x: n.x.x becomes n-3.x.x */ - sprintf(un.sysname,"solaris%1d%s",atoi(un.release)-3,un.release+1+(atoi(un.release)/10)); - } - else if (!strcmp(un.sysname, "HP-UX")) - /*make un.sysname look like hpux9.05 for example*/ - sprintf(un.sysname,"hpux%s",strpbrk(un.release,"123456789")); - else if (!strcmp(un.sysname, "OSF1")) - /*make un.sysname look like osf3.2 for example*/ - sprintf(un.sysname,"osf%s",strpbrk(un.release,"123456789")); - else if (!strncmp(un.sysname, "IP", 2)) - un.sysname[2] = '\0'; - else if (!strncmp(un.sysname, "SINIX", 5)) { - sprintf(un.sysname, "sinix%s",un.release); - if (!strncmp(un.machine, "RM", 2)) - sprintf(un.machine, "mips"); - } - else if ((!strncmp(un.machine, "34", 2) || \ - !strncmp(un.machine, "33", 2)) && \ - !strncmp(un.release, "4.0", 3)) { - /* we are on ncr-sysv4 */ - char *prelid = NULL; - FD_t fd = fdio->open("/etc/.relid", O_RDONLY, 0700); - if (!Ferror(fd)) { - chptr = (char *) xcalloc(1, 256); - if (chptr != NULL) { - int irelid = Fread(chptr, 256, 1, fd); - Fclose(fd); - /* example: "112393 RELEASE 020200 Version 01 OS" */ - if (irelid > 0) { - if ((prelid=strstr(chptr, "RELEASE "))){ - prelid += strlen("RELEASE ")+1; - sprintf(un.sysname,"ncr-sysv4.%.*s",1,prelid); - } - } - free (chptr); - } - } - if (prelid == NULL) /* parsing /etc/.relid file failed? */ - strcpy(un.sysname,"ncr-sysv4"); - /* wrong, just for now, find out how to look for i586 later*/ - strcpy(un.machine,"i486"); - } #endif /* __linux__ */ /* get rid of the hyphens in the sysname */ @@ -1190,7 +1209,7 @@ void rpmRebuildTargetVars(const char **buildtarget, const char ** canontarget) const char *a; defaultMachine(&a, NULL); ca = (a) ? xstrdup(a) : NULL; - } + } for (x = 0; ca[x]; x++) ca[x] = tolower(ca[x]); diff --git a/lib/signature.c b/lib/signature.c index afdad05..ca6b2e8 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -292,7 +292,7 @@ static int makePGPSignature(const char *file, /*@out@*/void **sig, /*@out@*/int_ { FD_t fd; int rc; - fd = fdio->open(sigfile, O_RDONLY, 0); + fd = Fopen(sigfile, "r.fdio"); rc = timedRead(fd, *sig, *size); unlink(sigfile); Fclose(fd); @@ -369,7 +369,7 @@ static int makeGPGSignature(const char *file, /*@out@*/void **sig, /*@out@*/int_ { FD_t fd; int rc; - fd = fdio->open(sigfile, O_RDONLY, 0); + fd = Fopen(sigfile, "r.fdio"); rc = timedRead(fd, *sig, *size); unlink(sigfile); Fclose(fd); @@ -506,7 +506,7 @@ static int verifyPGPSignature(const char *datafile, void *sig, sigfile = tempnam(tmppath, "rpmsig"); xfree(tmppath); } - sfd = fdio->open(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); + sfd = Fopen(sigfile, "w.fdio"); (void)Fwrite(sig, count, 1, sfd); Fclose(sfd); @@ -601,7 +601,7 @@ static int verifyGPGSignature(const char *datafile, void *sig, sigfile = tempnam(tmppath, "rpmsig"); xfree(tmppath); } - sfd = fdio->open(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); + sfd = Fopen(sigfile, "w.fdio"); (void)Fwrite(sig, count, 1, sfd); Fclose(sfd); diff --git a/lib/tread.c b/lib/tread.c deleted file mode 100644 index c558c29..0000000 --- a/lib/tread.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "system.h" - -#include - -int timedRead(FD_t fd, void * bufptr, int length) { - int bytesRead; - int total = 0; - char * buf = bufptr; - fd_set readSet; - struct timeval tv; - struct stat sb; - - fstat(Fileno(fd), &sb); - if (S_ISREG(sb.st_mode)) - return Fread(buf, length, 1, fd); - - while (total < length) { - FD_ZERO(&readSet); - FD_SET(Fileno(fd), &readSet); - - tv.tv_sec = 30; /* FIXME: this should be configurable */ - tv.tv_usec = 0; - - if (select(Fileno(fd) + 1, &readSet, NULL, NULL, &tv) != 1) - return total; - - bytesRead = Fread(buf + total, length - total, 1, fd); - - if (bytesRead < 0) - return bytesRead; - else if (bytesRead == 0) - return total; - - total += bytesRead; - } - - return length; -} diff --git a/lib/uninstall.c b/lib/uninstall.c index 267d195..c0ca95f 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -313,7 +313,7 @@ static int runScript(Header h, const char * root, int progArgc, const char ** pr if (rpmIsVerbose()) { out = fdDup(Fileno(errfd)); } else { - out = fdio->open("/dev/null", O_WRONLY, 0); + out = Fopen("/dev/null", "w.fdio"); if (Ferror(out)) out = fdDup(Fileno(errfd)); } diff --git a/lib/url.c b/lib/url.c index 7357c3b..3ce6054 100644 --- a/lib/url.c +++ b/lib/url.c @@ -42,7 +42,7 @@ urlinfo XurlNew(const char *msg, const char *file, unsigned line) memset(u, 0, sizeof(*u)); u->proxyp = -1; u->port = -1; - u->ftpControl = fdio->new(fdio, "ftpControl", __FILE__, __LINE__); + u->ftpControl = fdio->new(fdio, "url ftpControl", __FILE__, __LINE__); u->ftpFileDoneNeeded = 0; u->nrefs = 0; return XurlLink(u, msg, file, line); @@ -54,8 +54,9 @@ DBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, li if (--u->nrefs > 0) return; if (u->ftpControl) { - fdio->close(u->ftpControl); - fdio->deref(u->ftpControl, "ftpControl", __FILE__, __LINE__); + if (fdio->fileno(u->ftpControl) >= 0) + fdio->close(u->ftpControl); + fdio->deref(u->ftpControl, "url ftpControl (from urlFree)", __FILE__, __LINE__); u->ftpControl = NULL; } FREE(u->url); @@ -367,7 +368,7 @@ int urlGetFile(const char * url, const char * dest) { FD_t tfd = NULL; urlinfo sfu; - sfd = ufdio->open(url, O_RDONLY, 0); + sfd = Fopen(url, "r.ufdio"); if (sfd == NULL || Ferror(sfd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_DEBUG, _("failed to open %s\n"), url); @@ -385,7 +386,7 @@ int urlGetFile(const char * url, const char * dest) { dest = fileName; } - tfd = fdio->open(dest, O_CREAT|O_WRONLY|O_TRUNC, 0600); + tfd = Fopen(dest, "w.fdio"); if (Ferror(tfd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_DEBUG, _("failed to create %s\n"), dest); diff --git a/po/POTFILES.in b/po/POTFILES.in index 857694b..d367da1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -57,7 +57,6 @@ lib/rpmrc.c lib/signature.c lib/stringbuf.c lib/transaction.c -lib/tread.c lib/uninstall.c lib/url.c lib/verify.c diff --git a/po/rpm.pot b/po/rpm.pot index 360e90b..be4a7fb 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-03 15:27-0500\n" +"POT-Creation-Date: 1999-11-04 15:34-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1225,7 +1225,7 @@ msgstr "" msgid "error reading header from package\n" msgstr "" -#: build/build.c:84 build/pack.c:272 +#: build/build.c:84 build/pack.c:268 msgid "Unable to open temp file" msgstr "" @@ -1407,7 +1407,7 @@ msgstr "" msgid "Could not open %%files file: %s" msgstr "" -#: build/files.c:1190 build/pack.c:503 +#: build/files.c:1190 build/pack.c:467 #, c-format msgid "line: %s" msgstr "" @@ -1465,108 +1465,108 @@ msgstr "" msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: build/pack.c:134 +#: build/pack.c:130 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: build/pack.c:151 +#: build/pack.c:147 #, c-format msgid "cannot create %s: %s\n" msgstr "" #. XXX Fstrerror -#: build/pack.c:189 +#: build/pack.c:185 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:199 +#: build/pack.c:195 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:220 +#: build/pack.c:216 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:226 +#: build/pack.c:222 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:283 +#: build/pack.c:279 msgid "Bad CSA data" msgstr "" #. XXX Fstrerror -#: build/pack.c:318 +#: build/pack.c:314 #, c-format msgid "Could not open %s\n" msgstr "" -#: build/pack.c:350 build/pack.c:392 +#: build/pack.c:346 build/pack.c:388 #, c-format msgid "Unable to write package: %s" msgstr "" -#: build/pack.c:365 +#: build/pack.c:361 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:382 +#: build/pack.c:378 #, c-format msgid "Unable to read sigtarget: %s" msgstr "" -#: build/pack.c:407 +#: build/pack.c:403 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:427 build/pack.c:454 +#: build/pack.c:418 #, c-format msgid "create archive failed on file %s: %s" msgstr "" -#: build/pack.c:473 +#: build/pack.c:437 #, c-format msgid "cpio_copy write failed: %s" msgstr "" -#: build/pack.c:480 +#: build/pack.c:444 #, c-format msgid "cpio_copy read failed: %s" msgstr "" -#: build/pack.c:559 +#: build/pack.c:523 #, c-format msgid "Could not open PreIn file: %s" msgstr "" -#: build/pack.c:566 +#: build/pack.c:530 #, c-format msgid "Could not open PreUn file: %s" msgstr "" -#: build/pack.c:573 +#: build/pack.c:537 #, c-format msgid "Could not open PostIn file: %s" msgstr "" -#: build/pack.c:580 +#: build/pack.c:544 #, c-format msgid "Could not open PostUn file: %s" msgstr "" -#: build/pack.c:588 +#: build/pack.c:552 #, c-format msgid "Could not open VerifyScript file: %s" msgstr "" -#: build/pack.c:604 +#: build/pack.c:568 #, c-format msgid "Could not open Trigger script file: %s" msgstr "" @@ -1930,36 +1930,36 @@ msgstr "" msgid "getNextHeader: %s\n" msgstr "" -#: lib/cpio.c:991 +#: lib/cpio.c:992 #, c-format msgid "(error 0x%x)" msgstr "" -#: lib/cpio.c:994 +#: lib/cpio.c:995 msgid "Bad magic" msgstr "" -#: lib/cpio.c:995 +#: lib/cpio.c:996 msgid "Bad/unreadable header" msgstr "" -#: lib/cpio.c:1013 +#: lib/cpio.c:1014 msgid "Header size too big" msgstr "" -#: lib/cpio.c:1014 +#: lib/cpio.c:1015 msgid "Unknown file type" msgstr "" -#: lib/cpio.c:1015 +#: lib/cpio.c:1016 msgid "Missing hard link" msgstr "" -#: lib/cpio.c:1016 +#: lib/cpio.c:1017 msgid "Internal error" msgstr "" -#: lib/cpio.c:1025 +#: lib/cpio.c:1026 msgid " failed - " msgstr "" @@ -2208,86 +2208,86 @@ msgstr "" #. this would probably be a good place to check if disk space #. was used up - if so, we should return a different error -#: lib/install.c:359 +#: lib/install.c:355 #, c-format msgid "unpacking of archive failed%s%s: %s" msgstr "" -#: lib/install.c:360 +#: lib/install.c:356 msgid " on file " msgstr "" -#: lib/install.c:403 +#: lib/install.c:399 msgid "installing a source package\n" msgstr "" -#: lib/install.c:414 +#: lib/install.c:410 #, c-format msgid "cannot create %s: %s" msgstr "" -#: lib/install.c:422 lib/install.c:444 +#: lib/install.c:418 lib/install.c:440 #, c-format msgid "cannot write to %s" msgstr "" -#: lib/install.c:426 +#: lib/install.c:422 #, c-format msgid "sources in: %s\n" msgstr "" -#: lib/install.c:437 +#: lib/install.c:433 #, c-format msgid "cannot create %s" msgstr "" -#: lib/install.c:448 +#: lib/install.c:444 #, c-format msgid "spec file in: %s\n" msgstr "" -#: lib/install.c:482 lib/install.c:510 +#: lib/install.c:478 lib/install.c:506 msgid "source package contains no .spec file" msgstr "" -#: lib/install.c:531 +#: lib/install.c:527 #, c-format msgid "renaming %s to %s\n" msgstr "" -#: lib/install.c:533 lib/install.c:811 lib/uninstall.c:27 +#: lib/install.c:529 lib/install.c:807 lib/uninstall.c:27 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" -#: lib/install.c:623 +#: lib/install.c:619 msgid "source package expected, binary found" msgstr "" -#: lib/install.c:680 +#: lib/install.c:676 #, c-format msgid "package: %s-%s-%s files test = %d\n" msgstr "" -#: lib/install.c:741 +#: lib/install.c:737 msgid "stopping install as we're running --test\n" msgstr "" -#: lib/install.c:746 +#: lib/install.c:742 msgid "running preinstall script (if any)\n" msgstr "" -#: lib/install.c:771 +#: lib/install.c:767 #, c-format msgid "warning: %s created as %s" msgstr "" -#: lib/install.c:807 +#: lib/install.c:803 #, c-format msgid "warning: %s saved as %s" msgstr "" -#: lib/install.c:881 +#: lib/install.c:877 msgid "running postinstall scripts (if any)\n" msgstr "" @@ -2827,7 +2827,7 @@ msgid "opening database mode 0x%x in %s\n" msgstr "" #. XXX Fstrerror -#: lib/rpmdb.c:156 lib/url.c:373 +#: lib/rpmdb.c:156 lib/url.c:374 #, c-format msgid "failed to open %s\n" msgstr "" @@ -3021,59 +3021,59 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmio.c:229 +#: lib/rpmio.c:246 msgid "Success" msgstr "" -#: lib/rpmio.c:232 +#: lib/rpmio.c:249 msgid "Bad server response" msgstr "" -#: lib/rpmio.c:235 +#: lib/rpmio.c:252 msgid "Server IO error" msgstr "" -#: lib/rpmio.c:238 +#: lib/rpmio.c:255 msgid "Server timeout" msgstr "" -#: lib/rpmio.c:241 +#: lib/rpmio.c:258 msgid "Unable to lookup server host address" msgstr "" -#: lib/rpmio.c:244 +#: lib/rpmio.c:261 msgid "Unable to lookup server host name" msgstr "" -#: lib/rpmio.c:247 +#: lib/rpmio.c:264 msgid "Failed to connect to server" msgstr "" -#: lib/rpmio.c:250 +#: lib/rpmio.c:267 msgid "Failed to establish data connection to server" msgstr "" -#: lib/rpmio.c:253 +#: lib/rpmio.c:270 msgid "IO error to local file" msgstr "" -#: lib/rpmio.c:256 +#: lib/rpmio.c:273 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/rpmio.c:259 +#: lib/rpmio.c:276 msgid "File not found on server" msgstr "" -#: lib/rpmio.c:262 +#: lib/rpmio.c:279 msgid "Abort in progress" msgstr "" -#: lib/rpmio.c:266 +#: lib/rpmio.c:283 msgid "Unknown or unexpected error" msgstr "" -#: lib/rpmio.c:301 +#: lib/rpmio.c:318 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" @@ -3118,59 +3118,60 @@ msgstr "" msgid "Too many args in default line at %s:%d" msgstr "" -#: lib/rpmrc.c:536 +#: lib/rpmrc.c:540 #, c-format msgid "Cannot expand %s" msgstr "" #. XXX Fstrerror -#: lib/rpmrc.c:552 +#: lib/rpmrc.c:556 #, c-format msgid "Unable to open %s for reading: %s." msgstr "" -#: lib/rpmrc.c:590 +#. XXX Feof(fd) +#: lib/rpmrc.c:600 #, c-format msgid "Failed to read %s: %s." msgstr "" -#: lib/rpmrc.c:620 +#: lib/rpmrc.c:633 #, c-format msgid "missing ':' at %s:%d" msgstr "" -#: lib/rpmrc.c:637 lib/rpmrc.c:713 +#: lib/rpmrc.c:650 lib/rpmrc.c:725 #, c-format msgid "missing argument for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:654 lib/rpmrc.c:678 +#: lib/rpmrc.c:667 lib/rpmrc.c:690 #, c-format msgid "%s expansion failed at %s:%d \"%s\"" msgstr "" #. XXX Fstrerror -#: lib/rpmrc.c:664 +#: lib/rpmrc.c:677 #, c-format msgid "cannot open %s at %s:%d" msgstr "" -#: lib/rpmrc.c:705 +#: lib/rpmrc.c:717 #, c-format msgid "missing architecture for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:772 +#: lib/rpmrc.c:784 #, c-format msgid "bad option '%s' at %s:%d" msgstr "" -#: lib/rpmrc.c:1134 +#: lib/rpmrc.c:1147 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: lib/rpmrc.c:1135 +#: lib/rpmrc.c:1148 msgid "Please contact rpm-list@redhat.com\n" msgstr "" @@ -3373,22 +3374,22 @@ msgstr "" msgid "execution of script failed" msgstr "" -#: lib/url.c:176 +#: lib/url.c:177 #, c-format msgid "Password for %s@%s: " msgstr "" -#: lib/url.c:201 lib/url.c:227 +#: lib/url.c:202 lib/url.c:228 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: lib/url.c:336 +#: lib/url.c:337 msgid "url port must be a number\n" msgstr "" #. XXX Fstrerror -#: lib/url.c:391 +#: lib/url.c:392 #, c-format msgid "failed to create %s\n" msgstr "" diff --git a/python/rpmmodule.c b/python/rpmmodule.c index f8e32df..6b6faf9 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -558,7 +558,7 @@ static PyObject * rpmHeaderFromFile(PyObject * self, PyObject * args) { PyObject * list; if (!PyArg_ParseTuple(args, "s", &filespec)) return NULL; - fd = fdio->open(filespec, O_RDONLY, 0); + fd = Fopen(filespec, "r.fdio"); if (!fd) { PyErr_SetFromErrno(pyrpmError); diff --git a/rpm2cpio.c b/rpm2cpio.c index 4913fe0..872d0db 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -17,7 +17,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); } if (Fileno(fdi) < 0) { diff --git a/tools/dump.c b/tools/dump.c index 5d660fa..5012208 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -11,7 +11,7 @@ int main(int argc, char ** argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); } if (Ferror(fdi)) { diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c index 5253ca7..21856cc 100644 --- a/tools/rpmarchive.c +++ b/tools/rpmarchive.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); } readLead(fdi, &lead); diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index cb0b728..80f2c2a 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -836,7 +836,7 @@ rpmgettext(FD_t fd, const char *file, FILE *ofp) } } - fd = fdio->open(fni, O_RDONLY, 0644); + fd = Fopen(fni, "r.fdio"); if (Ferror(fd)) { /* XXX Fstrerror */ fprintf(stderr, _("rpmgettext: open %s: %s\n"), fni, strerror(errno)); diff --git a/tools/rpmheader.c b/tools/rpmheader.c index a05321c..12aacde 100644 --- a/tools/rpmheader.c +++ b/tools/rpmheader.c @@ -17,7 +17,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); if (Ferror(fdi)) { perror(argv[1]); exit(EXIT_FAILURE); diff --git a/tools/rpmlead.c b/tools/rpmlead.c index a60e02f..7b2a88d 100644 --- a/tools/rpmlead.c +++ b/tools/rpmlead.c @@ -14,7 +14,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); if (Ferror(fdi)) { perror(argv[1]); exit(EXIT_FAILURE); diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 0a02199..50d6850 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -15,7 +15,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = ufdio->open(argv[1], O_RDONLY, 0644); + fdi = Fopen(argv[1], "r.ufdio"); if (Ferror(fdi)) { perror(argv[1]); exit(1); -- 2.7.4