diff --git a/build.c b/build.c index a42a67777..98362eab8 100644 --- a/build.c +++ b/build.c @@ -59,7 +59,8 @@ static int isSpecFile(const char *specfile) int count; int checking; - if (fdFileno((fd = ufdOpen(specfile, O_RDONLY, 0))) < 0) { + fd = ufdOpen(specfile, O_RDONLY, 0); + if (Ferror(fd)) { /* XXX Fstrerror */ fprintf(stderr, _("Unable to open spec file: %s\n"), specfile); return 0; diff --git a/build/build.c b/build/build.c index 0e4961111..c3832f2e9 100644 --- a/build/build.c +++ b/build/build.c @@ -84,7 +84,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) return RPMERR_SCRIPT; } #ifdef HAVE_FCHMOD - (void)fchmod(fdFileno(fd), 0600); + (void)fchmod(Fileno(fd), 0600); #endif f = fdFdopen(fd, "w"); diff --git a/build/pack.c b/build/pack.c index 143cd7712..11ec1710a 100644 --- a/build/pack.c +++ b/build/pack.c @@ -183,7 +183,9 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sig int rc; if (fileName != NULL) { - if (fdFileno(fdi = fdOpen(fileName, O_RDONLY, 0644)) < 0) { + fdi = fdOpen(fileName, O_RDONLY, 0644); + if (Ferror(fdi)) { + /* XXX Fstrerror */ rpmError(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"), fileName, strerror(errno)); return RPMERR_BADMAGIC; @@ -249,7 +251,7 @@ int writeRPM(Header h, const char *fileName, int type, Header sig; struct rpmlead lead; - if (fdFileno(csa->cpioFdIn) < 0) { + if (Fileno(csa->cpioFdIn) < 0) { csa->cpioArchiveSize = 0; /* Add a bogus archive size to the Header */ headerAddEntry(h, RPMTAG_ARCHIVESIZE, RPM_INT32_TYPE, @@ -275,7 +277,7 @@ int writeRPM(Header h, const char *fileName, int type, } else { /* Write the archive and get the size */ if (csa->cpioList != NULL) { rc = cpio_gzip(fd, csa); - } else if (fdFileno(csa->cpioFdIn) >= 0) { + } else if (Fileno(csa->cpioFdIn) >= 0) { rc = cpio_copy(fd, csa); } else { rpmError(RPMERR_CREATE, _("Bad CSA data")); @@ -290,7 +292,7 @@ int writeRPM(Header h, const char *fileName, int type, } /* Now set the real archive size in the Header */ - if (fdFileno(csa->cpioFdIn) < 0) { + if (Fileno(csa->cpioFdIn) < 0) { headerModifyEntry(h, RPMTAG_ARCHIVESIZE, RPM_INT32_TYPE, &csa->cpioArchiveSize, 1); } @@ -310,7 +312,9 @@ int writeRPM(Header h, const char *fileName, int type, } /* Open the output file */ - if (fdFileno(fd = fdOpen(fileName, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) { + fd = fdOpen(fileName, O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (Ferror(fd)) { + /* XXX Fstrerror */ rpmError(RPMERR_CREATE, _("Could not open %s\n"), fileName); unlink(sigtarget); xfree(sigtarget); @@ -323,7 +327,7 @@ int writeRPM(Header h, const char *fileName, int type, sprintf(buf, "%s-%s-%s", name, version, release); } - if (fdFileno(csa->cpioFdIn) < 0) { + if (Fileno(csa->cpioFdIn) < 0) { rpmGetArchInfo(NULL, &archnum); rpmGetOsInfo(NULL, &osnum); } else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */ @@ -412,7 +416,7 @@ static int cpio_bzip2(FD_t fdo, CSA_t *csa) int rc; const char *failedFile = NULL; - cfd = bzdFdopen(fdDup(fdFileno(fdo)), "w9"); + cfd = bzdFdopen(fdDup(Fileno(fdo)), "w9"); rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, &csa->cpioArchiveSize, &failedFile); if (rc) { @@ -435,7 +439,7 @@ static int cpio_gzip(FD_t fdo, CSA_t *csa) int rc; const char *failedFile = NULL; - cfd = gzdFdopen(fdDup(fdFileno(fdo)), "w9"); + cfd = gzdFdopen(fdDup(Fileno(fdo)), "w9"); 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 7de63bbe8..62029ae0c 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -246,7 +246,7 @@ static int readIcon(Header h, const char *file) *icon = '\0'; fd = fdOpen(fn, O_RDONLY, 0); /* XXX Fstrerror */ - /* XXX fdFileno check */ + /* XXX Ferror check */ nb = Fread(icon, statbuf.st_size, 1, fd); Fclose(fd); if (nb != statbuf.st_size) { diff --git a/lib/cpio.c b/lib/cpio.c index fd6ed186b..86258d6cd 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -343,7 +343,7 @@ static int expandRegular(FD_t cfd, struct cpioHeader * hdr, } ofd = fdOpen(hdr->path, O_CREAT | O_WRONLY, 0); - if (fdFileno(ofd) < 0) + if (Ferror(ofd)) return CPIOERR_OPEN_FAILED; cbInfo.file = hdr->path; @@ -747,12 +747,13 @@ static int writeFile(FD_t cfd, struct stat sb, struct cpioFileMapping * map, size_t nmapped; #endif - if (fdFileno(datafd = fdOpen(map->fsPath, O_RDONLY, 0)) < 0) + datafd = fdOpen(map->fsPath, O_RDONLY, 0); + if (Ferror(datafd)) return CPIOERR_OPEN_FAILED; #if HAVE_MMAP nmapped = 0; - mapped = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fdFileno(datafd), 0); + mapped = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, Fileno(datafd), 0); if (mapped != (void *)-1) { b = (char *)mapped; nmapped = sb.st_size; diff --git a/lib/falloc.c b/lib/falloc.c index 646eeedd9..9aca52f4b 100644 --- a/lib/falloc.c +++ b/lib/falloc.c @@ -55,7 +55,7 @@ int faClose(faFile fa) { } int faFcntl(faFile fa, int op, void *lip) { - return fcntl(fdFileno(faFileno(fa)), op, lip); + return fcntl(Fileno(faFileno(fa)), op, lip); } static inline ssize_t faPRead(faFile fa, /*@out@*/void *buf, size_t count, off_t offset) { @@ -80,7 +80,7 @@ faFile faOpen(const char * path, int flags, int perms) return NULL; fa = ufdOpen(path, flags, perms); - if (fdFileno(faFileno(fa)) < 0) + if (Ferror(faFileno(fa))) /* XXX Fstrerror */ return NULL; diff --git a/lib/formats.c b/lib/formats.c index 58e287811..26801cb61 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -208,7 +208,7 @@ static int fssizesTag(Header h, int_32 * type, void ** data, int_32 * count, numFiles = 0; filenames = NULL; } else { - buildFileList(h, (char ***) &filenames, &numFiles); + buildFileList(h, &filenames, &numFiles); } if (rpmGetFilesystemList(NULL, count)) { @@ -339,10 +339,10 @@ static int filenamesTag(Header h, int_32 * type, /*@out@*/void ** data, int_32 * count, int * freeData) { *type = RPM_STRING_ARRAY_TYPE; - buildFileList(h, (char ***) data, count); + buildFileList(h, (const char ***) data, count); *freeData = 1; - *freeData = 0; + *freeData = 0; /* XXX WTFO? */ return 0; } diff --git a/lib/ftp.c b/lib/ftp.c index 85b313899..0e84ce200 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -442,12 +442,12 @@ static int copyData( /*@only@*/ FD_t sfd, FD_t tfd) { while (1) { FD_ZERO(&emptySet); FD_ZERO(&readSet); - FD_SET(fdFileno(sfd), &readSet); + FD_SET(Fileno(sfd), &readSet); timeout.tv_sec = ftpTimeoutSecs; timeout.tv_usec = 0; - rc = select(fdFileno(sfd) + 1, &readSet, &emptySet, &emptySet, &timeout); + rc = select(Fileno(sfd) + 1, &readSet, &emptySet, &emptySet, &timeout); if (rc == 0) { rc = FTPERR_SERVER_TIMEOUT; break; @@ -506,8 +506,8 @@ fprintf(stderr, "-> ABOR\n"); u->ftpControl = -1; return FTPERR_SERVER_IO_ERROR; } - if (fdFileno(fd) >= 0) { - while(read(fdFileno(fd), buf, sizeof(buf)) > 0) + if (Fileno(fd) >= 0) { + while(read(Fileno(fd), buf, sizeof(buf)) > 0) ; } @@ -518,7 +518,7 @@ fprintf(stderr, "-> ABOR\n"); rc = ftpCheckResponse(u, NULL); ftpTimeoutSecs = tosecs; - if (fdFileno(fd) >= 0) + if (Fileno(fd) >= 0) Fclose(fd); return 0; } @@ -597,15 +597,14 @@ fprintf(stderr, "-> PASV\n"); return FTPERR_PASSIVE_ERROR; fd->fd_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - if (fdFileno(fd) < 0) { + if (Fileno(fd) < 0) return FTPERR_FAILED_CONNECT; - } retrCommand = alloca(strlen(remotename) + 20); sprintf(retrCommand, "RETR %s\r\n", remotename); i = strlen(retrCommand); - while (connect(fdFileno(fd), (struct sockaddr *) &dataAddress, + while (connect(Fileno(fd), (struct sockaddr *) &dataAddress, sizeof(dataAddress)) < 0) { if (errno == EINTR) continue; @@ -641,7 +640,7 @@ int ftpGetFile(FD_t sfd, FD_t tfd) u = (urlinfo *)sfd->fd_url; /* XXX normally sfd = ufdOpen(...) and this code does not execute */ - if (fdFileno(sfd) < 0 && (rc = ftpGetFileDesc(sfd)) < 0) { + if (Fileno(sfd) < 0 && (rc = ftpGetFileDesc(sfd)) < 0) { Fclose(sfd); return rc; } diff --git a/lib/install.c b/lib/install.c index aacb1447f..0073f2572 100644 --- a/lib/install.c +++ b/lib/install.c @@ -108,12 +108,12 @@ static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr, if (!headerIsEntry(h, RPMTAG_COMPFILELIST)) return 0; - buildFileList(h, (char ***) &mem->names, fileCountPtr); + buildFileList(h, &mem->names, fileCountPtr); if (headerIsEntry(h, RPMTAG_ORIGCOMPFILELIST)) { - buildOrigFileList(h, (char ***) &mem->cpioNames, fileCountPtr); + buildOrigFileList(h, &mem->cpioNames, fileCountPtr); } else { - buildFileList(h, (char ***) &mem->cpioNames, fileCountPtr); + buildFileList(h, &mem->cpioNames, fileCountPtr); } fileCount = *fileCountPtr; @@ -342,7 +342,7 @@ static int installArchive(FD_t fd, struct fileInfo * files, (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, notifyData); - cfd = gzdFdopen(fdDup(fdFileno(fd)), "r"); + cfd = gzdFdopen(fdDup(Fileno(fd)), "r"); rc = cpioInstallArchive(cfd, map, mappedFiles, ((notify && archiveSize) || specFile) ? callback : NULL, &info, &failedFile); diff --git a/lib/macro.c b/lib/macro.c index 5980ecd3e..afc0aca66 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -25,7 +25,7 @@ #define _(x) x #define xfree(_p) free((void *)_p) typedef int FD_t; -#define fdFileno(_x) (_x) +#define Ferror(_x) (_x) #define fdOpen open #define Fread(_b, _s, _n, _fd) read(_fd, _b, _s) #define Fclose(_fd) close(_fd) @@ -1341,7 +1341,9 @@ int isCompressed(const char *file, int *compressed) *compressed = COMPRESSED_NOT; - if (fdFileno(fd = fdOpen(file, O_RDONLY, 0)) < 0) { + fd = fdOpen(file, O_RDONLY, 0); + if (Ferror(fd)) { + /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno)); return 1; } diff --git a/lib/misc.c b/lib/misc.c index 7ea8cd999..e8cac8c59 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -361,7 +361,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { if (fn) xfree(fn); fn = rpmGetPath(prefix, "%{_tmppath}/", tfn, NULL); fd = fdOpen(fn, O_CREAT | O_RDWR | O_EXCL, 0700); - } while (fdFileno(fd) < 0 && errno == EEXIST); + } while (Ferror(fd) && errno == EEXIST); if (!stat(fn, &sb) && S_ISLNK(sb.st_mode)) { rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), fn); @@ -375,7 +375,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { return 1; } - fstat(fdFileno(fd), &sb2); + fstat(Fileno(fd), &sb2); if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) { rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), fn); xfree(fn); @@ -412,7 +412,6 @@ void compressFilelist(Header h) { const char ** baseNames; int fileCount; int i; - char * tail; int lastDir = -1; int lastLen = -1; @@ -465,7 +464,7 @@ void compressFilelist(Header h) { /* this is pretty straight-forward. The only thing that even resembles a trick is getting all of this into a single xmalloc'd block */ -static void doBuildFileList(Header h, /*@out@*/ char *** fileListPtr, +static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, /*@out@*/ int * fileCountPtr, int baseNameTag, int dirListTag, int dirIndexesTag) { int * dirList; @@ -508,12 +507,14 @@ static void doBuildFileList(Header h, /*@out@*/ char *** fileListPtr, free(dirs); } -void buildFileList(Header h, char *** fileListPtr, int * fileCountPtr) { +void buildFileList(Header h, const char *** fileListPtr, int * fileCountPtr) +{ doBuildFileList(h, fileListPtr, fileCountPtr, RPMTAG_COMPFILELIST, RPMTAG_COMPDIRLIST, RPMTAG_COMPFILEDIRS); } -void buildOrigFileList(Header h, char *** fileListPtr, int * fileCountPtr) { +void buildOrigFileList(Header h, const char *** fileListPtr, int * fileCountPtr) +{ doBuildFileList(h, fileListPtr, fileCountPtr, RPMTAG_ORIGCOMPFILELIST, RPMTAG_ORIGCOMPDIRLIST, RPMTAG_ORIGCOMPFILEDIRS); } diff --git a/lib/misc.h b/lib/misc.h index 7d263908f..4b8e85071 100644 --- a/lib/misc.h +++ b/lib/misc.h @@ -36,9 +36,9 @@ int makeTempFile(const char * prefix, /*@out@*/ const char ** fnptr, /*@out@*/ FD_t * fdptr); char * currentDirectory(void); /* result needs to be freed */ void compressFilelist(Header h); -void buildFileList(Header h, /*@out@*/ char *** fileListPtr, +void buildFileList(Header h, /*@out@*/ const char *** fileListPtr, /*@out@*/ int * fileCountPtr); -void buildOrigFileList(Header h, /*@out@*/ char *** fileListPtr, +void buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr, /*@out@*/ int * fileCountPtr); #ifdef __cplusplus diff --git a/lib/oldheader.c b/lib/oldheader.c index 9e24d9a6e..7f69634bd 100644 --- a/lib/oldheader.c +++ b/lib/oldheader.c @@ -146,7 +146,9 @@ char * oldhdrReadFromFile(char * filename, struct oldrpmHeader * header) { FD_t fd; fd = fdOpen(filename, O_RDONLY, 0); - if (fdFileno(fd) < 0) return strerror(errno); + if (Ferror(fd)) + /* XXX Fstrerror */ + return strerror(errno); rc = oldhdrReadFromStream(fd, header); Fclose(fd); diff --git a/lib/package.c b/lib/package.c index 44a0b3403..53af5b77a 100644 --- a/lib/package.c +++ b/lib/package.c @@ -218,7 +218,7 @@ static int readPackageHeaders(FD_t fd, /*@out@*/struct rpmlead * leadPtr, hdr = hdrPtr ? hdrPtr : &hdrBlock; lead = leadPtr ? leadPtr : &leadBlock; - fstat(fdFileno(fd), &sb); + fstat(Fileno(fd), &sb); /* if fd points to a socket, pipe, etc, sb.st_size is *always* zero */ if (S_ISREG(sb.st_mode) && sb.st_size < sizeof(*lead)) return 1; diff --git a/lib/query.c b/lib/query.c index 865c47604..aa7e8b22c 100644 --- a/lib/query.c +++ b/lib/query.c @@ -459,16 +459,17 @@ int rpmQueryVerify(QVA_t *qva, enum rpmQVSources source, const char * arg, { FD_t fd; fd = ufdOpen(arg, O_RDONLY, 0); - if (fdFileno(fd) < 0) { + if (Ferror(fd)) { + /* XXX Fstrerror */ fprintf(stderr, _("open of %s failed: %s\n"), arg,urlStrerror(arg)); - ufdClose(fd); + Fclose(fd); retcode = 1; break; } retcode = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL); - ufdClose(fd); + Fclose(fd); switch (retcode) { case 0: diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 2612c4f8c..06ef62e19 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -27,7 +27,9 @@ static int manageFile(FD_t *fdp, const char **fnp, int flags, int rc) /* open a file and set *fdp */ if (*fdp == NULL && fnp && *fnp) { mode_t mode = (flags & O_CREAT) ? 0644 : 0; - if (fdFileno(fd = fdOpen(*fnp, flags, mode)) < 0) { + fd = fdOpen(*fnp, flags, mode); + if (Ferror(fd)) { + /* XXX Fstrerror */ fprintf(stderr, _("%s: fdOpen failed: %s\n"), *fnp, strerror(errno)); return 1; diff --git a/lib/rpminstall.c b/lib/rpminstall.c index f98d1dac5..64319303f 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -187,7 +187,8 @@ int rpmInstall(const char * rootdir, const char ** argv, int transFlags, for (filename = packages; *filename; filename++) { fd = fdOpen(*filename, O_RDONLY, 0); - if (fdFileno(fd) < 0) { + if (Ferror(fd)) { + /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), *filename); numFailed++; packages[i] = NULL; @@ -328,7 +329,8 @@ int rpmInstall(const char * rootdir, const char ** argv, int transFlags, if (numSourcePackages && !stopInstall) { for (i = 0; i < numSourcePackages; i++) { fd = fdOpen(sourcePackages[i], O_RDONLY, 0); - if (fdFileno(fd) < 0) { + if (Ferror(fd)) { + /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open file %s\n"), sourcePackages[i]); continue; @@ -455,7 +457,7 @@ int rpmInstallSource(const char * rootdir, const char * arg, const char ** specF int rc; fd = ufdOpen(arg, O_RDONLY, 0); - if (fdFileno(fd) < 0) { + if (Ferror(fd)) { /* XXX Fstrerror */ rpmMessage(RPMMESS_ERROR, _("cannot open %s\n"), arg); Fclose(fd); diff --git a/lib/rpmio.h b/lib/rpmio.h index 674d1d959..32ec2862d 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -28,6 +28,9 @@ int Fseek (FD_t fd, long int offset, int whence); int Fclose ( /*@only@*/ FD_t fd); FILE * Fopen (const char *path, const char *fmode); +int Ferror (FD_t fd); +int Fileno (FD_t fd); + #endif /* H_RPMIO */ #ifndef H_RPMIO_F @@ -41,7 +44,6 @@ int timedRead(FD_t fd, /*@out@*/void * bufptr, int length); extern /*@only@*/ /*@null@*/ FD_t fdNew(cookie_io_functions_t * iop); extern int fdValid(FD_t fd); -extern int fdFileno(FD_t fd); extern /*@only@*/ /*@null@*/ FD_t fdOpen(const char *pathname, int flags, mode_t mode); extern /*@only@*/ /*@null@*/ FD_t fdDup(int fdno); @@ -88,9 +90,11 @@ extern cookie_io_functions_t bzdio; #endif /* HAVE_BZLIB_H */ /*@only@*/ FD_t ufdOpen(const char * pathname, int flags, mode_t mode); -int ufdClose( /*@only@*/ FD_t fd); +/*@dependent@*/ void * ufdGetUrlinfo(FD_t fd); /*@observer@*/ const char *urlStrerror(const char *url); +extern cookie_io_functions_t ufdio; + #ifdef __cplusplus } #endif diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 94872e81e..05f69e8c0 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -540,10 +540,11 @@ int rpmReadRC(const char * rcfiles) /* Read another rcfile */ fd = fdOpen(fn, O_RDONLY, 0); - if (fdFileno(fd) < 0) { + if (Ferror(fd)) { /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */ if (rcfiles == defrcfiles && myrcfiles != r) continue; + /* XXX Fstrerror */ rpmError(RPMERR_RPMRC, _("Unable to open %s for reading: %s."), fn, strerror(errno)); rc = 1; @@ -579,7 +580,7 @@ static int doReadRC(FD_t fd, const char * filename) int rc; { struct stat sb; - fstat(fdFileno(fd), &sb); + fstat(Fileno(fd), &sb); next = alloca(sb.st_size + 2); if (Fread(next, sb.st_size, 1, fd) != sb.st_size) { rpmError(RPMERR_RPMRC, _("Failed to read %s: %s."), filename, @@ -654,7 +655,8 @@ static int doReadRC(FD_t fd, const char * filename) } fdinc = fdOpen(fn, O_RDONLY, 0); - if (fdFileno(fdinc) < 0) { + if (Ferror(fdinc)) { + /* XXX Fstrerror */ rpmError(RPMERR_RPMRC, _("cannot open %s at %s:%d"), fn, filename, linenum); rc = 1; @@ -825,7 +827,7 @@ static void defaultMachine(const char ** arch, const char ** os) { /* we are on ncr-sysv4 */ char *prelid = NULL; FD_t fd = fdOpen("/etc/.relid", O_RDONLY, 0700); - if (fdFileno(fd) > 0) { + if (!Ferror(fd)) { chptr = (char *) xcalloc(1, 256); if (chptr != NULL) { int irelid = Fread(chptr, 256, 1, fd); diff --git a/lib/rpmurl.h b/lib/rpmurl.h index 75efe729f..445e41ae5 100644 --- a/lib/rpmurl.h +++ b/lib/rpmurl.h @@ -62,13 +62,14 @@ int ftpGetFileDesc(FD_t); int ftpAbort( /*@only@*/ FD_t fd); int ftpClose( /*@only@*/ FD_t fd); -urltype urlIsURL(const char * url); -int urlSplit(const char *url, /*@out@*/ urlinfo **u); /*@only@*/ urlinfo *newUrlinfo(void); void freeUrlinfo( /*@only@*/ urlinfo *u); +void freeUrlinfoCache(void); + +urltype urlIsURL(const char * url); +int urlSplit(const char *url, /*@out@*/ urlinfo **u); int urlGetFile(const char * url, const char * dest); -void urlInvalidateCache(const char * url); #ifdef __cplusplus } diff --git a/lib/signature.c b/lib/signature.c index 46a5dba3f..2271cc724 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -99,7 +99,7 @@ static int checkSize(FD_t fd, int size, int sigsize) int headerArchiveSize; struct stat statbuf; - fstat(fdFileno(fd), &statbuf); + fstat(Fileno(fd), &statbuf); if (S_ISREG(statbuf.st_mode)) { headerArchiveSize = statbuf.st_size - sizeof(struct rpmlead) - sigsize; diff --git a/lib/tread.c b/lib/tread.c index d3d685287..c558c292c 100644 --- a/lib/tread.c +++ b/lib/tread.c @@ -10,18 +10,18 @@ int timedRead(FD_t fd, void * bufptr, int length) { struct timeval tv; struct stat sb; - fstat(fdFileno(fd), &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(fdFileno(fd), &readSet); + FD_SET(Fileno(fd), &readSet); tv.tv_sec = 30; /* FIXME: this should be configurable */ tv.tv_usec = 0; - if (select(fdFileno(fd) + 1, &readSet, NULL, NULL, &tv) != 1) + if (select(Fileno(fd) + 1, &readSet, NULL, NULL, &tv) != 1) return total; bytesRead = Fread(buf + total, length - total, 1, fd); diff --git a/lib/uninstall.c b/lib/uninstall.c index 459b412ad..85e36de37 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -310,11 +310,11 @@ static int runScript(Header h, const char * root, int progArgc, const char ** pr if (errfd != NULL) { if (rpmIsVerbose()) { - out = fdDup(fdFileno(errfd)); + out = fdDup(Fileno(errfd)); } else { out = fdOpen("/dev/null", O_WRONLY, 0); - if (fdFileno(out) < 0) - out = fdDup(fdFileno(errfd)); + if (Ferror(out)) + out = fdDup(Fileno(errfd)); } } else { out = fdDup(STDOUT_FILENO); @@ -331,14 +331,14 @@ static int runScript(Header h, const char * root, int progArgc, const char ** pr close(pipes[0]); if (errfd != NULL) { - if (fdFileno(errfd) != STDERR_FILENO) - dup2(fdFileno(errfd), STDERR_FILENO); - if (fdFileno(out) != STDOUT_FILENO) - dup2(fdFileno(out), STDOUT_FILENO); + if (Fileno(errfd) != STDERR_FILENO) + dup2(Fileno(errfd), STDERR_FILENO); + if (Fileno(out) != STDOUT_FILENO) + dup2(Fileno(out), STDOUT_FILENO); /* make sure we don't close stdin/stderr/stdout by mistake! */ - if (fdFileno(out) > STDERR_FILENO && fdFileno(out) != fdFileno(errfd)) + if (Fileno(out) > STDERR_FILENO && Fileno(out) != Fileno(errfd)) Fclose (out); - if (fdFileno(errfd) > STDERR_FILENO) + if (Fileno(errfd) > STDERR_FILENO) Fclose (errfd); } diff --git a/lib/url.c b/lib/url.c index 3d03f0364..e0866666f 100644 --- a/lib/url.c +++ b/lib/url.c @@ -13,7 +13,22 @@ #include -/*@access FD_t@*/ +typedef /*@owned@*/ urlinfo * urlinfop; +/*@only@*/ /*@null@*/ static urlinfop *uCache = NULL; +static int uCount = 0; + +urlinfo *newUrlinfo(void) +{ + urlinfo *u; + if ((u = xmalloc(sizeof(*u))) == NULL) + return NULL; + memset(u, 0, sizeof(*u)); + u->proxyp = -1; + u->port = -1; + u->ftpControl = -1; + u->ftpGetFileDoneNeeded = 0; + return u; +} void freeUrlinfo(urlinfo *u) { @@ -32,26 +47,25 @@ void freeUrlinfo(urlinfo *u) FREE(u); } -urlinfo *newUrlinfo(void) +void freeUrlinfoCache(void) { - urlinfo *u; - if ((u = xmalloc(sizeof(*u))) == NULL) - return NULL; - memset(u, 0, sizeof(*u)); - u->proxyp = -1; - u->port = -1; - u->ftpControl = -1; - u->ftpGetFileDoneNeeded = 0; - return u; + int i; + for (i = 0; i < uCount; i++) { + if (uCache[i]) + freeUrlinfo(uCache[i]); + } + if (uCache) + free(uCache); + uCache = NULL; + uCount = 0; } static int urlStrcmp(const char *str1, const char *str2) { - if (str1 && str2) { + if (str1 && str2) return (strcmp(str1, str2)); - } else - if (str1 != str2) - return -1; + if (str1 != str2) + return -1; return 0; } @@ -59,8 +73,6 @@ static void findUrlinfo(urlinfo **uret, int mustAsk) { urlinfo *u; urlinfo **empty; - /*@only@*/static urlinfo **uCache = NULL; - static int uCount = 0; int i; if (uret == NULL) @@ -76,6 +88,7 @@ static void findUrlinfo(urlinfo **uret, int mustAsk) empty = &uCache[i]; continue; } + /* Check for cache-miss condition. A cache miss is * a) both items are not NULL and don't compare. * b) either of the items is not NULL. @@ -194,6 +207,30 @@ static void findUrlinfo(urlinfo **uret, int mustAsk) return; } +static struct urlstring { + const char *leadin; + urltype ret; +} urlstrings[] = { + { "file://", URL_IS_PATH }, + { "ftp://", URL_IS_FTP }, + { "http://", URL_IS_HTTP }, + { "-", URL_IS_DASH }, + { NULL, URL_IS_UNKNOWN } +}; + +urltype urlIsURL(const char * url) +{ + struct urlstring *us; + + for (us = urlstrings; us->leadin != NULL; us++) { + if (strncmp(url, us->leadin, strlen(us->leadin))) + continue; + return us->ret; + } + + return URL_IS_UNKNOWN; +} + /* * Split URL into components. The URL can look like * service://user:password@host:port/path @@ -297,16 +334,20 @@ int urlGetFile(const char * url, const char * dest) { int rc; FD_t sfd = NULL; FD_t tfd = NULL; + urlinfo * sfu; sfd = ufdOpen(url, O_RDONLY, 0); - if (sfd == NULL || fdFileno(sfd) < 0) { + if (sfd == NULL || Ferror(sfd)) { + /* XXX Fstrerror */ rpmMessage(RPMMESS_DEBUG, _("failed to open %s\n"), url); - ufdClose(sfd); + Fclose(sfd); return FTPERR_UNKNOWN; } - if (sfd->fd_url != NULL && dest == NULL) { - const char *fileName = ((urlinfo *)sfd->fd_url)->path; + sfu = ufdGetUrlinfo(sfd); + + if (sfu != NULL && dest == NULL) { + const char *fileName = sfu->path; if ((dest = strrchr(fileName, '/')) != NULL) dest++; else @@ -314,10 +355,11 @@ int urlGetFile(const char * url, const char * dest) { } tfd = fdOpen(dest, O_CREAT|O_WRONLY|O_TRUNC, 0600); - if (fdFileno(tfd) < 0) { + if (Ferror(tfd)) { + /* XXX Fstrerror */ rpmMessage(RPMMESS_DEBUG, _("failed to create %s\n"), dest); Fclose(tfd); - ufdClose(sfd); + Fclose(sfd); return FTPERR_UNKNOWN; } @@ -325,18 +367,18 @@ int urlGetFile(const char * url, const char * dest) { case URL_IS_FTP: if ((rc = ftpGetFile(sfd, tfd))) { unlink(dest); - ufdClose(sfd); + /*@-usereleased@*/ Fclose(sfd) /*@=usereleased@*/ ; } - /* XXX fdClose(sfd) done by copyData */ + /* XXX Fclose(sfd) done by copyData */ break; case URL_IS_HTTP: case URL_IS_PATH: case URL_IS_DASH: if ((rc = httpGetFile(sfd, tfd))) { unlink(dest); - ufdClose(sfd); + /*@-usereleased@*/ Fclose(sfd) /*@=usereleased@*/ ; } - /* XXX fdClose(sfd) done by copyData */ + /* XXX Fclose(sfd) done by copyData */ break; case URL_IS_UNKNOWN: default: diff --git a/lib/verify.c b/lib/verify.c index 13b9514cf..dc835410b 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -247,7 +247,7 @@ int rpmVerifyScript(const char * root, Header h, FD_t err) /* ======================================================================== */ static int verifyHeader(QVA_t *qva, Header h) { - char ** fileList; + const char ** fileList; int count; int verifyResult; int i, ec, rc; diff --git a/po/rpm.pot b/po/rpm.pot index 96ad2a8b9..a2309d702 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-10-29 18:59-0400\n" +"POT-Creation-Date: 1999-10-30 11:58-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: build.c:25 lib/rpminstall.c:222 lib/rpminstall.c:382 +#: build.c:25 lib/rpminstall.c:223 lib/rpminstall.c:384 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" @@ -24,7 +24,7 @@ msgid "failed build dependencies:\n" msgstr "" #. XXX Fstrerror -#: build.c:64 +#: build.c:65 #, c-format msgid "Unable to open spec file: %s\n" msgstr "" @@ -90,7 +90,7 @@ msgstr "" msgid "override build root" msgstr "" -#: build.c:374 rpm.c:457 +#: build.c:374 rpm.c:458 msgid "remove build tree when done" msgstr "" @@ -110,7 +110,7 @@ msgstr "" msgid "remove specfile when done" msgstr "" -#: build.c:384 rpm.c:455 +#: build.c:384 rpm.c:456 msgid "skip straight to specified stage (only for c,i)" msgstr "" @@ -164,1056 +164,1056 @@ msgstr "" msgid "no copyright!\n" msgstr "" -#: rpm.c:159 +#: rpm.c:160 #, c-format msgid "rpm: %s\n" msgstr "" -#: rpm.c:170 +#: rpm.c:171 #, c-format msgid "RPM version %s\n" msgstr "" -#: rpm.c:174 +#: rpm.c:175 msgid "Copyright (C) 1998 - Red Hat Software" msgstr "" -#: rpm.c:175 +#: rpm.c:176 msgid "This may be freely redistributed under the terms of the GNU GPL" msgstr "" -#: rpm.c:183 +#: rpm.c:184 msgid "usage: rpm {--help}" msgstr "" -#: rpm.c:184 +#: rpm.c:185 msgid " rpm {--version}" msgstr "" -#: rpm.c:185 +#: rpm.c:186 msgid " rpm {--initdb} [--dbpath ]" msgstr "" -#: rpm.c:186 +#: rpm.c:187 msgid "" " rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: rpm.c:187 +#: rpm.c:188 msgid " [--replacepkgs] [--replacefiles] [--root ]" msgstr "" -#: rpm.c:188 -msgid " [--excludedocs] [--includedocs] [--noscripts]" -msgstr "" - #: rpm.c:189 -msgid "" -" [--rcfile ] [--ignorearch] [--dbpath ]" +msgid " [--excludedocs] [--includedocs] [--noscripts]" msgstr "" #: rpm.c:190 msgid "" -" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +" [--rcfile ] [--ignorearch] [--dbpath ]" msgstr "" #: rpm.c:191 msgid "" +" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +msgstr "" + +#: rpm.c:192 +msgid "" " [--ftpproxy ] [--ftpport ] [--justdb]" msgstr "" -#: rpm.c:192 rpm.c:201 rpm.c:210 +#: rpm.c:193 rpm.c:202 rpm.c:211 msgid " [--httpproxy ] [--httpport ] " msgstr "" -#: rpm.c:193 rpm.c:203 +#: rpm.c:194 rpm.c:204 msgid " [--noorder] [--relocate oldpath=newpath]" msgstr "" -#: rpm.c:194 +#: rpm.c:195 msgid "" " [--badreloc] [--notriggers] [--excludepath ]" msgstr "" -#: rpm.c:195 +#: rpm.c:196 msgid " [--ignoresize] file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:196 +#: rpm.c:197 msgid "" " rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: rpm.c:197 -msgid " [--oldpackage] [--root ] [--noscripts]" -msgstr "" - #: rpm.c:198 -msgid "" -" [--excludedocs] [--includedocs] [--rcfile ]" +msgid " [--oldpackage] [--root ] [--noscripts]" msgstr "" #: rpm.c:199 msgid "" -" [--ignorearch] [--dbpath ] [--prefix ] " +" [--excludedocs] [--includedocs] [--rcfile ]" msgstr "" #: rpm.c:200 +msgid "" +" [--ignorearch] [--dbpath ] [--prefix ] " +msgstr "" + +#: rpm.c:201 msgid " [--ftpproxy ] [--ftpport ]" msgstr "" -#: rpm.c:202 +#: rpm.c:203 msgid " [--ignoreos] [--nodeps] [--allfiles] [--justdb]" msgstr "" -#: rpm.c:204 +#: rpm.c:205 msgid "" " [--badreloc] [--excludepath ] [--ignoresize]" msgstr "" -#: rpm.c:205 +#: rpm.c:206 msgid " file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:206 +#: rpm.c:207 msgid " rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]" msgstr "" -#: rpm.c:207 +#: rpm.c:208 msgid " [--scripts] [--root ] [--rcfile ]" msgstr "" -#: rpm.c:208 +#: rpm.c:209 msgid " [--whatprovides] [--whatrequires] [--requires]" msgstr "" -#: rpm.c:209 +#: rpm.c:210 msgid "" " [--triggeredby] [--ftpuseport] [--ftpproxy ]" msgstr "" -#: rpm.c:211 +#: rpm.c:212 msgid "" " [--ftpport ] [--provides] [--triggers] [--dump]" msgstr "" -#: rpm.c:212 +#: rpm.c:213 msgid " [--changelog] [--dbpath ] [targets]" msgstr "" -#: rpm.c:213 +#: rpm.c:214 msgid " rpm {--verify -V -y} [-afpg] [--root ] [--rcfile ]" msgstr "" -#: rpm.c:214 +#: rpm.c:215 msgid "" " [--dbpath ] [--nodeps] [--nofiles] [--noscripts]" msgstr "" -#: rpm.c:215 +#: rpm.c:216 msgid " [--nomd5] [targets]" msgstr "" -#: rpm.c:216 +#: rpm.c:217 msgid " rpm {--setperms} [-afpg] [target]" msgstr "" -#: rpm.c:217 +#: rpm.c:218 msgid " rpm {--setugids} [-afpg] [target]" msgstr "" -#: rpm.c:218 +#: rpm.c:219 msgid " rpm {--freshen -F} file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:219 +#: rpm.c:220 msgid " rpm {--erase -e} [--root ] [--noscripts] [--rcfile ]" msgstr "" -#: rpm.c:220 -msgid " [--dbpath ] [--nodeps] [--allmatches]" -msgstr "" - #: rpm.c:221 -msgid "" -" [--justdb] [--notriggers] rpackage1 ... packageN" +msgid " [--dbpath ] [--nodeps] [--allmatches]" msgstr "" #: rpm.c:222 msgid "" -" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]" +" [--justdb] [--notriggers] rpackage1 ... packageN" msgstr "" #: rpm.c:223 -msgid " [--sign] [--nobuild] [--timecheck ] ]" +msgid "" +" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]" msgstr "" #: rpm.c:224 -msgid " [--target=platform1[,platform2...]]" +msgid " [--sign] [--nobuild] [--timecheck ] ]" msgstr "" #: rpm.c:225 -msgid " [--rmsource] specfile" +msgid " [--target=platform1[,platform2...]]" msgstr "" #: rpm.c:226 -msgid " rpm {--rmsource} [--rcfile ] [-v] specfile" +msgid " [--rmsource] specfile" msgstr "" #: rpm.c:227 -msgid "" -" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" +msgid " rpm {--rmsource} [--rcfile ] [-v] specfile" msgstr "" #: rpm.c:228 msgid "" -" rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" +" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" #: rpm.c:229 -msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" +msgid "" +" rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" #: rpm.c:230 -msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" +msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" msgstr "" #: rpm.c:231 +msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" +msgstr "" + +#: rpm.c:232 msgid "" " rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile ]" msgstr "" -#: rpm.c:232 +#: rpm.c:233 msgid " package1 ... packageN" msgstr "" -#: rpm.c:233 +#: rpm.c:234 msgid " rpm {--rebuilddb} [--rcfile ] [--dbpath ]" msgstr "" -#: rpm.c:234 +#: rpm.c:235 msgid " rpm {--querytags}" msgstr "" -#: rpm.c:268 +#: rpm.c:269 msgid "usage:" msgstr "" -#: rpm.c:270 +#: rpm.c:271 msgid "print this message" msgstr "" -#: rpm.c:272 +#: rpm.c:273 msgid "print the version of rpm being used" msgstr "" -#: rpm.c:273 +#: rpm.c:274 msgid " all modes support the following arguments:" msgstr "" -#: rpm.c:274 +#: rpm.c:275 msgid " --rcfile " msgstr "" -#: rpm.c:275 +#: rpm.c:276 msgid "use instead of /etc/rpmrc and $HOME/.rpmrc" msgstr "" -#: rpm.c:277 +#: rpm.c:278 msgid "be a little more verbose" msgstr "" -#: rpm.c:279 +#: rpm.c:280 msgid "be incredibly verbose (for debugging)" msgstr "" -#: rpm.c:281 +#: rpm.c:282 msgid "query mode" msgstr "" -#: rpm.c:282 rpm.c:344 rpm.c:408 rpm.c:436 +#: rpm.c:283 rpm.c:345 rpm.c:409 rpm.c:437 msgid " --root " msgstr "" -#: rpm.c:283 rpm.c:345 rpm.c:409 rpm.c:437 rpm.c:499 +#: rpm.c:284 rpm.c:346 rpm.c:410 rpm.c:438 rpm.c:500 msgid "use as the top level directory" msgstr "" -#: rpm.c:284 rpm.c:342 rpm.c:372 rpm.c:424 rpm.c:496 +#: rpm.c:285 rpm.c:343 rpm.c:373 rpm.c:425 rpm.c:497 msgid " --dbpath " msgstr "" -#: rpm.c:285 rpm.c:343 rpm.c:373 rpm.c:425 rpm.c:497 +#: rpm.c:286 rpm.c:344 rpm.c:374 rpm.c:426 rpm.c:498 msgid "use as the directory for the database" msgstr "" -#: rpm.c:286 +#: rpm.c:287 msgid " --queryformat " msgstr "" -#: rpm.c:287 +#: rpm.c:288 msgid "use as the header format (implies -i)" msgstr "" -#: rpm.c:288 +#: rpm.c:289 msgid "" " install, upgrade and query (with -p) allow ftp URL's to be used in place" msgstr "" -#: rpm.c:289 +#: rpm.c:290 msgid " of file names as well as the following options:" msgstr "" -#: rpm.c:290 +#: rpm.c:291 msgid " --ftpproxy " msgstr "" -#: rpm.c:291 +#: rpm.c:292 msgid "hostname or IP of ftp proxy" msgstr "" -#: rpm.c:292 +#: rpm.c:293 msgid " --ftpport " msgstr "" -#: rpm.c:293 +#: rpm.c:294 msgid "port number of ftp server (or proxy)" msgstr "" -#: rpm.c:294 +#: rpm.c:295 msgid " --httpproxy " msgstr "" -#: rpm.c:295 +#: rpm.c:296 msgid "hostname or IP of http proxy" msgstr "" -#: rpm.c:296 +#: rpm.c:297 msgid " --httpport " msgstr "" -#: rpm.c:297 +#: rpm.c:298 msgid "port number of http server (or proxy)" msgstr "" -#: rpm.c:298 +#: rpm.c:299 msgid " Package specification options:" msgstr "" -#: rpm.c:300 +#: rpm.c:301 msgid "query all packages" msgstr "" -#: rpm.c:301 +#: rpm.c:302 msgid " -f + " msgstr "" -#: rpm.c:302 +#: rpm.c:303 msgid "query package owning " msgstr "" -#: rpm.c:303 +#: rpm.c:304 msgid " -p + " msgstr "" -#: rpm.c:304 +#: rpm.c:305 msgid "query (uninstalled) package " msgstr "" -#: rpm.c:305 +#: rpm.c:306 msgid " --triggeredby " msgstr "" -#: rpm.c:306 +#: rpm.c:307 msgid "query packages triggered by " msgstr "" -#: rpm.c:307 +#: rpm.c:308 msgid " --whatprovides " msgstr "" -#: rpm.c:308 +#: rpm.c:309 msgid "query packages which provide capability" msgstr "" -#: rpm.c:309 +#: rpm.c:310 msgid " --whatrequires " msgstr "" -#: rpm.c:310 +#: rpm.c:311 msgid "query packages which require capability" msgstr "" -#: rpm.c:311 +#: rpm.c:312 msgid " Information selection options:" msgstr "" -#: rpm.c:313 +#: rpm.c:314 msgid "display package information" msgstr "" -#: rpm.c:315 +#: rpm.c:316 msgid "display the package's change log" msgstr "" -#: rpm.c:317 +#: rpm.c:318 msgid "display package file list" msgstr "" -#: rpm.c:319 +#: rpm.c:320 msgid "show file states (implies -l)" msgstr "" -#: rpm.c:321 +#: rpm.c:322 msgid "list only documentation files (implies -l)" msgstr "" -#: rpm.c:323 +#: rpm.c:324 msgid "list only configuration files (implies -l)" msgstr "" -#: rpm.c:325 +#: rpm.c:326 msgid "" "show all verifiable information for each file (must be used with -l, -c, or " "-d)" msgstr "" -#: rpm.c:327 +#: rpm.c:328 msgid "list capabilities package provides" msgstr "" -#: rpm.c:328 +#: rpm.c:329 msgid " --requires" msgstr "" -#: rpm.c:330 +#: rpm.c:331 msgid "list package dependencies" msgstr "" -#: rpm.c:332 +#: rpm.c:333 msgid "print the various [un]install scripts" msgstr "" -#: rpm.c:334 +#: rpm.c:335 msgid "show the trigger scripts contained in the package" msgstr "" -#: rpm.c:338 +#: rpm.c:339 msgid " --pipe " msgstr "" -#: rpm.c:339 +#: rpm.c:340 msgid "send stdout to " msgstr "" -#: rpm.c:341 +#: rpm.c:342 msgid "" "verify a package installation using the same same package specification " "options as -q" msgstr "" -#: rpm.c:347 rpm.c:395 rpm.c:429 +#: rpm.c:348 rpm.c:396 rpm.c:430 msgid "do not verify package dependencies" msgstr "" -#: rpm.c:349 +#: rpm.c:350 msgid "do not verify file md5 checksums" msgstr "" -#: rpm.c:351 +#: rpm.c:352 msgid "do not verify file attributes" msgstr "" -#: rpm.c:354 +#: rpm.c:355 msgid "" "set the file permissions to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:357 +#: rpm.c:358 msgid "" "set the file owner and group to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:361 +#: rpm.c:362 msgid " --install " msgstr "" -#: rpm.c:362 +#: rpm.c:363 msgid " -i " msgstr "" -#: rpm.c:363 +#: rpm.c:364 msgid "install package" msgstr "" -#: rpm.c:364 +#: rpm.c:365 msgid " --excludepath " msgstr "" -#: rpm.c:365 +#: rpm.c:366 msgid "skip files in path " msgstr "" -#: rpm.c:366 +#: rpm.c:367 msgid " --relocate =" msgstr "" -#: rpm.c:367 +#: rpm.c:368 msgid "relocate files from to " msgstr "" -#: rpm.c:369 +#: rpm.c:370 msgid "relocate files even though the package doesn't allow it" msgstr "" -#: rpm.c:370 +#: rpm.c:371 msgid " --prefix " msgstr "" -#: rpm.c:371 +#: rpm.c:372 msgid "relocate the package to , if relocatable" msgstr "" -#: rpm.c:375 +#: rpm.c:376 msgid "do not install documentation" msgstr "" -#: rpm.c:377 +#: rpm.c:378 msgid "short hand for --replacepkgs --replacefiles" msgstr "" -#: rpm.c:380 +#: rpm.c:381 msgid "print hash marks as package installs (good with -v)" msgstr "" -#: rpm.c:382 +#: rpm.c:383 msgid "install all files, even configurations which might otherwise be skipped" msgstr "" -#: rpm.c:385 +#: rpm.c:386 msgid "don't verify package architecture" msgstr "" -#: rpm.c:387 +#: rpm.c:388 msgid "don't check disk space before installing" msgstr "" -#: rpm.c:389 +#: rpm.c:390 msgid "don't verify package operating system" msgstr "" -#: rpm.c:391 +#: rpm.c:392 msgid "install documentation" msgstr "" -#: rpm.c:393 rpm.c:427 +#: rpm.c:394 rpm.c:428 msgid "update the database, but do not modify the filesystem" msgstr "" -#: rpm.c:397 rpm.c:431 +#: rpm.c:398 rpm.c:432 msgid "do not reorder package installation to satisfy dependencies" msgstr "" -#: rpm.c:399 +#: rpm.c:400 msgid "don't execute any installation scripts" msgstr "" -#: rpm.c:401 rpm.c:435 +#: rpm.c:402 rpm.c:436 msgid "don't execute any scripts triggered by this package" msgstr "" -#: rpm.c:403 +#: rpm.c:404 msgid "print percentages as package installs" msgstr "" -#: rpm.c:405 +#: rpm.c:406 msgid "install even if the package replaces installed files" msgstr "" -#: rpm.c:407 +#: rpm.c:408 msgid "reinstall if the package is already present" msgstr "" -#: rpm.c:411 +#: rpm.c:412 msgid "don't install, but tell if it would work or not" msgstr "" -#: rpm.c:413 +#: rpm.c:414 msgid " --upgrade " msgstr "" -#: rpm.c:414 +#: rpm.c:415 msgid " -U " msgstr "" -#: rpm.c:415 +#: rpm.c:416 msgid "upgrade package (same options as --install, plus)" msgstr "" -#: rpm.c:417 +#: rpm.c:418 msgid "" "upgrade to an old version of the package (--force on upgrades does this " "automatically)" msgstr "" -#: rpm.c:419 +#: rpm.c:420 msgid " --erase " msgstr "" -#: rpm.c:421 +#: rpm.c:422 msgid "erase (uninstall) package" msgstr "" -#: rpm.c:423 +#: rpm.c:424 msgid "" "remove all packages which match (normally an error is generated if " " specified multiple packages)" msgstr "" -#: rpm.c:433 +#: rpm.c:434 msgid "do not execute any package specific scripts" msgstr "" -#: rpm.c:439 +#: rpm.c:440 msgid " -b " msgstr "" -#: rpm.c:440 +#: rpm.c:441 msgid " -t " msgstr "" -#: rpm.c:441 +#: rpm.c:442 msgid "build package, where is one of:" msgstr "" -#: rpm.c:443 +#: rpm.c:444 msgid "prep (unpack sources and apply patches)" msgstr "" -#: rpm.c:445 +#: rpm.c:446 #, c-format msgid "list check (do some cursory checks on %files)" msgstr "" -#: rpm.c:447 +#: rpm.c:448 msgid "compile (prep and compile)" msgstr "" -#: rpm.c:449 +#: rpm.c:450 msgid "install (prep, compile, install)" msgstr "" -#: rpm.c:451 +#: rpm.c:452 msgid "binary package (prep, compile, install, package)" msgstr "" -#: rpm.c:453 +#: rpm.c:454 msgid "bin/src package (prep, compile, install, package)" msgstr "" -#: rpm.c:459 +#: rpm.c:460 msgid "remove sources and spec file when done" msgstr "" -#: rpm.c:461 +#: rpm.c:462 msgid "generate PGP/GPG signature" msgstr "" -#: rpm.c:462 +#: rpm.c:463 msgid " --buildroot " msgstr "" -#: rpm.c:463 +#: rpm.c:464 msgid "use as the build root" msgstr "" -#: rpm.c:464 +#: rpm.c:465 msgid " --target=+" msgstr "" -#: rpm.c:465 +#: rpm.c:466 msgid "build the packages for the build targets platform1...platformN." msgstr "" -#: rpm.c:467 +#: rpm.c:468 msgid "do not execute any stages" msgstr "" -#: rpm.c:468 +#: rpm.c:469 msgid " --timecheck " msgstr "" -#: rpm.c:469 +#: rpm.c:470 msgid "set the time check to seconds (0 disables)" msgstr "" -#: rpm.c:471 +#: rpm.c:472 msgid " --rebuild " msgstr "" -#: rpm.c:472 +#: rpm.c:473 msgid "" "install source package, build binary package and remove spec file, sources, " "patches, and icons." msgstr "" -#: rpm.c:473 +#: rpm.c:474 msgid " --rmsource " msgstr "" -#: rpm.c:474 +#: rpm.c:475 msgid "remove sources and spec file" msgstr "" -#: rpm.c:475 +#: rpm.c:476 msgid " --recompile " msgstr "" -#: rpm.c:476 +#: rpm.c:477 msgid "like --rebuild, but don't build any package" msgstr "" -#: rpm.c:477 +#: rpm.c:478 msgid " --resign + " msgstr "" -#: rpm.c:478 +#: rpm.c:479 msgid "sign a package (discard current signature)" msgstr "" -#: rpm.c:479 +#: rpm.c:480 msgid " --addsign + " msgstr "" -#: rpm.c:480 +#: rpm.c:481 msgid "add a signature to a package" msgstr "" -#: rpm.c:482 +#: rpm.c:483 msgid " --checksig + " msgstr "" -#: rpm.c:483 +#: rpm.c:484 msgid "verify package signature" msgstr "" -#: rpm.c:485 +#: rpm.c:486 msgid "skip any PGP signatures" msgstr "" -#: rpm.c:487 +#: rpm.c:488 msgid "skip any GPG signatures" msgstr "" -#: rpm.c:489 +#: rpm.c:490 msgid "skip any MD5 signatures" msgstr "" -#: rpm.c:491 +#: rpm.c:492 msgid "list the tags that can be used in a query format" msgstr "" -#: rpm.c:493 +#: rpm.c:494 msgid "make sure a valid database exists" msgstr "" -#: rpm.c:495 +#: rpm.c:496 msgid "rebuild database from existing database" msgstr "" -#: rpm.c:639 rpm.c:645 rpm.c:652 rpm.c:658 rpm.c:667 rpm.c:674 rpm.c:721 -#: rpm.c:727 rpm.c:761 rpm.c:767 rpm.c:773 rpm.c:781 rpm.c:816 rpm.c:871 -#: rpm.c:878 +#: rpm.c:641 rpm.c:647 rpm.c:654 rpm.c:660 rpm.c:669 rpm.c:676 rpm.c:723 +#: rpm.c:729 rpm.c:763 rpm.c:769 rpm.c:775 rpm.c:783 rpm.c:818 rpm.c:873 +#: rpm.c:880 msgid "only one major mode may be specified" msgstr "" -#: rpm.c:660 +#: rpm.c:662 msgid "-u and --uninstall are deprecated and no longer work.\n" msgstr "" -#: rpm.c:662 +#: rpm.c:664 msgid "Use -e or --erase instead.\n" msgstr "" -#: rpm.c:678 +#: rpm.c:680 msgid "--build (-b) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: rpm.c:682 +#: rpm.c:684 msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: rpm.c:734 rpm.c:740 rpm.c:747 rpm.c:754 rpm.c:885 +#: rpm.c:736 rpm.c:742 rpm.c:749 rpm.c:756 rpm.c:887 msgid "one type of query/verify may be performed at a time" msgstr "" -#: rpm.c:789 +#: rpm.c:791 msgid "arguments to --dbpath must begin with a /" msgstr "" -#: rpm.c:822 +#: rpm.c:824 msgid "relocations must begin with a /" msgstr "" -#: rpm.c:824 +#: rpm.c:826 msgid "relocations must contain a =" msgstr "" -#: rpm.c:827 +#: rpm.c:829 msgid "relocations must have a / following the =" msgstr "" -#: rpm.c:836 +#: rpm.c:838 msgid "exclude paths must begin with a /" msgstr "" -#: rpm.c:845 +#: rpm.c:847 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: rpm.c:898 +#: rpm.c:900 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: rpm.c:903 +#: rpm.c:905 msgid "--timecheck may only be used during package builds" msgstr "" -#: rpm.c:906 +#: rpm.c:908 msgid "unexpected query flags" msgstr "" -#: rpm.c:909 +#: rpm.c:911 msgid "unexpected query format" msgstr "" -#: rpm.c:913 +#: rpm.c:915 msgid "unexpected query source" msgstr "" -#: rpm.c:919 +#: rpm.c:921 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: rpm.c:922 +#: rpm.c:924 msgid "files may only be relocated during package installation" msgstr "" -#: rpm.c:925 +#: rpm.c:927 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: rpm.c:928 +#: rpm.c:930 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: rpm.c:931 +#: rpm.c:933 msgid "--prefix may only be used when installing new packages" msgstr "" -#: rpm.c:934 +#: rpm.c:936 msgid "arguments to --prefix must begin with a /" msgstr "" -#: rpm.c:937 +#: rpm.c:939 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: rpm.c:941 +#: rpm.c:943 msgid "--percent may only be specified during package installation" msgstr "" -#: rpm.c:945 +#: rpm.c:947 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: rpm.c:949 +#: rpm.c:951 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: rpm.c:953 +#: rpm.c:955 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: rpm.c:957 +#: rpm.c:959 msgid "--includedocs may only be specified during package installation" msgstr "" -#: rpm.c:961 +#: rpm.c:963 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: rpm.c:965 +#: rpm.c:967 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: rpm.c:969 +#: rpm.c:971 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: rpm.c:973 +#: rpm.c:975 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: rpm.c:977 +#: rpm.c:979 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: rpm.c:981 +#: rpm.c:983 msgid "--allfiles may only be specified during package installation" msgstr "" -#: rpm.c:985 +#: rpm.c:987 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: rpm.c:990 +#: rpm.c:992 msgid "" "--noscripts may only be specified during package installation, erasure, and " "verification" msgstr "" -#: rpm.c:994 +#: rpm.c:996 msgid "" "--notriggers may only be specified during package installation, erasure, and " "verification" msgstr "" -#: rpm.c:1000 +#: rpm.c:1002 msgid "" "--nodeps may only be specified during package building, installation, " "erasure, and verification" msgstr "" -#: rpm.c:1005 +#: rpm.c:1007 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: rpm.c:1010 +#: rpm.c:1012 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: rpm.c:1015 +#: rpm.c:1017 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: rpm.c:1018 +#: rpm.c:1020 msgid "--oldpackage may only be used during upgrades" msgstr "" -#: rpm.c:1023 +#: rpm.c:1025 msgid "" "ftp options can only be used during package queries, installs, and upgrades" msgstr "" -#: rpm.c:1029 +#: rpm.c:1031 msgid "" "http options can only be used during package queries, installs, and upgrades" msgstr "" -#: rpm.c:1033 +#: rpm.c:1035 msgid "--nopgp may only be used during signature checking" msgstr "" -#: rpm.c:1036 +#: rpm.c:1038 msgid "--nogpg may only be used during signature checking" msgstr "" -#: rpm.c:1039 +#: rpm.c:1041 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: rpm.c:1063 +#: rpm.c:1065 msgid "no files to sign\n" msgstr "" -#: rpm.c:1068 +#: rpm.c:1070 #, c-format msgid "cannot access file %s\n" msgstr "" -#: rpm.c:1083 +#: rpm.c:1085 msgid "pgp not found: " msgstr "" -#: rpm.c:1087 +#: rpm.c:1089 msgid "Enter pass phrase: " msgstr "" -#: rpm.c:1089 +#: rpm.c:1091 msgid "Pass phrase check failed\n" msgstr "" -#: rpm.c:1092 +#: rpm.c:1094 msgid "Pass phrase is good.\n" msgstr "" -#: rpm.c:1097 +#: rpm.c:1099 msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: rpm.c:1103 +#: rpm.c:1105 msgid "--sign may only be used during package building" msgstr "" -#: rpm.c:1118 +#: rpm.c:1120 msgid "exec failed\n" msgstr "" -#: rpm.c:1137 +#: rpm.c:1139 msgid "unexpected arguments to --querytags " msgstr "" -#: rpm.c:1148 +#: rpm.c:1150 msgid "no packages given for signature check" msgstr "" -#: rpm.c:1159 +#: rpm.c:1161 msgid "no packages given for signing" msgstr "" -#: rpm.c:1171 +#: rpm.c:1173 msgid "no packages files given for rebuild" msgstr "" -#: rpm.c:1233 +#: rpm.c:1235 msgid "no spec files given for build" msgstr "" -#: rpm.c:1235 +#: rpm.c:1237 msgid "no tar files given for build" msgstr "" -#: rpm.c:1250 +#: rpm.c:1252 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1300 +#: rpm.c:1302 msgid "no packages given for install" msgstr "" -#: rpm.c:1323 +#: rpm.c:1325 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1328 +#: rpm.c:1330 msgid "no arguments given for query" msgstr "" -#: rpm.c:1345 +#: rpm.c:1347 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1349 +#: rpm.c:1351 msgid "no arguments given for verify" msgstr "" @@ -1225,7 +1225,7 @@ msgstr "" msgid "error reading header from package\n" msgstr "" -#: build/build.c:83 build/pack.c:270 +#: build/build.c:83 build/pack.c:272 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:491 +#: build/files.c:1190 build/pack.c:495 #, c-format msgid "line: %s" msgstr "" @@ -1475,96 +1475,98 @@ msgstr "" msgid "cannot create %s: %s\n" msgstr "" -#: build/pack.c:187 +#. XXX Fstrerror +#: build/pack.c:189 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:197 +#: build/pack.c:199 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:218 +#: build/pack.c:220 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:224 +#: build/pack.c:226 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:281 +#: build/pack.c:283 msgid "Bad CSA data" msgstr "" -#: build/pack.c:314 +#. XXX Fstrerror +#: build/pack.c:318 #, c-format msgid "Could not open %s\n" msgstr "" -#: build/pack.c:346 build/pack.c:388 +#: build/pack.c:350 build/pack.c:392 #, c-format msgid "Unable to write package: %s" msgstr "" -#: build/pack.c:361 +#: build/pack.c:365 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:378 +#: build/pack.c:382 #, c-format msgid "Unable to read sigtarget: %s" msgstr "" -#: build/pack.c:403 +#: build/pack.c:407 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:419 build/pack.c:442 +#: build/pack.c:423 build/pack.c:446 #, c-format msgid "create archive failed on file %s: %s" msgstr "" -#: build/pack.c:461 +#: build/pack.c:465 #, c-format msgid "cpio_copy write failed: %s" msgstr "" -#: build/pack.c:468 +#: build/pack.c:472 #, c-format msgid "cpio_copy read failed: %s" msgstr "" -#: build/pack.c:547 +#: build/pack.c:551 #, c-format msgid "Could not open PreIn file: %s" msgstr "" -#: build/pack.c:554 +#: build/pack.c:558 #, c-format msgid "Could not open PreUn file: %s" msgstr "" -#: build/pack.c:561 +#: build/pack.c:565 #, c-format msgid "Could not open PostIn file: %s" msgstr "" -#: build/pack.c:568 +#: build/pack.c:572 #, c-format msgid "Could not open PostUn file: %s" msgstr "" -#: build/pack.c:576 +#: build/pack.c:580 #, c-format msgid "Could not open VerifyScript file: %s" msgstr "" -#: build/pack.c:592 +#: build/pack.c:596 #, c-format msgid "Could not open Trigger script file: %s" msgstr "" @@ -1928,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 "" @@ -2104,55 +2106,55 @@ msgstr "" msgid "file %s is on an unknown device" msgstr "" -#: lib/ftp.c:666 +#: lib/ftp.c:665 msgid "Success" msgstr "" -#: lib/ftp.c:669 +#: lib/ftp.c:668 msgid "Bad server response" msgstr "" -#: lib/ftp.c:672 +#: lib/ftp.c:671 msgid "Server IO error" msgstr "" -#: lib/ftp.c:675 +#: lib/ftp.c:674 msgid "Server timeout" msgstr "" -#: lib/ftp.c:678 +#: lib/ftp.c:677 msgid "Unable to lookup server host address" msgstr "" -#: lib/ftp.c:681 +#: lib/ftp.c:680 msgid "Unable to lookup server host name" msgstr "" -#: lib/ftp.c:684 +#: lib/ftp.c:683 msgid "Failed to connect to server" msgstr "" -#: lib/ftp.c:687 +#: lib/ftp.c:686 msgid "Failed to establish data connection to server" msgstr "" -#: lib/ftp.c:690 +#: lib/ftp.c:689 msgid "IO error to local file" msgstr "" -#: lib/ftp.c:693 +#: lib/ftp.c:692 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/ftp.c:696 +#: lib/ftp.c:695 msgid "File not found on server" msgstr "" -#: lib/ftp.c:699 +#: lib/ftp.c:698 msgid "Abort in progress" msgstr "" -#: lib/ftp.c:703 +#: lib/ftp.c:702 msgid "Unknown or unexpected error" msgstr "" @@ -2417,12 +2419,13 @@ msgstr "" msgid "Target buffer overflow" msgstr "" -#: lib/macro.c:1345 lib/macro.c:1353 +#. XXX Fstrerror +#: lib/macro.c:1347 lib/macro.c:1355 #, c-format msgid "File %s: %s" msgstr "" -#: lib/macro.c:1356 +#: lib/macro.c:1358 #, c-format msgid "File %s is smaller than %d bytes" msgstr "" @@ -2448,7 +2451,7 @@ msgstr "" msgid "error creating temporary file %s" msgstr "" -#: lib/oldheader.c:299 +#: lib/oldheader.c:301 #, c-format msgid "bad file state: %s" msgstr "" @@ -2578,150 +2581,151 @@ msgstr "" msgid "error: could not read database record\n" msgstr "" -#: lib/query.c:463 +#. XXX Fstrerror +#: lib/query.c:464 #, c-format msgid "open of %s failed: %s\n" msgstr "" -#: lib/query.c:476 +#: lib/query.c:477 msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:485 lib/rpminstall.c:203 +#: lib/query.c:486 lib/rpminstall.c:204 #, c-format msgid "%s does not appear to be a RPM package\n" msgstr "" -#: lib/query.c:488 +#: lib/query.c:489 #, c-format msgid "query of %s failed\n" msgstr "" -#: lib/query.c:515 +#: lib/query.c:516 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:540 +#: lib/query.c:541 msgid "could not read database record!\n" msgstr "" -#: lib/query.c:551 +#: lib/query.c:552 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:561 +#: lib/query.c:562 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:571 +#: lib/query.c:572 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:581 +#: lib/query.c:582 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:596 +#: lib/query.c:597 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:599 +#: lib/query.c:600 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:612 +#: lib/query.c:613 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:615 +#: lib/query.c:616 #, c-format msgid "package record number: %d\n" msgstr "" -#: lib/query.c:618 +#: lib/query.c:619 #, c-format msgid "record %d could not be read\n" msgstr "" -#: lib/query.c:630 lib/rpminstall.c:393 +#: lib/query.c:631 lib/rpminstall.c:395 #, c-format msgid "package %s is not installed\n" msgstr "" -#: lib/query.c:633 +#: lib/query.c:634 #, c-format msgid "error looking for package %s\n" msgstr "" -#: lib/query.c:655 +#: lib/query.c:656 msgid "rpmQuery: rpmdbOpen() failed\n" msgstr "" -#: lib/query.c:714 +#: lib/query.c:715 msgid "query package owning file" msgstr "" -#: lib/query.c:716 +#: lib/query.c:717 msgid "query packages in group" msgstr "" -#: lib/query.c:718 +#: lib/query.c:719 msgid "query a package file" msgstr "" -#: lib/query.c:722 +#: lib/query.c:723 msgid "query a spec file" msgstr "" -#: lib/query.c:724 +#: lib/query.c:725 msgid "query the pacakges triggered by the package" msgstr "" -#: lib/query.c:726 +#: lib/query.c:727 msgid "query the packages which require a capability" msgstr "" -#: lib/query.c:728 +#: lib/query.c:729 msgid "query the packages which provide a capability" msgstr "" -#: lib/query.c:767 +#: lib/query.c:768 msgid "list all configuration files" msgstr "" -#: lib/query.c:769 +#: lib/query.c:770 msgid "list all documentation files" msgstr "" -#: lib/query.c:771 +#: lib/query.c:772 msgid "dump basic file information" msgstr "" -#: lib/query.c:773 +#: lib/query.c:774 msgid "list files in package" msgstr "" -#: lib/query.c:777 +#: lib/query.c:778 msgid "use the following query format" msgstr "" -#: lib/query.c:779 +#: lib/query.c:780 msgid "substitute i18n sections from the following catalogue" msgstr "" -#: lib/query.c:782 +#: lib/query.c:783 msgid "display the states of the listed files" msgstr "" -#: lib/query.c:784 +#: lib/query.c:785 msgid "display a verbose file listing" msgstr "" @@ -2785,86 +2789,87 @@ msgstr "" msgid "failed to remove directory %s: %s\n" msgstr "" -#: lib/rpmchecksig.c:31 +#. XXX Fstrerror +#: lib/rpmchecksig.c:33 #, c-format msgid "%s: fdOpen failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:42 +#: lib/rpmchecksig.c:44 msgid "makeTempFile failed\n" msgstr "" -#: lib/rpmchecksig.c:74 +#: lib/rpmchecksig.c:76 #, c-format msgid "%s: Fwrite failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:80 +#: lib/rpmchecksig.c:82 #, c-format msgid "%s: Fread failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:113 lib/rpmchecksig.c:242 +#: lib/rpmchecksig.c:115 lib/rpmchecksig.c:244 #, c-format msgid "%s: readLead failed\n" msgstr "" -#: lib/rpmchecksig.c:118 +#: lib/rpmchecksig.c:120 #, c-format msgid "%s: Can't sign v1.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:122 +#: lib/rpmchecksig.c:124 #, c-format msgid "%s: Can't re-sign v2.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:130 lib/rpmchecksig.c:256 +#: lib/rpmchecksig.c:132 lib/rpmchecksig.c:258 #, c-format msgid "%s: rpmReadSignature failed\n" msgstr "" -#: lib/rpmchecksig.c:134 lib/rpmchecksig.c:261 +#: lib/rpmchecksig.c:136 lib/rpmchecksig.c:263 #, c-format msgid "%s: No signature available\n" msgstr "" -#: lib/rpmchecksig.c:167 +#: lib/rpmchecksig.c:169 #, c-format msgid "%s: writeLead failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:173 +#: lib/rpmchecksig.c:175 #, c-format msgid "%s: rpmWriteSignature failed\n" msgstr "" -#: lib/rpmchecksig.c:248 +#: lib/rpmchecksig.c:250 #, c-format msgid "%s: No signature available (v1.0 RPM)\n" msgstr "" -#: lib/rpmchecksig.c:411 +#: lib/rpmchecksig.c:413 msgid "NOT OK" msgstr "" -#: lib/rpmchecksig.c:412 lib/rpmchecksig.c:426 +#: lib/rpmchecksig.c:414 lib/rpmchecksig.c:428 msgid " (MISSING KEYS:" msgstr "" -#: lib/rpmchecksig.c:414 lib/rpmchecksig.c:428 +#: lib/rpmchecksig.c:416 lib/rpmchecksig.c:430 msgid ") " msgstr "" -#: lib/rpmchecksig.c:415 lib/rpmchecksig.c:429 +#: lib/rpmchecksig.c:417 lib/rpmchecksig.c:431 msgid " (UNTRUSTED KEYS:" msgstr "" -#: lib/rpmchecksig.c:417 lib/rpmchecksig.c:431 +#: lib/rpmchecksig.c:419 lib/rpmchecksig.c:433 msgid ")" msgstr "" -#: lib/rpmchecksig.c:425 +#: lib/rpmchecksig.c:427 msgid "OK" msgstr "" @@ -2873,7 +2878,8 @@ msgstr "" msgid "opening database mode 0x%x in %s\n" msgstr "" -#: lib/rpmdb.c:186 lib/url.c:303 +#. XXX Fstrerror +#: lib/rpmdb.c:186 lib/url.c:342 #, c-format msgid "failed to open %s\n" msgstr "" @@ -3003,71 +3009,72 @@ msgstr "" msgid "retrieved %d packages\n" msgstr "" -#: lib/rpminstall.c:191 lib/rpminstall.c:332 +#. XXX Fstrerror +#: lib/rpminstall.c:192 lib/rpminstall.c:334 #, c-format msgid "cannot open file %s\n" msgstr "" -#: lib/rpminstall.c:207 lib/rpminstall.c:471 +#: lib/rpminstall.c:208 lib/rpminstall.c:473 #, c-format msgid "%s cannot be installed\n" msgstr "" -#: lib/rpminstall.c:243 +#: lib/rpminstall.c:244 #, c-format msgid "package %s is not relocateable\n" msgstr "" -#: lib/rpminstall.c:261 +#: lib/rpminstall.c:262 #, c-format msgid "error reading from file %s\n" msgstr "" -#: lib/rpminstall.c:266 +#: lib/rpminstall.c:267 #, c-format msgid "file %s requires a newer version of RPM\n" msgstr "" -#: lib/rpminstall.c:283 +#: lib/rpminstall.c:284 #, c-format msgid "found %d source and %d binary packages\n" msgstr "" -#: lib/rpminstall.c:294 +#: lib/rpminstall.c:295 msgid "failed dependencies:\n" msgstr "" -#: lib/rpminstall.c:312 +#: lib/rpminstall.c:313 msgid "installing binary packages\n" msgstr "" -#: lib/rpminstall.c:397 +#: lib/rpminstall.c:399 #, c-format msgid "searching for package %s\n" msgstr "" -#: lib/rpminstall.c:406 +#: lib/rpminstall.c:408 #, c-format msgid "\"%s\" specifies multiple packages\n" msgstr "" -#: lib/rpminstall.c:432 +#: lib/rpminstall.c:434 msgid "removing these packages would break dependencies:\n" msgstr "" #. XXX Fstrerror -#: lib/rpminstall.c:460 +#: lib/rpminstall.c:462 #, c-format msgid "cannot open %s\n" msgstr "" -#: lib/rpminstall.c:466 +#: lib/rpminstall.c:468 #, c-format msgid "Installing %s\n" msgstr "" #. XXX PARANOIA -#: lib/rpmio.c:163 +#: lib/rpmio.c:139 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" @@ -3117,52 +3124,54 @@ msgstr "" msgid "Cannot expand %s" msgstr "" -#: lib/rpmrc.c:547 +#. XXX Fstrerror +#: lib/rpmrc.c:548 #, c-format msgid "Unable to open %s for reading: %s." msgstr "" -#: lib/rpmrc.c:585 +#: lib/rpmrc.c:586 #, c-format msgid "Failed to read %s: %s." msgstr "" -#: lib/rpmrc.c:615 +#: lib/rpmrc.c:616 #, c-format msgid "missing ':' at %s:%d" msgstr "" -#: lib/rpmrc.c:632 lib/rpmrc.c:707 +#: lib/rpmrc.c:633 lib/rpmrc.c:709 #, c-format msgid "missing argument for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:649 lib/rpmrc.c:672 +#: lib/rpmrc.c:650 lib/rpmrc.c:674 #, c-format msgid "%s expansion failed at %s:%d \"%s\"" msgstr "" -#: lib/rpmrc.c:658 +#. XXX Fstrerror +#: lib/rpmrc.c:660 #, c-format msgid "cannot open %s at %s:%d" msgstr "" -#: lib/rpmrc.c:699 +#: lib/rpmrc.c:701 #, c-format msgid "missing architecture for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:766 +#: lib/rpmrc.c:768 #, c-format msgid "bad option '%s' at %s:%d" msgstr "" -#: lib/rpmrc.c:1128 +#: lib/rpmrc.c:1130 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: lib/rpmrc.c:1129 +#: lib/rpmrc.c:1131 msgid "Please contact rpm-list@redhat.com\n" msgstr "" @@ -3365,21 +3374,22 @@ msgstr "" msgid "execution of script failed" msgstr "" -#: lib/url.c:133 +#: lib/url.c:146 #, c-format msgid "Password for %s@%s: " msgstr "" -#: lib/url.c:157 lib/url.c:183 +#: lib/url.c:170 lib/url.c:196 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: lib/url.c:268 +#: lib/url.c:305 msgid "url port must be a number\n" msgstr "" -#: lib/url.c:318 +#. XXX Fstrerror +#: lib/url.c:360 #, c-format msgid "failed to create %s\n" msgstr "" diff --git a/rpm.c b/rpm.c index 6c4e494e9..8b57bda6b 100755 --- a/rpm.c +++ b/rpm.c @@ -1,6 +1,7 @@ #include "system.h" -#include "rpmbuild.h" +#include +#include #include "build.h" #include "install.h" @@ -71,7 +72,7 @@ extern const char * rpmEVR; extern int rpmFLAGS; static struct rpmQVArguments rpmQVArgs; -static struct rpmBuildArguments buildArgs; +static struct rpmBuildArguments rpmBArgs; /* the structure describing the options we take and the defaults */ static struct poptOption optionsTable[] = { @@ -146,7 +147,7 @@ static struct poptOption optionsTable[] = { { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmVerifyPoptTable, 0, (void *) &rpmQVArgs, NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, - rpmBuildPoptTable, 0, (void *) &buildArgs, NULL }, + rpmBuildPoptTable, 0, (void *) &rpmBArgs, NULL }, { 0, 0, 0, 0, 0, NULL, NULL } }; @@ -503,6 +504,7 @@ int main(int argc, const char ** argv) { enum modes bigMode = MODE_UNKNOWN; QVA_t *qva = &rpmQVArgs; + struct rpmBuildArguments *ba = &rpmBArgs; enum rpmQVSources QVSource = RPMQV_PACKAGE; int arg; int installFlags = 0, uninstallFlags = 0, interfaceFlags = 0; @@ -625,10 +627,10 @@ int main(int argc, const char ** argv) if (qva->qva_queryFormat) xfree(qva->qva_queryFormat); memset(qva, 0, sizeof(*qva)); - if (buildArgs.buildRootOverride) xfree(buildArgs.buildRootOverride); - if (buildArgs.targets) free(buildArgs.targets); - memset(&buildArgs, 0, sizeof(buildArgs)); - buildArgs.buildChar = ' '; + if (ba->buildRootOverride) xfree(ba->buildRootOverride); + if (ba->targets) free(ba->targets); + memset(ba, 0, sizeof(*ba)); + ba->buildChar = ' '; while ((arg = poptGetNextOpt(optCon)) > 0) { optArg = poptGetOptArg(optCon); @@ -686,8 +688,8 @@ int main(int argc, const char ** argv) if (strlen(optArg) > 1) argerror(errString); - buildArgs.buildChar = optArg[0]; - switch (buildArgs.buildChar) { + ba->buildChar = optArg[0]; + switch (ba->buildChar) { case 'a': case 'b': case 'i': @@ -860,10 +862,10 @@ int main(int argc, const char ** argv) exit(EXIT_FAILURE); } - if ((buildArgs.buildAmount & RPMBUILD_RMSOURCE) && bigMode == MODE_UNKNOWN) + if ((ba->buildAmount & RPMBUILD_RMSOURCE) && bigMode == MODE_UNKNOWN) bigMode = MODE_BUILD; - if ((buildArgs.buildAmount & RPMBUILD_RMSPEC) && bigMode == MODE_UNKNOWN) + if ((ba->buildAmount & RPMBUILD_RMSPEC) && bigMode == MODE_UNKNOWN) bigMode = MODE_BUILD; if (initdb) { @@ -887,7 +889,7 @@ int main(int argc, const char ** argv) QVSource = qva->qva_source; } - if (buildArgs.buildRootOverride && bigMode != MODE_BUILD && + if (ba->buildRootOverride && bigMode != MODE_BUILD && bigMode != MODE_REBUILD && bigMode != MODE_TARBUILD) { argerror("--buildroot may only be used during package builds"); } @@ -913,8 +915,8 @@ int main(int argc, const char ** argv) argerror(_("unexpected query source")); if (!(bigMode == MODE_INSTALL || - (bigMode==MODE_BUILD && (buildArgs.buildAmount & RPMBUILD_RMSOURCE))|| - (bigMode==MODE_BUILD && (buildArgs.buildAmount & RPMBUILD_RMSPEC))) + (bigMode==MODE_BUILD && (ba->buildAmount & RPMBUILD_RMSOURCE))|| + (bigMode==MODE_BUILD && (ba->buildAmount & RPMBUILD_RMSPEC))) && force) argerror(_("only installation, upgrading, rmsource and rmspec may be forced")); @@ -1170,13 +1172,13 @@ int main(int argc, const char ** argv) if (!poptPeekArg(optCon)) argerror(_("no packages files given for rebuild")); - buildArgs.buildAmount = RPMBUILD_PREP | RPMBUILD_BUILD | RPMBUILD_INSTALL; + ba->buildAmount = RPMBUILD_PREP | RPMBUILD_BUILD | RPMBUILD_INSTALL; if (bigMode == MODE_REBUILD) { - buildArgs.buildAmount |= RPMBUILD_PACKAGEBINARY; - buildArgs.buildAmount |= RPMBUILD_RMSOURCE; - buildArgs.buildAmount |= RPMBUILD_RMSPEC; - buildArgs.buildAmount |= RPMBUILD_CLEAN; - buildArgs.buildAmount |= RPMBUILD_RMBUILD; + ba->buildAmount |= RPMBUILD_PACKAGEBINARY; + ba->buildAmount |= RPMBUILD_RMSOURCE; + ba->buildAmount |= RPMBUILD_RMSPEC; + ba->buildAmount |= RPMBUILD_CLEAN; + ba->buildAmount |= RPMBUILD_RMBUILD; } while ((pkg = poptGetArg(optCon))) { @@ -1184,7 +1186,7 @@ int main(int argc, const char ** argv) if (ec) break; - ec = build(specFile, &buildArgs, passPhrase, 0, cookie, rcfile, force, noDeps); + ec = build(specFile, ba, passPhrase, 0, cookie, rcfile, force, noDeps); if (ec) break; free(cookie); @@ -1197,34 +1199,34 @@ int main(int argc, const char ** argv) if (rpmGetVerbosity() == RPMMESS_NORMAL) rpmSetVerbosity(RPMMESS_VERBOSE); - switch (buildArgs.buildChar) { + switch (ba->buildChar) { /* these fallthroughs are intentional */ case 'a': - buildArgs.buildAmount |= RPMBUILD_PACKAGESOURCE; + ba->buildAmount |= RPMBUILD_PACKAGESOURCE; /*@fallthrough@*/ case 'b': - buildArgs.buildAmount |= RPMBUILD_PACKAGEBINARY; - buildArgs.buildAmount |= RPMBUILD_CLEAN; + ba->buildAmount |= RPMBUILD_PACKAGEBINARY; + ba->buildAmount |= RPMBUILD_CLEAN; /*@fallthrough@*/ case 'i': - buildArgs.buildAmount |= RPMBUILD_INSTALL; - if ((buildArgs.buildChar == 'i') && buildArgs.shortCircuit) + ba->buildAmount |= RPMBUILD_INSTALL; + if ((ba->buildChar == 'i') && ba->shortCircuit) break; /*@fallthrough@*/ case 'c': - buildArgs.buildAmount |= RPMBUILD_BUILD; - if ((buildArgs.buildChar == 'c') && buildArgs.shortCircuit) + ba->buildAmount |= RPMBUILD_BUILD; + if ((ba->buildChar == 'c') && ba->shortCircuit) break; /*@fallthrough@*/ case 'p': - buildArgs.buildAmount |= RPMBUILD_PREP; + ba->buildAmount |= RPMBUILD_PREP; break; case 'l': - buildArgs.buildAmount |= RPMBUILD_FILECHECK; + ba->buildAmount |= RPMBUILD_FILECHECK; break; case 's': - buildArgs.buildAmount |= RPMBUILD_PACKAGESOURCE; + ba->buildAmount |= RPMBUILD_PACKAGESOURCE; break; } @@ -1236,7 +1238,7 @@ int main(int argc, const char ** argv) } while ((pkg = poptGetArg(optCon))) { - ec = build(pkg, &buildArgs, passPhrase, bigMode == MODE_TARBUILD, + ec = build(pkg, ba, passPhrase, bigMode == MODE_TARBUILD, NULL, rcfile, force, noDeps); if (ec) break; @@ -1365,7 +1367,10 @@ int main(int argc, const char ** argv) /* keeps memory leak checkers quiet */ freeNames(); freeFilesystems(); + freeUrlinfoCache(); if (qva->qva_queryFormat) xfree(qva->qva_queryFormat); + if (ba->buildRootOverride) xfree(ba->buildRootOverride); + if (ba->targets) free(ba->targets); #if HAVE_MCHECK_H && HAVE_MTRACE muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ diff --git a/rpm2cpio.c b/rpm2cpio.c index be6116584..e6ba337ca 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -20,7 +20,7 @@ int main(int argc, char **argv) fdi = ufdOpen(argv[1], O_RDONLY, 0644); } - if (fdFileno(fdi) < 0) { + if (Fileno(fdi) < 0) { perror("cannot open package"); exit(EXIT_FAILURE); } diff --git a/rpmio/macro.c b/rpmio/macro.c index 5980ecd3e..afc0aca66 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -25,7 +25,7 @@ #define _(x) x #define xfree(_p) free((void *)_p) typedef int FD_t; -#define fdFileno(_x) (_x) +#define Ferror(_x) (_x) #define fdOpen open #define Fread(_b, _s, _n, _fd) read(_fd, _b, _s) #define Fclose(_fd) close(_fd) @@ -1341,7 +1341,9 @@ int isCompressed(const char *file, int *compressed) *compressed = COMPRESSED_NOT; - if (fdFileno(fd = fdOpen(file, O_RDONLY, 0)) < 0) { + fd = fdOpen(file, O_RDONLY, 0); + if (Ferror(fd)) { + /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno)); return 1; } diff --git a/tools/dump.c b/tools/dump.c index 4cc290b7e..92506ca06 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -14,7 +14,7 @@ int main(int argc, char ** argv) fdi = fdOpen(argv[1], O_RDONLY, 0644); } - if (fdFileno(fdi) < 0) { + if (Fileno(fdi) < 0) { fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno)); exit(1); } diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 0a351e593..9f89565cf 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -836,7 +836,9 @@ rpmgettext(FD_t fd, const char *file, FILE *ofp) } } - if (fdFileno(fd = fdOpen(fni, O_RDONLY, 0644)) < 0) { + fd = fdOpen(fni, O_RDONLY, 0644); + if (Ferror(fd)) { + /* XXX Fstrerror */ fprintf(stderr, _("rpmgettext: open %s: %s\n"), fni, strerror(errno)); return 2; } diff --git a/tools/rpmheader.c b/tools/rpmheader.c index 2627e710d..61e53bfde 100644 --- a/tools/rpmheader.c +++ b/tools/rpmheader.c @@ -18,9 +18,9 @@ int main(int argc, char **argv) fdi = fdDup(STDIN_FILENO); } else { fdi = fdOpen(argv[1], O_RDONLY, 0644); - if (fdFileno(fdi) < 0) { + if (Ferror(fdi)) { perror(argv[1]); - exit(1); + exit(EXIT_FAILURE); } } diff --git a/tools/rpmlead.c b/tools/rpmlead.c index 89cbf4e8d..48b9cc691 100644 --- a/tools/rpmlead.c +++ b/tools/rpmlead.c @@ -15,9 +15,9 @@ int main(int argc, char **argv) fdi = fdDup(STDIN_FILENO); } else { fdi = fdOpen(argv[1], O_RDONLY, 0644); - if (fdFileno(fdi) < 0) { + if (Ferror(fdi)) { perror(argv[1]); - exit(1); + exit(EXIT_FAILURE); } } diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 1a80e0684..9f825decd 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -16,7 +16,7 @@ int main(int argc, char **argv) fdi = fdDup(STDIN_FILENO); } else { fdi = fdOpen(argv[1], O_RDONLY, 0644); - if (fdFileno(fdi) < 0) { + if (Ferror(fdi)) { perror(argv[1]); exit(1); }