diff --git a/build/build.c b/build/build.c index f1b9d423e..e11bfed3a 100644 --- a/build/build.c +++ b/build/build.c @@ -87,8 +87,12 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) #ifdef HAVE_FCHMOD (void)fchmod(Fileno(fd), 0600); /* XXX fubar on ufdio */ #endif +#ifdef DYING /* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */ xfd = Fdopen(fd, "w.fdio"); +#else + xfd = Fdopen(fd, "w.fpio"); +#endif strcpy(buf, _preScriptEnvironment); expandMacros(spec, spec->macros, buf, sizeof(buf)); diff --git a/build/files.c b/build/files.c index 77f033809..797b87e09 100644 --- a/build/files.c +++ b/build/files.c @@ -1176,7 +1176,7 @@ static int processPackageFiles(Spec spec, Package pkg, ffn = rpmGetPath("%{_builddir}/", (spec->buildSubdir ? spec->buildSubdir : "") , "/", pkg->fileFile, NULL); - fd = Fopen(ffn, "r.ufdio"); + fd = Fopen(ffn, "r.fpio"); xfree(ffn); if (fd == NULL || Ferror(fd)) { diff --git a/build/pack.c b/build/pack.c index 059acdad8..3791742b8 100644 --- a/build/pack.c +++ b/build/pack.c @@ -59,13 +59,14 @@ int packageSources(Spec spec) memset(csa, 0, sizeof(*csa)); csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(fdio, "init (packageSources)"); + csa->cpioFdIn = fdNew("init (packageSources)"); + csa->cpioFdIn = fdLink(csa->cpioFdIn, "persist (packageSources)"); csa->cpioList = spec->sourceCpioList; csa->cpioCount = spec->sourceCpioCount; rc = writeRPM(spec->sourceHeader, fn, RPMLEAD_SOURCE, csa, spec->passPhrase, &(spec->cookie)); - free(csa->cpioFdIn); + csa->cpioFdIn = fdFree(csa->cpioFdIn, "persist (packageSources)"); xfree(fn); } return rc; @@ -156,13 +157,14 @@ int packageBinaries(Spec spec) memset(csa, 0, sizeof(*csa)); csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(fdio, "init (packageBinaries)"); + csa->cpioFdIn = fdNew("init (packageBinaries)"); + csa->cpioFdIn = fdLink(csa->cpioFdIn, "persist (packageBinaries)"); csa->cpioList = pkg->cpioList; csa->cpioCount = pkg->cpioCount; rc = writeRPM(pkg->header, fn, RPMLEAD_BINARY, csa, spec->passPhrase, NULL); - free(csa->cpioFdIn); + csa->cpioFdIn = fdFree(csa->cpioFdIn, "persist (packageBinaries)"); xfree(fn); if (rc) return rc; @@ -245,6 +247,9 @@ int writeRPM(Header h, const char *fileName, int type, char buf[BUFSIZ]; Header sig; struct rpmlead lead; +#ifdef DYING + int fdno; +#endif if (Fileno(csa->cpioFdIn) < 0) { csa->cpioArchiveSize = 0; @@ -267,6 +272,12 @@ int writeRPM(Header h, const char *fileName, int type, rpmError(RPMERR_CREATE, _("Unable to open temp file")); return RPMERR_CREATE; } + +#ifdef DYING + fd = fdLink(fd, "persist"); /* XXX keep fd from being freed */ + fdno = Fileno(fd); /* XXX HACK HACK HACK to keep fdno open */ +#endif + if (headerWrite(fd, h, HEADER_MAGIC_YES)) { rc = RPMERR_NOSPACE; } else { /* Write the archive and get the size */ @@ -279,6 +290,11 @@ int writeRPM(Header h, const char *fileName, int type, rc = RPMERR_BADARG; } } + +#ifdef DYING + fdSetFdno(fd, fdno); /* XXX HACK HACK HACK to keep fdno open */ +#endif + if (rc != 0) { Fclose(fd); unlink(sigtarget); @@ -419,7 +435,11 @@ static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmode) int rc; const char *failedFile = NULL; +#ifndef DYING cfd = Fdopen(fdDup(Fileno(fdo)), fmode); +#else + cfd = Fdopen(fdo, fmode); +#endif rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, &csa->cpioArchiveSize, &failedFile); if (rc) { @@ -438,7 +458,7 @@ static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmode) static int cpio_copy(FD_t fdo, CSA_t *csa) { char buf[BUFSIZ]; - ssize_t nb; + size_t nb; while((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), csa->cpioFdIn)) > 0) { if (Fwrite(buf, sizeof(buf[0]), nb, fdo) != nb) { @@ -448,7 +468,7 @@ static int cpio_copy(FD_t fdo, CSA_t *csa) } csa->cpioArchiveSize += nb; } - if (nb < 0) { + if (Ferror(csa->cpioFdIn)) { rpmError(RPMERR_CPIO, _("cpio_copy read failed: %s"), Fstrerror(csa->cpioFdIn)); return 1; @@ -462,15 +482,8 @@ static StringBuf addFileToTagAux(Spec spec, const char *file, StringBuf sb) const char *fn = buf; FD_t fd; -#ifdef DYING - strcpy(fn, "%{_builddir}/"); - expandMacros(spec, spec->macros, fn, sizeof(fn)); - strcat(fn, spec->buildSubdir); - strcat(fn, "/"); - strcat(fn, file); -#else + /* XXX use rpmGenPath(rootdir, "%{_buildir}/%{_buildsubdir}/", file) */ fn = rpmGetPath("%{_builddir}/", spec->buildSubdir, "/", file, NULL); -#endif fd = Fopen(fn, "r.ufdio"); if (fn != buf) xfree(fn); diff --git a/build/parsePreamble.c b/build/parsePreamble.c index ec9486620..d4ed8e51d 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -229,22 +229,24 @@ static int readIcon(Header h, const char *file) { const char *fn = NULL; char *icon; +#ifdef DYING struct stat statbuf; +#endif FD_t fd; int rc = 0; - int nb; + off_t size; + size_t nb, iconsize; /* XXX use rpmGenPath(rootdir, "%{_sourcedir}/", file) for icon path. */ fn = rpmGetPath("%{_sourcedir}/", file, NULL); +#ifdef DYING if (Stat(fn, &statbuf)) { rpmError(RPMERR_BADSPEC, _("Unable to stat icon: %s"), fn); rc = RPMERR_BADSPEC; goto exit; } - - icon = xmalloc(statbuf.st_size); - *icon = '\0'; +#endif fd = Fopen(fn, "r.ufdio"); if (fd == NULL || Ferror(fd)) { @@ -253,8 +255,19 @@ static int readIcon(Header h, const char *file) rc = RPMERR_BADSPEC; goto exit; } - nb = Fread(icon, sizeof(char), statbuf.st_size, fd); - if (nb != statbuf.st_size) { + size = fdSize(fd); + iconsize = (size >= 0 ? size : (8 * BUFSIZ)); + if (iconsize == 0) { + Fclose(fd); + rc = 0; + goto exit; + } + + icon = xmalloc(iconsize + 1); + *icon = '\0'; + + nb = Fread(icon, sizeof(char), iconsize, fd); + if (Ferror(fd) || (size >= 0 && nb != size)) { rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s"), fn, Fstrerror(fd)); rc = RPMERR_BADSPEC; @@ -264,9 +277,9 @@ static int readIcon(Header h, const char *file) goto exit; if (! strncmp(icon, "GIF", sizeof("GIF")-1)) { - headerAddEntry(h, RPMTAG_GIF, RPM_BIN_TYPE, icon, statbuf.st_size); + headerAddEntry(h, RPMTAG_GIF, RPM_BIN_TYPE, icon, iconsize); } else if (! strncmp(icon, "/* XPM", sizeof("/* XPM")-1)) { - headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, statbuf.st_size); + headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize); } else { rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s"), file); rc = RPMERR_BADSPEC; diff --git a/build/parseSpec.c b/build/parseSpec.c index adaae0baf..108006313 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -169,10 +169,10 @@ int readLine(Spec spec, int strip) retry: /* Make sure the current file is open */ if (ofi->fd == NULL) { - if ((ofi->fd = Fopen(ofi->fileName, "r.ufdio")) == NULL) { + if ((ofi->fd = Fopen(ofi->fileName, "r.fpio")) == NULL) { /* XXX Fstrerror */ - rpmError(RPMERR_BADSPEC, _("Unable to open: %s\n"), - ofi->fileName); + rpmError(RPMERR_BADSPEC, _("Unable to open %s: %s\n"), + ofi->fileName, Fstrerror(ofi->fd)); return RPMERR_BADSPEC; } spec->lineNum = ofi->lineNum = 0; diff --git a/lib/falloc.c b/lib/falloc.c index d10bfc98b..6cf8e5bb7 100644 --- a/lib/falloc.c +++ b/lib/falloc.c @@ -48,7 +48,7 @@ FD_t fadOpen(const char * path, int flags, int perms) /* XXX Fstrerror */ return NULL; - fdSetIoCookie(fd, fadio); + fdSetIo(fd, fadio); fadSetFirstFree(fd, 0); fadSetFileSize(fd, Fseek(fd, 0, SEEK_END)); diff --git a/lib/ftp.c b/lib/ftp.c index 83918d4f5..da60d2cf8 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -304,7 +304,7 @@ static int getHostAddress(const char * host, struct in_addr * address) return 0; } -static int tcpConnect(const char *host, int port) +static int tcpConnect(FD_t ctrl, const char *host, int port) { struct sockaddr_in sin; int fdno = -1; @@ -339,6 +339,7 @@ static int tcpConnect(const char *host, int port) return fdno; errxit: + fdSetSyserrno(ctrl, errno, ftpStrerror(rc)); if (fdno >= 0) close(fdno); return rc; @@ -364,14 +365,17 @@ int httpOpen(urlinfo u, FD_t ctrl, const char *httpcmd) path = (u->proxyh || u->proxyp > 0) ? u->url : u->path; reopen: - if (fdio->fileno(ctrl) >= 0 && fdWritable(ctrl, 0) < 1) + if (fdio->fileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) { +if (_ftp_debug) +fprintf(stderr, "*** httpOpen closing ctrl fdno %d rc %d\n", fdio->fileno(ctrl), rc); fdio->close(ctrl); + } if (fdio->fileno(ctrl) < 0) { - rc = tcpConnect(host, port); + rc = tcpConnect(ctrl, host, port); fdSetFdno(ctrl, (rc >= 0 ? rc : -1)); if (rc < 0) - goto errxit; + goto errxit2; ctrl = fdLink(ctrl, "open ctrl (httpOpen)"); } @@ -431,6 +435,8 @@ fprintf(stderr, "*** httpOpen ctrl %p reopening ...\n", ctrl); return fdio->fileno(ctrl); errxit: + fdSetSyserrno(ctrl, errno, ftpStrerror(rc)); +errxit2: if (fdio->fileno(ctrl) >= 0) fdio->close(ctrl); return rc; @@ -445,8 +451,10 @@ int ftpOpen(urlinfo u) int rc; URLSANE(u); - if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL)) - return FTPERR_BAD_HOSTNAME; + if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL)) { + rc = FTPERR_BAD_HOSTNAME; + goto errxit; + } if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = IPPORT_FTP; @@ -469,10 +477,10 @@ int ftpOpen(urlinfo u) fdio->close(u->ctrl); if (fdio->fileno(u->ctrl) < 0) { - rc = tcpConnect(host, port); + rc = tcpConnect(u->ctrl, host, port); fdSetFdno(u->ctrl, (rc >= 0 ? rc : -1)); if (rc < 0) - goto errxit; + goto errxit2; } if ((rc = ftpCheckResponse(u, NULL))) @@ -491,6 +499,8 @@ int ftpOpen(urlinfo u) return fdio->fileno(u->ctrl); errxit: + fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc)); +errxit2: if (fdio->fileno(u->ctrl) >= 0) fdio->close(u->ctrl); return rc; @@ -625,20 +635,17 @@ int ftpFileDesc(urlinfo u, const char *cmd, FD_t data) sizeof(dataAddress)) < 0) { if (errno == EINTR) continue; - fdio->close(data); rc = FTPERR_FAILED_DATA_CONNECT; goto errxit; } DBG(0, (stderr, "-> %s", cmd)); if (fdio->write(u->ctrl, cmd, cmdlen) != cmdlen) { - fdio->close(data); rc = FTPERR_SERVER_IO_ERROR; goto errxit; } if ((rc = ftpCheckResponse(u, NULL))) { - fdio->close(data); goto errxit; } @@ -648,5 +655,9 @@ int ftpFileDesc(urlinfo u, const char *cmd, FD_t data) return 0; errxit: + fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc)); +errxit2: + if (fdio->fileno(data) >= 0) + fdio->close(data); return rc; } diff --git a/lib/install.c b/lib/install.c index 90f7f5ff8..a51346219 100644 --- a/lib/install.c +++ b/lib/install.c @@ -348,7 +348,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, notifyData); - cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio"); + cfd = Fdopen(fd, "r.gzdio"); rc = cpioInstallArchive(cfd, map, mappedFiles, ((notify && archiveSize) || specFile) ? callback : NULL, &info, &failedFile); diff --git a/lib/macro.c b/lib/macro.c index 45e511196..b206e2c45 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -1300,7 +1300,7 @@ initMacros(MacroContext *mc, const char *macrofiles) strncat(buf, mfile, sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; - fd = Fopen(buf, "r.ufdio"); + fd = Fopen(buf, "r.fpio"); if (fd == NULL || Ferror(fd)) continue; @@ -1357,11 +1357,7 @@ int isCompressed(const char *file, int *compressed) *compressed = COMPRESSED_NOT; -#ifdef DYING - fd = fdOpen(file, O_RDONLY, 0); -#else fd = Fopen(file, "r.ufdio"); -#endif if (fd == NULL || Ferror(fd)) { /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, Fstrerror(fd)); diff --git a/lib/misc.c b/lib/misc.c index d315ac20b..6238f3732 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -404,7 +404,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { } /* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */ -#ifndef NOTYET +#ifdef DYING fd = fdio->open(tfn, (O_CREAT|O_RDWR|O_EXCL), 0700); #else fd = Fopen(tfn, "w+x.ufdio"); @@ -424,14 +424,16 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { } #ifndef NOTYET - fstat(Fileno(fd), &sb2); + if (fstat(Fileno(fd), &sb2) == 0) #else - Stat(tfn, &sb2); + if (Stat(tfn, &sb2) == 0) #endif - if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) { - rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn); - xfree(tfn); - return 1; + { + if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) { + rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn); + xfree(tfn); + return 1; + } } if (fnptr) diff --git a/lib/rpmio.h b/lib/rpmio.h index e38041352..1f9df01f4 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -18,7 +18,7 @@ typedef /*@null@*/ FD_t fdio_ref_function_t ( /*@only@*/ void * cookie, typedef /*@null@*/ FD_t fdio_deref_function_t ( /*@only@*/ FD_t fd, const char * msg, const char * file, unsigned line); -typedef /*@null@*/ FD_t fdio_new_function_t (FDIO_t iop, const char * msg, +typedef /*@null@*/ FD_t fdio_new_function_t (const char * msg, const char * file, unsigned line); typedef int fdio_fileno_function_t (void * cookie); @@ -89,9 +89,15 @@ int Access (const char * path, int amode); /*@observer@*/ extern FDIO_t gzdio; +void fdPush(FD_t fd, FDIO_t io, void * fp, int fdno); +void fdPop(FD_t fd); + void fdSetFdno(FD_t fd, int fdno); -/*@null@*/ const FDIO_t fdGetIoCookie(FD_t fd); -void fdSetIoCookie(FD_t fd, FDIO_t iop); +off_t fdSize(FD_t fd); +void fdSetSyserrno(FD_t fd, int syserrno, const void * errcookie); + +/*@null@*/ const FDIO_t fdGetIo(FD_t fd); +void fdSetIo(FD_t fd, FDIO_t io); int fdGetRdTimeoutSecs(FD_t fd); @@ -115,7 +121,7 @@ extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode); #define fdLink(_fd, _msg) fdio->ref(_fd, _msg, __FILE__, __LINE__) #define fdFree(_fd, _msg) fdio->deref(_fd, _msg, __FILE__, __LINE__) -#define fdNew(_iop, _msg) fdio->new(_iop, _msg, __FILE__, __LINE__) +#define fdNew(_msg) fdio->new(_msg, __FILE__, __LINE__) #if 0 #define fdFileno fdio->fileno @@ -131,6 +137,7 @@ extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode); /*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd); /*@observer@*/ const char * urlStrerror(const char * url); +int ufdCopy(FD_t sfd, FD_t tfd); int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd); const char *const ftpStrerror(int errorNumber); diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 8f8c29f55..85a862165 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -104,7 +104,7 @@ static int currTables[2] = { RPM_MACHTABLE_INSTOS, RPM_MACHTABLE_INSTARCH }; static struct rpmvarValue values[RPMVAR_NUM]; /* prototypes */ -static int doReadRC(FD_t fd, const char * filename); +static int doReadRC(FD_t fd, const char * urlfn); static void rpmSetVarArch(int var, const char * val, const char * arch); static void rebuildCompatTables(int type, const char *name); @@ -548,7 +548,7 @@ int rpmReadRC(const char * rcfiles) strcat(fn, r); /* Read another rcfile */ - fd = Fopen(fn, "r.ufdio"); + fd = Fopen(fn, "r.fpio"); if (fd == NULL || Ferror(fd)) { /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */ if (rcfiles == defrcfiles && myrcfiles != r) @@ -579,7 +579,7 @@ int rpmReadRC(const char * rcfiles) return rc; } -static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) +static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) { const char *s; char *se, *next; @@ -587,17 +587,18 @@ static int doReadRC( /*@killref@*/ 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; - int fdno = Fileno(fd); - size_t nb; - fstat(fdno, &sb); - nb = (sb.st_size > 0 ? sb.st_size : (8*BUFSIZ - 2)); + /* XXX really need rc = Slurp(fd, const char * filename, char ** buf) */ + { off_t size = fdSize(fd); + size_t nb = (size >= 0 ? size : (8*BUFSIZ - 2)); + if (nb == 0) { + Fclose(fd); + return 0; + } next = alloca(nb + 2); next[0] = '\0'; rc = Fread(next, sizeof(*next), nb, fd); - if (Ferror(fd) || (sb.st_size > 0 && rc != nb)) { /* XXX Feof(fd) */ - rpmError(RPMERR_RPMRC, _("Failed to read %s: %s."), filename, + if (Ferror(fd) || (size > 0 && rc != nb)) { /* XXX Feof(fd) */ + rpmError(RPMERR_RPMRC, _("Failed to read %s: %s."), urlfn, Fstrerror(fd)); rc = 1; } else @@ -635,7 +636,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) if (*se != ':') { rpmError(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d"), - (0xff & *se), filename, linenum); + (0xff & *se), urlfn, linenum); return 1; } *se++ = '\0'; /* terminate keyword or option, point to value */ @@ -652,7 +653,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) arch = val = fn = NULL; if (*se == '\0') { rpmError(RPMERR_RPMRC, _("missing argument for %s at %s:%d"), - option->name, filename, linenum); + option->name, urlfn, linenum); return 1; } @@ -669,16 +670,16 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) fn = rpmGetPath(s, NULL); if (fn == NULL || *fn == '\0') { rpmError(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\""), - option->name, filename, linenum, s); + option->name, urlfn, linenum, s); if (fn) xfree(fn); return 1; /*@notreached@*/ } - fdinc = Fopen(fn, "r.ufdio"); + fdinc = Fopen(fn, "r.fpio"); if (fdinc == NULL || Ferror(fdinc)) { rpmError(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s"), - fn, filename, linenum, Fstrerror(fdinc)); + fn, urlfn, linenum, Fstrerror(fdinc)); rc = 1; } else { rc = doReadRC(fdinc, fn); @@ -691,7 +692,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) fn = rpmGetPath(se, NULL); if (fn == NULL || *fn == '\0') { rpmError(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\""), - option->name, filename, linenum, fn); + option->name, urlfn, linenum, fn); if (fn) xfree(fn); return 1; } @@ -718,7 +719,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) if (*se == '\0') { rpmError(RPMERR_RPMRC, _("missing architecture for %s at %s:%d"), - option->name, filename, linenum); + option->name, urlfn, linenum); return 1; } *se++ = '\0'; @@ -726,7 +727,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) if (*se == '\0') { rpmError(RPMERR_RPMRC, _("missing argument for %s at %s:%d"), - option->name, filename, linenum); + option->name, urlfn, linenum); return 1; } } @@ -763,7 +764,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) if (*rest == '_') rest++; if (!strcmp(rest, "compat")) { - if (machCompatCacheAdd(se, filename, linenum, + if (machCompatCacheAdd(se, urlfn, linenum, &tables[i].cache)) return 1; gotit = 1; @@ -771,13 +772,13 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) !strcmp(rest, "translate")) { if (addDefault(&tables[i].defaults, &tables[i].defaultsLength, - se, filename, linenum)) + se, urlfn, linenum)) return 1; gotit = 1; } else if (tables[i].hasCanon && !strcmp(rest, "canon")) { if (addCanon(&tables[i].canons, &tables[i].canonsLength, - se, filename, linenum)) + se, urlfn, linenum)) return 1; gotit = 1; } @@ -785,7 +786,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * filename) if (!gotit) { rpmError(RPMERR_RPMRC, _("bad option '%s' at %s:%d"), - s, filename, linenum); + s, urlfn, linenum); } } } diff --git a/lib/url.c b/lib/url.c index 90f91d55e..63b49511d 100644 --- a/lib/url.c +++ b/lib/url.c @@ -64,20 +64,22 @@ DBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, li if (--u->nrefs > 0) return u; if (u->ctrl) { + void * uctrl = u->ctrl; if (fdio->fileno(u->ctrl) >= 0) fdio->close(u->ctrl); u->ctrl = fdio->deref(u->ctrl, "persist ctrl (urlFree)", file, line); if (u->ctrl) - fprintf(stderr, _("warning: u %p ctrl nrefs != 0 (%s %s)\n"), - u, u->host, u->service); + fprintf(stderr, _("warning: u %p ctrl %p nrefs != 0 (%s %s)\n"), + u, uctrl, u->host, u->service); } if (u->data) { + void * udata = u->data; if (fdio->fileno(u->data) >= 0) fdio->close(u->data); u->data = fdio->deref(u->data, "persist data (urlFree)", file, line); if (u->data) - fprintf(stderr, _("warning: data nrefs != 0 (%s %s)\n"), - u, u->host, u->service); + fprintf(stderr, _("warning: u %p data %p nrefs != 0 (%s %s)\n"), + u, udata, u->host, u->service); } if (u->buf) { free(u->buf); diff --git a/po/rpm.pot b/po/rpm.pot index 40198d335..01fcb3fbe 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-12 11:09-0500\n" +"POT-Creation-Date: 1999-11-14 12:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -90,7 +90,7 @@ msgstr "" msgid "override build root" msgstr "" -#: build.c:374 rpm.c:482 +#: build.c:374 rpm.c:484 msgid "remove build tree when done" msgstr "" @@ -110,7 +110,7 @@ msgstr "" msgid "remove specfile when done" msgstr "" -#: build.c:384 rpm.c:480 +#: build.c:384 rpm.c:482 msgid "skip straight to specified stage (only for c,i)" msgstr "" @@ -164,1082 +164,1092 @@ msgstr "" msgid "no copyright!\n" msgstr "" -#: rpm.c:184 +#: rpm.c:186 #, c-format msgid "rpm: %s\n" msgstr "" -#: rpm.c:195 +#: rpm.c:197 #, c-format msgid "RPM version %s\n" msgstr "" -#: rpm.c:199 +#: rpm.c:201 msgid "Copyright (C) 1998 - Red Hat Software" msgstr "" -#: rpm.c:200 +#: rpm.c:202 msgid "This may be freely redistributed under the terms of the GNU GPL" msgstr "" -#: rpm.c:208 +#: rpm.c:210 msgid "usage: rpm {--help}" msgstr "" -#: rpm.c:209 +#: rpm.c:211 msgid " rpm {--version}" msgstr "" -#: rpm.c:210 +#: rpm.c:212 msgid " rpm {--initdb} [--dbpath ]" msgstr "" -#: rpm.c:211 +#: rpm.c:213 msgid "" " rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: rpm.c:212 +#: rpm.c:214 msgid " [--replacepkgs] [--replacefiles] [--root ]" msgstr "" -#: rpm.c:213 -msgid " [--excludedocs] [--includedocs] [--noscripts]" -msgstr "" - -#: rpm.c:214 -msgid "" -" [--rcfile ] [--ignorearch] [--dbpath ]" -msgstr "" - #: rpm.c:215 -msgid "" -" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +msgid " [--excludedocs] [--includedocs] [--noscripts]" msgstr "" #: rpm.c:216 msgid "" +" [--rcfile ] [--ignorearch] [--dbpath ]" +msgstr "" + +#: rpm.c:217 +msgid "" +" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +msgstr "" + +#: rpm.c:218 +msgid "" " [--ftpproxy ] [--ftpport ] [--justdb]" msgstr "" -#: rpm.c:217 rpm.c:226 rpm.c:235 +#: rpm.c:219 rpm.c:228 rpm.c:237 msgid " [--httpproxy ] [--httpport ] " msgstr "" -#: rpm.c:218 rpm.c:228 +#: rpm.c:220 rpm.c:230 msgid " [--noorder] [--relocate oldpath=newpath]" msgstr "" -#: rpm.c:219 -msgid "" -" [--badreloc] [--notriggers] [--excludepath ]" -msgstr "" - -#: rpm.c:220 -msgid " [--ignoresize] file1.rpm ... fileN.rpm" -msgstr "" - #: rpm.c:221 msgid "" -" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]" +" [--badreloc] [--notriggers] [--excludepath ]" msgstr "" #: rpm.c:222 -msgid " [--oldpackage] [--root ] [--noscripts]" +msgid " [--ignoresize] file1.rpm ... fileN.rpm" msgstr "" #: rpm.c:223 msgid "" -" [--excludedocs] [--includedocs] [--rcfile ]" +" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" #: rpm.c:224 +msgid " [--oldpackage] [--root ] [--noscripts]" +msgstr "" + +#: rpm.c:225 +msgid "" +" [--excludedocs] [--includedocs] [--rcfile ]" +msgstr "" + +#: rpm.c:226 msgid "" " [--ignorearch] [--dbpath ] [--prefix ] " msgstr "" -#: rpm.c:225 +#: rpm.c:227 msgid " [--ftpproxy ] [--ftpport ]" msgstr "" -#: rpm.c:227 +#: rpm.c:229 msgid " [--ignoreos] [--nodeps] [--allfiles] [--justdb]" msgstr "" -#: rpm.c:229 +#: rpm.c:231 msgid "" " [--badreloc] [--excludepath ] [--ignoresize]" msgstr "" -#: rpm.c:230 +#: rpm.c:232 msgid " file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:231 +#: rpm.c:233 msgid " rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]" msgstr "" -#: rpm.c:232 +#: rpm.c:234 msgid " [--scripts] [--root ] [--rcfile ]" msgstr "" -#: rpm.c:233 +#: rpm.c:235 msgid " [--whatprovides] [--whatrequires] [--requires]" msgstr "" -#: rpm.c:234 -msgid "" -" [--triggeredby] [--ftpuseport] [--ftpproxy ]" -msgstr "" - #: rpm.c:236 msgid "" -" [--ftpport ] [--provides] [--triggers] [--dump]" -msgstr "" - -#: rpm.c:237 -msgid " [--changelog] [--dbpath ] [targets]" +" [--triggeredby] [--ftpuseport] [--ftpproxy ]" msgstr "" #: rpm.c:238 -msgid " rpm {--verify -V -y} [-afpg] [--root ] [--rcfile ]" +msgid "" +" [--ftpport ] [--provides] [--triggers] [--dump]" msgstr "" #: rpm.c:239 +msgid " [--changelog] [--dbpath ] [targets]" +msgstr "" + +#: rpm.c:240 +msgid " rpm {--verify -V -y} [-afpg] [--root ] [--rcfile ]" +msgstr "" + +#: rpm.c:241 msgid "" " [--dbpath ] [--nodeps] [--nofiles] [--noscripts]" msgstr "" -#: rpm.c:240 +#: rpm.c:242 msgid " [--nomd5] [targets]" msgstr "" -#: rpm.c:241 +#: rpm.c:243 msgid " rpm {--setperms} [-afpg] [target]" msgstr "" -#: rpm.c:242 +#: rpm.c:244 msgid " rpm {--setugids} [-afpg] [target]" msgstr "" -#: rpm.c:243 +#: rpm.c:245 msgid " rpm {--freshen -F} file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:244 +#: rpm.c:246 msgid " rpm {--erase -e} [--root ] [--noscripts] [--rcfile ]" msgstr "" -#: rpm.c:245 +#: rpm.c:247 msgid " [--dbpath ] [--nodeps] [--allmatches]" msgstr "" -#: rpm.c:246 +#: rpm.c:248 msgid "" " [--justdb] [--notriggers] rpackage1 ... packageN" msgstr "" -#: rpm.c:247 +#: rpm.c:249 msgid "" " rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]" msgstr "" -#: rpm.c:248 +#: rpm.c:250 msgid " [--sign] [--nobuild] [--timecheck ] ]" msgstr "" -#: rpm.c:249 +#: rpm.c:251 msgid " [--target=platform1[,platform2...]]" msgstr "" -#: rpm.c:250 +#: rpm.c:252 msgid " [--rmsource] [--rmspec] specfile" msgstr "" -#: rpm.c:251 +#: rpm.c:253 msgid " rpm {--rmsource} [--rcfile ] [-v] specfile" msgstr "" -#: rpm.c:252 +#: rpm.c:254 msgid "" " rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" -#: rpm.c:253 +#: rpm.c:255 msgid "" " rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" -#: rpm.c:254 +#: rpm.c:256 msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" msgstr "" -#: rpm.c:255 +#: rpm.c:257 msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" msgstr "" -#: rpm.c:256 +#: rpm.c:258 msgid "" " rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile ]" msgstr "" -#: rpm.c:257 +#: rpm.c:259 msgid " package1 ... packageN" msgstr "" -#: rpm.c:258 +#: rpm.c:260 msgid " rpm {--rebuilddb} [--rcfile ] [--dbpath ]" msgstr "" -#: rpm.c:259 +#: rpm.c:261 msgid " rpm {--querytags}" msgstr "" -#: rpm.c:293 +#: rpm.c:295 msgid "usage:" msgstr "" -#: rpm.c:295 +#: rpm.c:297 msgid "print this message" msgstr "" -#: rpm.c:297 +#: rpm.c:299 msgid "print the version of rpm being used" msgstr "" -#: rpm.c:298 +#: rpm.c:300 msgid " all modes support the following arguments:" msgstr "" -#: rpm.c:299 +#: rpm.c:301 msgid " --rcfile " msgstr "" -#: rpm.c:300 +#: rpm.c:302 msgid "use instead of /etc/rpmrc and $HOME/.rpmrc" msgstr "" -#: rpm.c:302 +#: rpm.c:304 msgid "be a little more verbose" msgstr "" -#: rpm.c:304 +#: rpm.c:306 msgid "be incredibly verbose (for debugging)" msgstr "" -#: rpm.c:306 +#: rpm.c:308 msgid "query mode" msgstr "" -#: rpm.c:307 rpm.c:369 rpm.c:433 rpm.c:461 +#: rpm.c:309 rpm.c:371 rpm.c:435 rpm.c:463 msgid " --root " msgstr "" -#: rpm.c:308 rpm.c:370 rpm.c:434 rpm.c:462 rpm.c:524 +#: rpm.c:310 rpm.c:372 rpm.c:436 rpm.c:464 rpm.c:526 msgid "use as the top level directory" msgstr "" -#: rpm.c:309 rpm.c:367 rpm.c:397 rpm.c:449 rpm.c:521 +#: rpm.c:311 rpm.c:369 rpm.c:399 rpm.c:451 rpm.c:523 msgid " --dbpath " msgstr "" -#: rpm.c:310 rpm.c:368 rpm.c:398 rpm.c:450 rpm.c:522 +#: rpm.c:312 rpm.c:370 rpm.c:400 rpm.c:452 rpm.c:524 msgid "use as the directory for the database" msgstr "" -#: rpm.c:311 +#: rpm.c:313 msgid " --queryformat " msgstr "" -#: rpm.c:312 +#: rpm.c:314 msgid "use as the header format (implies -i)" msgstr "" -#: rpm.c:313 +#: rpm.c:315 msgid "" " install, upgrade and query (with -p) allow ftp URL's to be used in place" msgstr "" -#: rpm.c:314 +#: rpm.c:316 msgid " of file names as well as the following options:" msgstr "" -#: rpm.c:315 +#: rpm.c:317 msgid " --ftpproxy " msgstr "" -#: rpm.c:316 +#: rpm.c:318 msgid "hostname or IP of ftp proxy" msgstr "" -#: rpm.c:317 +#: rpm.c:319 msgid " --ftpport " msgstr "" -#: rpm.c:318 +#: rpm.c:320 msgid "port number of ftp server (or proxy)" msgstr "" -#: rpm.c:319 +#: rpm.c:321 msgid " --httpproxy " msgstr "" -#: rpm.c:320 +#: rpm.c:322 msgid "hostname or IP of http proxy" msgstr "" -#: rpm.c:321 +#: rpm.c:323 msgid " --httpport " msgstr "" -#: rpm.c:322 +#: rpm.c:324 msgid "port number of http server (or proxy)" msgstr "" -#: rpm.c:323 +#: rpm.c:325 msgid " Package specification options:" msgstr "" -#: rpm.c:325 +#: rpm.c:327 msgid "query all packages" msgstr "" -#: rpm.c:326 +#: rpm.c:328 msgid " -f + " msgstr "" -#: rpm.c:327 +#: rpm.c:329 msgid "query package owning " msgstr "" -#: rpm.c:328 +#: rpm.c:330 msgid " -p + " msgstr "" -#: rpm.c:329 +#: rpm.c:331 msgid "query (uninstalled) package " msgstr "" -#: rpm.c:330 +#: rpm.c:332 msgid " --triggeredby " msgstr "" -#: rpm.c:331 +#: rpm.c:333 msgid "query packages triggered by " msgstr "" -#: rpm.c:332 +#: rpm.c:334 msgid " --whatprovides " msgstr "" -#: rpm.c:333 +#: rpm.c:335 msgid "query packages which provide capability" msgstr "" -#: rpm.c:334 +#: rpm.c:336 msgid " --whatrequires " msgstr "" -#: rpm.c:335 +#: rpm.c:337 msgid "query packages which require capability" msgstr "" -#: rpm.c:336 +#: rpm.c:338 msgid " Information selection options:" msgstr "" -#: rpm.c:338 +#: rpm.c:340 msgid "display package information" msgstr "" -#: rpm.c:340 +#: rpm.c:342 msgid "display the package's change log" msgstr "" -#: rpm.c:342 +#: rpm.c:344 msgid "display package file list" msgstr "" -#: rpm.c:344 +#: rpm.c:346 msgid "show file states (implies -l)" msgstr "" -#: rpm.c:346 +#: rpm.c:348 msgid "list only documentation files (implies -l)" msgstr "" -#: rpm.c:348 +#: rpm.c:350 msgid "list only configuration files (implies -l)" msgstr "" -#: rpm.c:350 +#: rpm.c:352 msgid "" "show all verifiable information for each file (must be used with -l, -c, or " "-d)" msgstr "" -#: rpm.c:352 +#: rpm.c:354 msgid "list capabilities package provides" msgstr "" -#: rpm.c:353 +#: rpm.c:355 msgid " --requires" msgstr "" -#: rpm.c:355 +#: rpm.c:357 msgid "list package dependencies" msgstr "" -#: rpm.c:357 +#: rpm.c:359 msgid "print the various [un]install scripts" msgstr "" -#: rpm.c:359 +#: rpm.c:361 msgid "show the trigger scripts contained in the package" msgstr "" -#: rpm.c:363 +#: rpm.c:365 msgid " --pipe " msgstr "" -#: rpm.c:364 +#: rpm.c:366 msgid "send stdout to " msgstr "" -#: rpm.c:366 +#: rpm.c:368 msgid "" "verify a package installation using the same same package specification " "options as -q" msgstr "" -#: rpm.c:372 rpm.c:420 rpm.c:454 +#: rpm.c:374 rpm.c:422 rpm.c:456 msgid "do not verify package dependencies" msgstr "" -#: rpm.c:374 +#: rpm.c:376 msgid "do not verify file md5 checksums" msgstr "" -#: rpm.c:376 +#: rpm.c:378 msgid "do not verify file attributes" msgstr "" -#: rpm.c:379 +#: rpm.c:381 msgid "" "set the file permissions to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:382 +#: rpm.c:384 msgid "" "set the file owner and group to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:386 +#: rpm.c:388 msgid " --install " msgstr "" -#: rpm.c:387 +#: rpm.c:389 msgid " -i " msgstr "" -#: rpm.c:388 +#: rpm.c:390 msgid "install package" msgstr "" -#: rpm.c:389 +#: rpm.c:391 msgid " --excludepath " msgstr "" -#: rpm.c:390 +#: rpm.c:392 msgid "skip files in path " msgstr "" -#: rpm.c:391 +#: rpm.c:393 msgid " --relocate =" msgstr "" -#: rpm.c:392 +#: rpm.c:394 msgid "relocate files from to " msgstr "" -#: rpm.c:394 +#: rpm.c:396 msgid "relocate files even though the package doesn't allow it" msgstr "" -#: rpm.c:395 +#: rpm.c:397 msgid " --prefix " msgstr "" -#: rpm.c:396 +#: rpm.c:398 msgid "relocate the package to , if relocatable" msgstr "" -#: rpm.c:400 +#: rpm.c:402 msgid "do not install documentation" msgstr "" -#: rpm.c:402 +#: rpm.c:404 msgid "short hand for --replacepkgs --replacefiles" msgstr "" -#: rpm.c:405 +#: rpm.c:407 msgid "print hash marks as package installs (good with -v)" msgstr "" -#: rpm.c:407 +#: rpm.c:409 msgid "install all files, even configurations which might otherwise be skipped" msgstr "" -#: rpm.c:410 +#: rpm.c:412 msgid "don't verify package architecture" msgstr "" -#: rpm.c:412 +#: rpm.c:414 msgid "don't check disk space before installing" msgstr "" -#: rpm.c:414 +#: rpm.c:416 msgid "don't verify package operating system" msgstr "" -#: rpm.c:416 +#: rpm.c:418 msgid "install documentation" msgstr "" -#: rpm.c:418 rpm.c:452 +#: rpm.c:420 rpm.c:454 msgid "update the database, but do not modify the filesystem" msgstr "" -#: rpm.c:422 rpm.c:456 +#: rpm.c:424 rpm.c:458 msgid "do not reorder package installation to satisfy dependencies" msgstr "" -#: rpm.c:424 +#: rpm.c:426 msgid "don't execute any installation scripts" msgstr "" -#: rpm.c:426 rpm.c:460 +#: rpm.c:428 rpm.c:462 msgid "don't execute any scripts triggered by this package" msgstr "" -#: rpm.c:428 +#: rpm.c:430 msgid "print percentages as package installs" msgstr "" -#: rpm.c:430 +#: rpm.c:432 msgid "install even if the package replaces installed files" msgstr "" -#: rpm.c:432 +#: rpm.c:434 msgid "reinstall if the package is already present" msgstr "" -#: rpm.c:436 +#: rpm.c:438 msgid "don't install, but tell if it would work or not" msgstr "" -#: rpm.c:438 +#: rpm.c:440 msgid " --upgrade " msgstr "" -#: rpm.c:439 +#: rpm.c:441 msgid " -U " msgstr "" -#: rpm.c:440 +#: rpm.c:442 msgid "upgrade package (same options as --install, plus)" msgstr "" -#: rpm.c:442 +#: rpm.c:444 msgid "" "upgrade to an old version of the package (--force on upgrades does this " "automatically)" msgstr "" -#: rpm.c:444 +#: rpm.c:446 msgid " --erase " msgstr "" -#: rpm.c:446 +#: rpm.c:448 msgid "erase (uninstall) package" msgstr "" -#: rpm.c:448 +#: rpm.c:450 msgid "" "remove all packages which match (normally an error is generated if " " specified multiple packages)" msgstr "" -#: rpm.c:458 +#: rpm.c:460 msgid "do not execute any package specific scripts" msgstr "" -#: rpm.c:464 +#: rpm.c:466 msgid " -b " msgstr "" -#: rpm.c:465 +#: rpm.c:467 msgid " -t " msgstr "" -#: rpm.c:466 +#: rpm.c:468 msgid "build package, where is one of:" msgstr "" -#: rpm.c:468 +#: rpm.c:470 msgid "prep (unpack sources and apply patches)" msgstr "" -#: rpm.c:470 +#: rpm.c:472 #, c-format msgid "list check (do some cursory checks on %files)" msgstr "" -#: rpm.c:472 +#: rpm.c:474 msgid "compile (prep and compile)" msgstr "" -#: rpm.c:474 +#: rpm.c:476 msgid "install (prep, compile, install)" msgstr "" -#: rpm.c:476 +#: rpm.c:478 msgid "binary package (prep, compile, install, package)" msgstr "" -#: rpm.c:478 +#: rpm.c:480 msgid "bin/src package (prep, compile, install, package)" msgstr "" -#: rpm.c:484 +#: rpm.c:486 msgid "remove sources and spec file when done" msgstr "" -#: rpm.c:486 +#: rpm.c:488 msgid "generate PGP/GPG signature" msgstr "" -#: rpm.c:487 +#: rpm.c:489 msgid " --buildroot " msgstr "" -#: rpm.c:488 +#: rpm.c:490 msgid "use as the build root" msgstr "" -#: rpm.c:489 +#: rpm.c:491 msgid " --target=+" msgstr "" -#: rpm.c:490 +#: rpm.c:492 msgid "build the packages for the build targets platform1...platformN." msgstr "" -#: rpm.c:492 +#: rpm.c:494 msgid "do not execute any stages" msgstr "" -#: rpm.c:493 +#: rpm.c:495 msgid " --timecheck " msgstr "" -#: rpm.c:494 +#: rpm.c:496 msgid "set the time check to seconds (0 disables)" msgstr "" -#: rpm.c:496 +#: rpm.c:498 msgid " --rebuild " msgstr "" -#: rpm.c:497 +#: rpm.c:499 msgid "" "install source package, build binary package and remove spec file, sources, " "patches, and icons." msgstr "" -#: rpm.c:498 +#: rpm.c:500 msgid " --rmsource " msgstr "" -#: rpm.c:499 +#: rpm.c:501 msgid "remove sources and spec file" msgstr "" -#: rpm.c:500 +#: rpm.c:502 msgid " --recompile " msgstr "" -#: rpm.c:501 +#: rpm.c:503 msgid "like --rebuild, but don't build any package" msgstr "" -#: rpm.c:502 +#: rpm.c:504 msgid " --resign + " msgstr "" -#: rpm.c:503 +#: rpm.c:505 msgid "sign a package (discard current signature)" msgstr "" -#: rpm.c:504 +#: rpm.c:506 msgid " --addsign + " msgstr "" -#: rpm.c:505 +#: rpm.c:507 msgid "add a signature to a package" msgstr "" -#: rpm.c:507 +#: rpm.c:509 msgid " --checksig + " msgstr "" -#: rpm.c:508 +#: rpm.c:510 msgid "verify package signature" msgstr "" -#: rpm.c:510 +#: rpm.c:512 msgid "skip any PGP signatures" msgstr "" -#: rpm.c:512 +#: rpm.c:514 msgid "skip any GPG signatures" msgstr "" -#: rpm.c:514 +#: rpm.c:516 msgid "skip any MD5 signatures" msgstr "" -#: rpm.c:516 +#: rpm.c:518 msgid "list the tags that can be used in a query format" msgstr "" -#: rpm.c:518 +#: rpm.c:520 msgid "make sure a valid database exists" msgstr "" -#: rpm.c:520 +#: rpm.c:522 msgid "rebuild database from existing database" msgstr "" -#: rpm.c:665 rpm.c:671 rpm.c:678 rpm.c:684 rpm.c:693 rpm.c:700 rpm.c:747 -#: rpm.c:753 rpm.c:787 rpm.c:793 rpm.c:799 rpm.c:807 rpm.c:848 rpm.c:903 -#: rpm.c:910 +#: rpm.c:668 rpm.c:674 rpm.c:681 rpm.c:687 rpm.c:696 rpm.c:703 rpm.c:750 +#: rpm.c:756 rpm.c:790 rpm.c:796 rpm.c:802 rpm.c:810 rpm.c:851 rpm.c:906 +#: rpm.c:913 msgid "only one major mode may be specified" msgstr "" -#: rpm.c:686 +#: rpm.c:689 msgid "-u and --uninstall are deprecated and no longer work.\n" msgstr "" -#: rpm.c:688 +#: rpm.c:691 msgid "Use -e or --erase instead.\n" msgstr "" -#: rpm.c:704 +#: rpm.c:707 msgid "--build (-b) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: rpm.c:708 +#: rpm.c:711 msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: rpm.c:760 rpm.c:766 rpm.c:773 rpm.c:780 rpm.c:917 +#: rpm.c:763 rpm.c:769 rpm.c:776 rpm.c:783 rpm.c:920 msgid "one type of query/verify may be performed at a time" msgstr "" -#: rpm.c:817 +#: rpm.c:820 msgid "arguments to --dbpath must begin with a /" msgstr "" -#: rpm.c:854 +#: rpm.c:857 msgid "relocations must begin with a /" msgstr "" -#: rpm.c:856 +#: rpm.c:859 msgid "relocations must contain a =" msgstr "" -#: rpm.c:859 +#: rpm.c:862 msgid "relocations must have a / following the =" msgstr "" -#: rpm.c:868 +#: rpm.c:871 msgid "exclude paths must begin with a /" msgstr "" -#: rpm.c:877 +#: rpm.c:880 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: rpm.c:928 +#: rpm.c:931 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: rpm.c:932 +#: rpm.c:935 msgid "--timecheck may only be used during package builds" msgstr "" -#: rpm.c:935 +#: rpm.c:938 msgid "unexpected query flags" msgstr "" -#: rpm.c:938 +#: rpm.c:941 msgid "unexpected query format" msgstr "" -#: rpm.c:941 +#: rpm.c:944 msgid "unexpected query source" msgstr "" -#: rpm.c:947 +#: rpm.c:950 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: rpm.c:950 +#: rpm.c:953 msgid "files may only be relocated during package installation" msgstr "" -#: rpm.c:953 +#: rpm.c:956 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: rpm.c:956 +#: rpm.c:959 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: rpm.c:959 +#: rpm.c:962 msgid "--prefix may only be used when installing new packages" msgstr "" -#: rpm.c:962 +#: rpm.c:965 msgid "arguments to --prefix must begin with a /" msgstr "" -#: rpm.c:965 +#: rpm.c:968 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: rpm.c:969 +#: rpm.c:972 msgid "--percent may only be specified during package installation" msgstr "" -#: rpm.c:973 +#: rpm.c:976 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: rpm.c:977 +#: rpm.c:980 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: rpm.c:981 +#: rpm.c:984 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: rpm.c:985 +#: rpm.c:988 msgid "--includedocs may only be specified during package installation" msgstr "" -#: rpm.c:989 +#: rpm.c:992 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: rpm.c:993 +#: rpm.c:996 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: rpm.c:997 +#: rpm.c:1000 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: rpm.c:1001 +#: rpm.c:1004 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: rpm.c:1005 +#: rpm.c:1008 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: rpm.c:1009 +#: rpm.c:1012 msgid "--allfiles may only be specified during package installation" msgstr "" -#: rpm.c:1013 +#: rpm.c:1016 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: rpm.c:1018 +#: rpm.c:1021 msgid "" "--noscripts may only be specified during package installation, erasure, and " "verification" msgstr "" -#: rpm.c:1022 +#: rpm.c:1025 msgid "" "--notriggers may only be specified during package installation, erasure, and " "verification" msgstr "" -#: rpm.c:1026 +#: rpm.c:1029 msgid "" "--nodeps may only be specified during package building, installation, " "erasure, and verification" msgstr "" -#: rpm.c:1030 +#: rpm.c:1033 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: rpm.c:1034 +#: rpm.c:1037 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: rpm.c:1046 +#: rpm.c:1049 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: rpm.c:1052 +#: rpm.c:1055 msgid "--oldpackage may only be used during upgrades" msgstr "" -#: rpm.c:1057 +#: rpm.c:1060 msgid "" "ftp options can only be used during package queries, installs, and upgrades" msgstr "" -#: rpm.c:1063 +#: rpm.c:1066 msgid "" "http options can only be used during package queries, installs, and upgrades" msgstr "" -#: rpm.c:1067 +#: rpm.c:1070 msgid "--nopgp may only be used during signature checking" msgstr "" -#: rpm.c:1070 +#: rpm.c:1073 msgid "--nogpg may only be used during signature checking" msgstr "" -#: rpm.c:1073 +#: rpm.c:1076 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: rpm.c:1097 +#: rpm.c:1100 msgid "no files to sign\n" msgstr "" -#: rpm.c:1102 +#: rpm.c:1105 #, c-format msgid "cannot access file %s\n" msgstr "" -#: rpm.c:1117 +#: rpm.c:1120 msgid "pgp not found: " msgstr "" -#: rpm.c:1121 +#: rpm.c:1124 msgid "Enter pass phrase: " msgstr "" -#: rpm.c:1123 +#: rpm.c:1126 msgid "Pass phrase check failed\n" msgstr "" -#: rpm.c:1126 +#: rpm.c:1129 msgid "Pass phrase is good.\n" msgstr "" -#: rpm.c:1131 +#: rpm.c:1134 msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: rpm.c:1137 +#: rpm.c:1140 msgid "--sign may only be used during package building" msgstr "" -#: rpm.c:1152 +#: rpm.c:1155 msgid "exec failed\n" msgstr "" -#: rpm.c:1171 +#: rpm.c:1174 msgid "unexpected arguments to --querytags " msgstr "" -#: rpm.c:1182 +#: rpm.c:1185 msgid "no packages given for signature check" msgstr "" -#: rpm.c:1193 +#: rpm.c:1196 msgid "no packages given for signing" msgstr "" -#: rpm.c:1205 +#: rpm.c:1208 msgid "no packages files given for rebuild" msgstr "" -#: rpm.c:1268 +#: rpm.c:1271 msgid "no spec files given for build" msgstr "" -#: rpm.c:1270 +#: rpm.c:1273 msgid "no tar files given for build" msgstr "" -#: rpm.c:1286 +#: rpm.c:1289 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1336 +#: rpm.c:1339 msgid "no packages given for install" msgstr "" -#: rpm.c:1359 +#: rpm.c:1362 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1364 +#: rpm.c:1367 msgid "no arguments given for query" msgstr "" -#: rpm.c:1381 +#: rpm.c:1384 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1385 +#: rpm.c:1388 msgid "no arguments given for verify" msgstr "" -#: rpm2cpio.c:34 +#: rpm2cpio.c:22 +#, c-format +msgid "cannot open package: %s\n" +msgstr "" + +#: rpm2cpio.c:32 msgid "argument is not an RPM package\n" msgstr "" -#: rpm2cpio.c:38 +#: rpm2cpio.c:36 msgid "error reading header from package\n" msgstr "" -#: build/build.c:84 build/pack.c:267 +#: rpm2cpio.c:43 +#, c-format +msgid "cannot re-open payload: %s\n" +msgstr "" + +#: build/build.c:84 build/pack.c:272 msgid "Unable to open temp file" msgstr "" -#: build/build.c:123 +#: build/build.c:127 #, c-format msgid "Executing: %s\n" msgstr "" -#: build/build.c:143 +#: build/build.c:147 #, c-format msgid "Exec of %s failed (%s)" msgstr "" -#: build/build.c:149 +#: build/build.c:153 #, c-format msgid "Bad exit status from %s (%s)" msgstr "" @@ -1407,7 +1417,7 @@ msgstr "" msgid "Could not open %%files file %s: %s" msgstr "" -#: build/files.c:1191 build/pack.c:483 +#: build/files.c:1191 build/pack.c:497 #, c-format msgid "line: %s" msgstr "" @@ -1466,116 +1476,116 @@ msgstr "" msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: build/pack.c:130 +#: build/pack.c:131 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: build/pack.c:147 +#: build/pack.c:148 #, c-format msgid "cannot create %s: %s\n" msgstr "" -#: build/pack.c:184 +#: build/pack.c:186 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:194 +#: build/pack.c:196 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:215 +#: build/pack.c:217 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:221 +#: build/pack.c:223 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:278 +#: build/pack.c:289 msgid "Bad CSA data" msgstr "" -#: build/pack.c:312 +#: build/pack.c:328 #, c-format msgid "Could not open %s: %s\n" msgstr "" -#: build/pack.c:345 +#: build/pack.c:361 #, c-format msgid "Unable to write package: %s" msgstr "" -#: build/pack.c:360 +#: build/pack.c:376 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:376 +#: build/pack.c:392 #, c-format msgid "Unable to open sigtarget %s: %s" msgstr "" -#: build/pack.c:386 +#: build/pack.c:402 #, c-format msgid "Unable to read sigtarget %s: %s" msgstr "" -#: build/pack.c:396 +#: build/pack.c:412 #, c-format msgid "Unable to write package %s: %s" msgstr "" -#: build/pack.c:411 +#: build/pack.c:427 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:426 +#: build/pack.c:446 #, c-format msgid "create archive failed on file %s: %s" msgstr "" -#: build/pack.c:445 +#: build/pack.c:465 #, c-format msgid "cpio_copy write failed: %s" msgstr "" -#: build/pack.c:452 +#: build/pack.c:472 #, c-format msgid "cpio_copy read failed: %s" msgstr "" -#: build/pack.c:539 +#: build/pack.c:553 #, c-format msgid "Could not open PreIn file: %s" msgstr "" -#: build/pack.c:546 +#: build/pack.c:560 #, c-format msgid "Could not open PreUn file: %s" msgstr "" -#: build/pack.c:553 +#: build/pack.c:567 #, c-format msgid "Could not open PostIn file: %s" msgstr "" -#: build/pack.c:560 +#: build/pack.c:574 #, c-format msgid "Could not open PostUn file: %s" msgstr "" -#: build/pack.c:568 +#: build/pack.c:582 #, c-format msgid "Could not open VerifyScript file: %s" msgstr "" -#: build/pack.c:584 +#: build/pack.c:598 #, c-format msgid "Could not open Trigger script file: %s" msgstr "" @@ -1671,88 +1681,88 @@ msgstr "" msgid "Duplicate %s entries in package: %s" msgstr "" -#: build/parsePreamble.c:240 +#: build/parsePreamble.c:245 #, c-format msgid "Unable to stat icon: %s" msgstr "" -#: build/parsePreamble.c:250 +#: build/parsePreamble.c:253 #, c-format msgid "Unable to open icon %s: %s" msgstr "" -#: build/parsePreamble.c:257 +#: build/parsePreamble.c:271 #, c-format msgid "Unable to read icon %s: %s" msgstr "" -#: build/parsePreamble.c:270 +#: build/parsePreamble.c:284 #, c-format msgid "Unknown icon type: %s" msgstr "" -#: build/parsePreamble.c:333 +#: build/parsePreamble.c:347 #, c-format msgid "line %d: Malformed tag: %s" msgstr "" #. Empty field -#: build/parsePreamble.c:341 +#: build/parsePreamble.c:355 #, c-format msgid "line %d: Empty tag: %s" msgstr "" -#: build/parsePreamble.c:364 build/parsePreamble.c:371 +#: build/parsePreamble.c:378 build/parsePreamble.c:385 #, c-format msgid "line %d: Illegal char '-' in %s: %s" msgstr "" -#: build/parsePreamble.c:409 +#: build/parsePreamble.c:425 #, c-format msgid "line %d: BuildRoot can not be \"/\": %s" msgstr "" -#: build/parsePreamble.c:422 +#: build/parsePreamble.c:438 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s" msgstr "" -#: build/parsePreamble.c:434 +#: build/parsePreamble.c:450 #, c-format msgid "line %d: Docdir must begin with '/': %s" msgstr "" -#: build/parsePreamble.c:446 +#: build/parsePreamble.c:462 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s" msgstr "" -#: build/parsePreamble.c:509 +#: build/parsePreamble.c:525 #, c-format msgid "line %d: Bad BuildArchitecture format: %s" msgstr "" -#: build/parsePreamble.c:519 +#: build/parsePreamble.c:535 #, c-format msgid "Internal error: Bogus tag %d" msgstr "" -#: build/parsePreamble.c:665 +#: build/parsePreamble.c:681 #, c-format msgid "Bad package specification: %s" msgstr "" -#: build/parsePreamble.c:671 +#: build/parsePreamble.c:687 #, c-format msgid "Package already exists: %s" msgstr "" -#: build/parsePreamble.c:698 +#: build/parsePreamble.c:714 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: build/parsePreamble.c:723 +#: build/parsePreamble.c:739 msgid "Spec file can't use BuildRoot" msgstr "" @@ -1870,7 +1880,7 @@ msgstr "" #. XXX Fstrerror #: build/parseSpec.c:174 #, c-format -msgid "Unable to open: %s\n" +msgid "Unable to open %s: %s\n" msgstr "" #: build/parseSpec.c:186 @@ -2377,12 +2387,12 @@ msgid "Target buffer overflow" msgstr "" #. XXX Fstrerror -#: lib/macro.c:1367 lib/macro.c:1372 +#: lib/macro.c:1363 lib/macro.c:1368 #, c-format msgid "File %s: %s" msgstr "" -#: lib/macro.c:1375 +#: lib/macro.c:1371 #, c-format msgid "File %s is smaller than %d bytes" msgstr "" @@ -2403,7 +2413,7 @@ msgstr "" msgid "internal error (rpm bug?): " msgstr "" -#: lib/misc.c:415 lib/misc.c:421 lib/misc.c:432 +#: lib/misc.c:415 lib/misc.c:421 lib/misc.c:433 #, c-format msgid "error creating temporary file %s" msgstr "" @@ -2834,7 +2844,7 @@ msgstr "" msgid "opening database mode 0x%x in %s\n" msgstr "" -#: lib/rpmdb.c:155 lib/url.c:431 +#: lib/rpmdb.c:155 lib/url.c:433 #, c-format msgid "failed to open %s: %s\n" msgstr "" @@ -3028,59 +3038,59 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmio.c:340 +#: lib/rpmio.c:455 msgid "Success" msgstr "" -#: lib/rpmio.c:343 +#: lib/rpmio.c:458 msgid "Bad server response" msgstr "" -#: lib/rpmio.c:346 +#: lib/rpmio.c:461 msgid "Server IO error" msgstr "" -#: lib/rpmio.c:349 +#: lib/rpmio.c:464 msgid "Server timeout" msgstr "" -#: lib/rpmio.c:352 +#: lib/rpmio.c:467 msgid "Unable to lookup server host address" msgstr "" -#: lib/rpmio.c:355 +#: lib/rpmio.c:470 msgid "Unable to lookup server host name" msgstr "" -#: lib/rpmio.c:358 +#: lib/rpmio.c:473 msgid "Failed to connect to server" msgstr "" -#: lib/rpmio.c:361 +#: lib/rpmio.c:476 msgid "Failed to establish data connection to server" msgstr "" -#: lib/rpmio.c:364 +#: lib/rpmio.c:479 msgid "IO error to local file" msgstr "" -#: lib/rpmio.c:367 +#: lib/rpmio.c:482 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/rpmio.c:370 +#: lib/rpmio.c:485 msgid "File not found on server" msgstr "" -#: lib/rpmio.c:373 +#: lib/rpmio.c:488 msgid "Abort in progress" msgstr "" -#: lib/rpmio.c:377 +#: lib/rpmio.c:492 msgid "Unknown or unexpected error" msgstr "" -#: lib/rpmio.c:425 +#: lib/rpmio.c:541 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" @@ -3136,47 +3146,47 @@ msgid "Unable to open %s for reading: %s." msgstr "" #. XXX Feof(fd) -#: lib/rpmrc.c:600 +#: lib/rpmrc.c:601 #, c-format msgid "Failed to read %s: %s." msgstr "" -#: lib/rpmrc.c:637 +#: lib/rpmrc.c:638 #, c-format msgid "missing ':' (found 0x%02x) at %s:%d" msgstr "" -#: lib/rpmrc.c:654 lib/rpmrc.c:728 +#: lib/rpmrc.c:655 lib/rpmrc.c:729 #, c-format msgid "missing argument for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:671 lib/rpmrc.c:693 +#: lib/rpmrc.c:672 lib/rpmrc.c:694 #, c-format msgid "%s expansion failed at %s:%d \"%s\"" msgstr "" -#: lib/rpmrc.c:680 +#: lib/rpmrc.c:681 #, c-format msgid "cannot open %s at %s:%d: %s" msgstr "" -#: lib/rpmrc.c:720 +#: lib/rpmrc.c:721 #, c-format msgid "missing architecture for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:787 +#: lib/rpmrc.c:788 #, c-format msgid "bad option '%s' at %s:%d" msgstr "" -#: lib/rpmrc.c:1155 +#: lib/rpmrc.c:1156 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: lib/rpmrc.c:1156 +#: lib/rpmrc.c:1157 msgid "Please contact rpm-list@redhat.com\n" msgstr "" @@ -3379,37 +3389,37 @@ msgstr "" msgid "execution of script failed" msgstr "" -#: lib/url.c:71 +#: lib/url.c:72 #, c-format -msgid "warning: u %p ctrl nrefs != 0 (%s %s)\n" +msgid "warning: u %p ctrl %p nrefs != 0 (%s %s)\n" msgstr "" -#: lib/url.c:79 +#: lib/url.c:81 #, c-format -msgid "warning: data nrefs != 0 (%s %s)\n" +msgid "warning: u %p data %p nrefs != 0 (%s %s)\n" msgstr "" -#: lib/url.c:107 +#: lib/url.c:109 #, c-format msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n" msgstr "" -#: lib/url.c:206 +#: lib/url.c:208 #, c-format msgid "Password for %s@%s: " msgstr "" -#: lib/url.c:231 lib/url.c:257 +#: lib/url.c:233 lib/url.c:259 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: lib/url.c:395 +#: lib/url.c:397 msgid "url port must be a number\n" msgstr "" #. XXX Fstrerror -#: lib/url.c:454 +#: lib/url.c:456 #, c-format msgid "failed to create %s: %s\n" msgstr "" diff --git a/rpm.c b/rpm.c index 3128cbbf3..33498aa2e 100755 --- a/rpm.c +++ b/rpm.c @@ -70,6 +70,7 @@ static int initdb; static int justdb; static int noDeps; static int noGpg; +extern int noLibio; static int noMd5; static int noOrder; static int noPgp; @@ -132,6 +133,7 @@ static struct poptOption optionsTable[] = { { "justdb", '\0', 0, &justdb, 0, NULL, NULL}, { "nodeps", '\0', 0, &noDeps, 0, NULL, NULL}, { "nogpg", '\0', 0, &noGpg, 0, NULL, NULL}, + { "nolibio", '\0', 0, &noLibio, 0, NULL, NULL}, { "nomd5", '\0', 0, &noMd5, 0, NULL, NULL}, { "noorder", '\0', 0, &noOrder, 0, NULL, NULL}, { "nopgp", '\0', 0, &noPgp, 0, NULL, NULL}, @@ -581,6 +583,7 @@ int main(int argc, const char ** argv) justdb = 0; noDeps = 0; noGpg = 0; + noLibio = 0; noMd5 = 0; noOrder = 0; noPgp = 0; diff --git a/rpm2cpio.c b/rpm2cpio.c index 8c256355d..7bf8ca7be 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -7,10 +7,8 @@ int main(int argc, char **argv) { FD_t fdi, fdo; - Header hd; + Header h; int rc, isSource; - char buffer[1024]; - int ct; FD_t gzdi; setprogname(argv[0]); /* Retrofit glibc __progname */ @@ -20,13 +18,13 @@ int main(int argc, char **argv) fdi = Fopen(argv[1], "r.ufdio"); } - if (Fileno(fdi) < 0) { - perror("cannot open package"); + if (fdi == NULL || Ferror(fdi)) { + fprintf(stderr, _("cannot open package: %s\n"), Fstrerror(fdi)); exit(EXIT_FAILURE); } fdo = fdDup(STDOUT_FILENO); - rc = rpmReadPackageHeader(fdi, &hd, &isSource, NULL, NULL); + rc = rpmReadPackageHeader(fdi, &h, &isSource, NULL, NULL); switch (rc) { case 0: break; @@ -40,12 +38,15 @@ int main(int argc, char **argv) break; } -#ifdef DYING - gzdi = gzdFdopen(fdi, "r"); /* XXX gzdi == fdi */ -#else gzdi = Fdopen(fdi, "r.gzdio"); /* XXX gzdi == fdi */ -#endif + if (gzdi == NULL || Ferror(gzdi)) { + fprintf(stderr, _("cannot re-open payload: %s\n"), Fstrerror(gzdi)); + exit(EXIT_FAILURE); + } +#ifdef DYING + { char buffer[BUFSIZ]; + int ct; while ((ct = Fread(buffer, sizeof(buffer[0]), sizeof(buffer), gzdi)) > 0) { Fwrite(buffer, sizeof(buffer[0]), ct, fdo); } @@ -56,6 +57,12 @@ int main(int argc, char **argv) } else { rc = EXIT_SUCCESS; } + } +#else + rc = ufdCopy(gzdi, fdo); + rc = (rc <= 0) ? EXIT_FAILURE : EXIT_SUCCESS; + Fclose(fdo); +#endif Fclose(gzdi); /* XXX gzdi == fdi */ diff --git a/rpmio/macro.c b/rpmio/macro.c index 45e511196..b206e2c45 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1300,7 +1300,7 @@ initMacros(MacroContext *mc, const char *macrofiles) strncat(buf, mfile, sizeof(buf) - strlen(buf)); buf[sizeof(buf)-1] = '\0'; - fd = Fopen(buf, "r.ufdio"); + fd = Fopen(buf, "r.fpio"); if (fd == NULL || Ferror(fd)) continue; @@ -1357,11 +1357,7 @@ int isCompressed(const char *file, int *compressed) *compressed = COMPRESSED_NOT; -#ifdef DYING - fd = fdOpen(file, O_RDONLY, 0); -#else fd = Fopen(file, "r.ufdio"); -#endif if (fd == NULL || Ferror(fd)) { /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, Fstrerror(fd)); diff --git a/scripts/Makefile.in b/scripts/Makefile.in index c06577248..b3010cbfc 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -147,13 +147,13 @@ varprefix = @varprefix@ AUTOMAKE_OPTIONS = 1.4 foreign -EXTRA_DIST = convertrpmrc.sh find-lang.sh freshen.sh getpo.sh perl.prov perl.req vpkg-provides.sh +EXTRA_DIST = convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl freshen.sh get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff u_pkg.sh vpkg-provides.sh vpkg-provides2.sh installprefix = $(DESTDIR) configdir = ${prefix}/lib/rpm -config_SCRIPTS = convertrpmrc.sh find-lang.sh freshen.sh getpo.sh perl.prov perl.req vpkg-provides.sh +config_SCRIPTS = convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl freshen.sh get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff u_pkg.sh vpkg-provides.sh vpkg-provides2.sh mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 80f2c2ad7..b64eac7fd 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -761,7 +761,7 @@ rewriteBinaryRPM(char *fni, char *fno, message_list_ty *mlp) DPRINTF(99, ("rewriteBinaryRPM(\"%s\",\"%s\",%p)\n", fni, fno, mlp)); csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(fdio, "init (rewriteBinary)"); + csa->cpioFdIn = fdNew("init (rewriteBinary)"); csa->cpioList = NULL; csa->cpioCount = 0; csa->lead = &lead; /* XXX FIXME: exorcize lead/arch/os */ diff --git a/tools/rpminject.c b/tools/rpminject.c index da733c20a..c839e23ff 100644 --- a/tools/rpminject.c +++ b/tools/rpminject.c @@ -444,7 +444,7 @@ rewriteRPM(const char *fni, const char *fno, cmd_t *cmds[], int ncmds) int rc; csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(fdio, "init (rewriteRPM)"); + csa->cpioFdIn = fdNew("init (rewriteRPM)"); csa->cpioList = NULL; csa->cpioCount = 0; csa->lead = &lead; /* XXX FIXME: exorcize lead/arch/os */