summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-12-01 19:57:17 +0000
committerjbj <devnull@localhost>1999-12-01 19:57:17 +0000
commit8289346751e2d994a83416e90a67b5c96f4b07cd (patch)
treeb4236096b4e0f0a9ab5f8c26d33a82aed67b5a24
parent3678e4a3b548c00667db8587eb3061ac49ae3a67 (diff)
downloadrpm-8289346751e2d994a83416e90a67b5c96f4b07cd.tar.gz
rpm-8289346751e2d994a83416e90a67b5c96f4b07cd.tar.bz2
rpm-8289346751e2d994a83416e90a67b5c96f4b07cd.zip
Add underscore in front of (possibly) non-supported FDIO_t vectors.
Make buildFileList() part of rpmlib API as rpmBuildFileList(). lib/rpmdb.c: Compare fingerprints from different caches by value. CVS patchset: 3448 CVS date: 1999/12/01 19:57:17
-rw-r--r--build/files.c2
-rw-r--r--build/pack.c2
-rw-r--r--lib/falloc.c2
-rw-r--r--lib/formats.c4
-rw-r--r--lib/fprint.h20
-rw-r--r--lib/install.c4
-rw-r--r--lib/macro.c3
-rw-r--r--lib/misc.c2
-rw-r--r--lib/misc.h2
-rw-r--r--lib/rpmdb.c2
-rw-r--r--lib/rpmio.h48
-rw-r--r--lib/rpmlib.h3
-rw-r--r--lib/transaction.c13
-rw-r--r--lib/url.c8
-rw-r--r--lib/verify.c2
-rw-r--r--po/rpm.pot36
-rw-r--r--rpm.spec2
-rw-r--r--rpmio/macro.c3
18 files changed, 87 insertions, 71 deletions
diff --git a/build/files.c b/build/files.c
index f9ab549dc..24b6e3c9e 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1220,7 +1220,7 @@ static int processPackageFiles(Spec spec, Package pkg,
pkg->fileFile, Fstrerror(fd));
return RPMERR_BADFILENAME;
}
- while (fgets(buf, sizeof(buf), fpio->ffileno(fd))) {
+ while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) {
handleComments(buf);
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
rpmError(RPMERR_BADSPEC, _("line: %s"), buf);
diff --git a/build/pack.c b/build/pack.c
index 3ebe95dc1..88dc15b18 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -476,7 +476,7 @@ static StringBuf addFileToTagAux(Spec spec, const char *file, StringBuf sb)
freeStringBuf(sb);
return NULL;
}
- while (fgets(buf, sizeof(buf), fpio->ffileno(fd))) {
+ while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) {
/* XXX display fn in error msg */
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
rpmError(RPMERR_BADSPEC, _("line: %s"), buf);
diff --git a/lib/falloc.c b/lib/falloc.c
index 6cf8e5bb7..3839b2e5f 100644
--- a/lib/falloc.c
+++ b/lib/falloc.c
@@ -43,7 +43,7 @@ FD_t fadOpen(const char * path, int flags, int perms)
if (flags & O_WRONLY)
return NULL;
- fd = ufdio->open(path, flags, perms);
+ fd = ufdio->_open(path, flags, perms);
if (Ferror(fd))
/* XXX Fstrerror */
return NULL;
diff --git a/lib/formats.c b/lib/formats.c
index 26801cb61..77869d36e 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, &filenames, &numFiles);
+ rpmBuildFileList(h, &filenames, &numFiles);
}
if (rpmGetFilesystemList(NULL, count)) {
@@ -339,7 +339,7 @@ static int filenamesTag(Header h, int_32 * type, /*@out@*/void ** data,
int_32 * count, int * freeData) {
*type = RPM_STRING_ARRAY_TYPE;
- buildFileList(h, (const char ***) data, count);
+ rpmBuildFileList(h, (const char ***) data, count);
*freeData = 1;
*freeData = 0; /* XXX WTFO? */
diff --git a/lib/fprint.h b/lib/fprint.h
index 2dae67630..2afc9d27b 100644
--- a/lib/fprint.h
+++ b/lib/fprint.h
@@ -27,10 +27,22 @@ typedef struct fingerprint_s {
/* only if !scarceMemory */
#define fpFree(a) free((void *)(a).baseName)
-#define FP_EQUAL(a, b) ((&(a) == &(b)) || \
- (((a).entry == (b).entry) && \
- !strcmp((a).subDir, (b).subDir) && \
- !strcmp((a).baseName, (b).baseName)))
+#define FP_EQUAL(a, b) ( \
+ (&(a) == &(b)) || ( \
+ ((a).entry == (b).entry) && \
+ !strcmp((a).subDir, (b).subDir) && \
+ !strcmp((a).baseName, (b).baseName) \
+ ))
+
+#define FP_ENTRY_EQUAL(a, b) ( \
+ ((a)->dev == (b)->dev) && \
+ ((a)->ino == (b)->ino) && \
+ !strcmp((a)->dirName, (b)->dirName))
+
+#define FP_EQUAL_DIFFERENT_CACHE(a, b) ( \
+ FP_ENTRY_EQUAL((a).entry, (b).entry) && \
+ !strcmp((a).subDir, (b).subDir) && \
+ !strcmp((a).baseName, (b).baseName))
#ifdef __cplusplus
extern "C" {
diff --git a/lib/install.c b/lib/install.c
index f965e7e9e..842e05bae 100644
--- a/lib/install.c
+++ b/lib/install.c
@@ -109,12 +109,12 @@ static int assembleFileList(Header h, /*@out@*/ struct fileMemory ** memPtr,
if (!headerIsEntry(h, RPMTAG_COMPFILELIST)) return 0;
- buildFileList(h, &mem->names, fileCountPtr);
+ rpmBuildFileList(h, &mem->names, fileCountPtr);
if (headerIsEntry(h, RPMTAG_ORIGCOMPFILELIST)) {
buildOrigFileList(h, &mem->cpioNames, fileCountPtr);
} else {
- buildFileList(h, &mem->cpioNames, fileCountPtr);
+ rpmBuildFileList(h, &mem->cpioNames, fileCountPtr);
}
fileCount = *fileCountPtr;
diff --git a/lib/macro.c b/lib/macro.c
index 0323f2873..4d965a774 100644
--- a/lib/macro.c
+++ b/lib/macro.c
@@ -203,7 +203,8 @@ rdcl(char *buf, size_t size, FD_t fd, int escapes)
*q = '\0';
do {
- if (fgets(q, size, fpio->ffileno(fd)) == NULL) /* read next line */
+ /* read next line */
+ if (fgets(q, size, (FILE *)fdGetFp(fd)) == NULL)
break;
nb = strlen(q);
nread += nb;
diff --git a/lib/misc.c b/lib/misc.c
index 9882a7ffa..969ff8bd6 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -601,7 +601,7 @@ void expandFilelist(Header h)
}
-void buildFileList(Header h, const char *** fileListPtr, int * fileCountPtr)
+void rpmBuildFileList(Header h, const char *** fileListPtr, int * fileCountPtr)
{
doBuildFileList(h, fileListPtr, fileCountPtr,RPMTAG_COMPFILELIST,
RPMTAG_COMPDIRLIST, RPMTAG_COMPFILEDIRS);
diff --git a/lib/misc.h b/lib/misc.h
index 336e73670..9942e7a7c 100644
--- a/lib/misc.h
+++ b/lib/misc.h
@@ -37,8 +37,6 @@ int makeTempFile(const char * prefix, /*@out@*/ const char ** fnptr,
char * currentDirectory(void); /* result needs to be freed */
void compressFilelist(Header h);
void expandFilelist(Header h);
-void buildFileList(Header h, /*@out@*/ const char *** fileListPtr,
- /*@out@*/ int * fileCountPtr);
void buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr,
/*@out@*/ int * fileCountPtr);
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 7e59ae7ed..c45f76274 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -962,7 +962,7 @@ int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList,
/* Add db (recnum,filenum) to list for fingerprint matches. */
for (i = 0; i < num; i++) {
j = im[i].fpNum;
- if (FP_EQUAL(fps[i], fpList[j]))
+ if (FP_EQUAL_DIFFERENT_CACHE(fps[i], fpList[j]))
dbiAppendIndexRecord(&matchList[j], im[i].rec);
}
diff --git a/lib/rpmio.h b/lib/rpmio.h
index 05430a3ae..23ec78f7d 100644
--- a/lib/rpmio.h
+++ b/lib/rpmio.h
@@ -62,18 +62,18 @@ struct FDIO_s {
fdio_ref_function_t * ref;
fdio_deref_function_t * deref;
fdio_new_function_t * new;
- fdio_fileno_function_t * fileno;
-
- fdio_open_function_t * open;
- fdio_fopen_function_t * fopen;
- fdio_ffileno_function_t * ffileno;
- fdio_fflush_function_t * fflush;
-
- fdio_mkdir_function_t * mkdir;
- fdio_chdir_function_t * chdir;
- fdio_rmdir_function_t * rmdir;
- fdio_rename_function_t * rename;
- fdio_unlink_function_t * unlink;
+ fdio_fileno_function_t * _fileno;
+
+ fdio_open_function_t * _open;
+ fdio_fopen_function_t * _fopen;
+ fdio_ffileno_function_t * _ffileno;
+ fdio_fflush_function_t * _fflush;
+
+ fdio_mkdir_function_t * _mkdir;
+ fdio_chdir_function_t * _chdir;
+ fdio_rmdir_function_t * _rmdir;
+ fdio_rename_function_t * _rename;
+ fdio_unlink_function_t * _unlink;
};
/*@observer@*/ const char * Fstrerror(FD_t fd);
@@ -147,8 +147,8 @@ extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode);
#define fdNew(_msg) fdio->new(_msg, __FILE__, __LINE__)
#if 0
-#define fdFileno fdio->fileno
-#define fdOpen fdio->open
+#define fdFileno fdio->_fileno
+#define fdOpen fdio->_open
#endif
int fdWritable(FD_t fd, int secs);
@@ -195,16 +195,16 @@ const char *const ftpStrerror(int errorNumber);
#define ufdLink ufdio->ref
#define ufdFree ufdio->deref
#define ufdNew ufdio->new
-#define ufdFileno ufdio->fileno
-#define ufdOpen ufdio->open
-#define ufdFopen ufdio->fopen
-#define ufdFfileno ufdio->ffileno
-#define ufdFflush ufdio->fflush
-#define ufdMkdir ufdio->mkdir
-#define ufdChdir ufdio->chdir
-#define ufdRmdir ufdio->rmdir
-#define ufdRename ufdio->rename
-#define ufdUnlink ufdio->unlink
+#define ufdFileno ufdio->_fileno
+#define ufdOpen ufdio->_open
+#define ufdFopen ufdio->_fopen
+#define ufdFfileno ufdio->_ffileno
+#define ufdFflush ufdio->_fflush
+#define ufdMkdir ufdio->_mkdir
+#define ufdChdir ufdio->_chdir
+#define ufdRmdir ufdio->_rmdir
+#define ufdRename ufdio->_rename
+#define ufdUnlink ufdio->_unlink
#endif
int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length);
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index 28ee09123..000b28bc7 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -22,6 +22,9 @@ int rpmReadPackageHeader(FD_t fd, /*@out@*/ Header * hdr,
int headerNVR(Header h, /*@out@*/ const char **np, /*@out@*/ const char **vp,
/*@out@*/ const char **rp);
+void rpmBuildFileList(Header h, /*@out@*/ const char *** fileListPtr,
+ /*@out@*/ int * fileCountPtr);
+
/* 0 = success */
/* 1 = bad magic */
/* 2 = error */
diff --git a/lib/transaction.c b/lib/transaction.c
index 86c581715..712d231df 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -740,7 +740,8 @@ static int handleInstInstalledFiles(TFI_t * fi, rpmdb db,
uint_16 * otherModes;
int numReplaced = 0;
- if ((h = rpmdbGetRecord(db, shared->otherPkg)) == NULL)
+ h = rpmdbGetRecord(db, shared->otherPkg);
+ if (h == NULL)
return 1;
headerGetEntryMinMemory(h, RPMTAG_FILEMD5S, NULL,
@@ -775,7 +776,7 @@ static int handleInstInstalledFiles(TFI_t * fi, rpmdb db,
if (reportConflicts)
psAppendFile(probs, RPMPROB_FILE_CONFLICT, fi->ap->key,
fi->ap->h, fi->dnl[fi->dil[fileNum]],
- fi->bnl[fileNum], h,0 );
+ fi->bnl[fileNum], h, 0);
if (!(otherFlags[otherFileNum] | fi->fflags[fileNum])
& RPMFILE_CONFIG) {
if (!shared->isRemoved)
@@ -820,7 +821,8 @@ static int handleRmvdInstalledFiles(TFI_t * fi, rpmdb db,
const char * otherStates;
int i;
- if ((h = rpmdbGetRecord(db, shared->otherPkg)) == NULL)
+ h = rpmdbGetRecord(db, shared->otherPkg);
+ if (h == NULL)
return 1;
headerGetEntryMinMemory(h, RPMTAG_FILESTATES, NULL,
@@ -1249,8 +1251,8 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
* - count files.
*/
/* The ordering doesn't matter here */
- for (alp = ts->addedPackages.list; (alp - ts->addedPackages.list) <
- ts->addedPackages.size; alp++) {
+ for (alp = ts->addedPackages.list;
+ (alp - ts->addedPackages.list) < ts->addedPackages.size; alp++) {
if (!archOkay(alp->h) && !(ignoreSet & RPMPROB_FILTER_IGNOREARCH))
psAppend(probs, RPMPROB_BADARCH, alp->key, alp->h, NULL, NULL, 0);
@@ -1341,7 +1343,6 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
fi->type = TR_REMOVED;
break;
}
-
if (!headerGetEntry(fi->h, RPMTAG_COMPFILELIST, NULL,
(void **) &fi->bnl, &fi->fc)) {
/* This catches removed packages w/ no file lists */
diff --git a/lib/url.c b/lib/url.c
index 361d1685c..adfb776da 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -68,9 +68,9 @@ DBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, li
#ifndef NOTYET
FILE * fp = fdGetFp(u->ctrl);
if (fp) {
- fdPush(u->ctrl, fpio, fp, fileno(fp)); /* Push fpio onto stack */
+ fdPush(u->ctrl, fpio, fp, -1); /* Push fpio onto stack */
Fclose(u->ctrl);
- } else if (fdio->fileno(u->ctrl) >= 0)
+ } else if (fdio->_fileno(u->ctrl) >= 0)
fdio->close(u->ctrl);
#else
Fclose(u->ctrl);
@@ -85,9 +85,9 @@ DBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, li
#ifndef NOTYET
FILE * fp = fdGetFp(u->data);
if (fp) {
- fdPush(u->data, fpio, fp, fileno(fp)); /* Push fpio onto stack */
+ fdPush(u->data, fpio, fp, -1); /* Push fpio onto stack */
Fclose(u->data);
- } else if (fdio->fileno(u->data) >= 0)
+ } else if (fdio->_fileno(u->data) >= 0)
fdio->close(u->data);
#else
Fclose(u->ctrl);
diff --git a/lib/verify.c b/lib/verify.c
index b44f67f63..1314601fc 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -259,7 +259,7 @@ static int verifyHeader(QVA_t *qva, Header h)
if (headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlagsList, NULL) &&
headerIsEntry(h, RPMTAG_COMPFILELIST)) {
- buildFileList(h, &fileNames, &count);
+ rpmBuildFileList(h, &fileNames, &count);
for (i = 0; i < count; i++) {
if ((rc = rpmVerifyFile(qva->qva_prefix, h, i, &verifyResult, omitMask)) != 0) {
diff --git a/po/rpm.pot b/po/rpm.pot
index e82be64b7..db4b19215 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-30 13:24-0500\n"
+"POT-Creation-Date: 1999-12-01 14:50-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2310,78 +2310,78 @@ msgid "======================== active %d empty %d\n"
msgstr ""
#. XXX just in case
-#: lib/macro.c:257
+#: lib/macro.c:258
#, c-format
msgid "%3d>%*s(empty)"
msgstr ""
-#: lib/macro.c:292
+#: lib/macro.c:293
#, c-format
msgid "%3d<%*s(empty)\n"
msgstr ""
-#: lib/macro.c:471
+#: lib/macro.c:472
msgid "Macro %%%s has unterminated body"
msgstr ""
-#: lib/macro.c:497
+#: lib/macro.c:498
msgid "Macro %%%s has illegal name (%%define)"
msgstr ""
-#: lib/macro.c:503
+#: lib/macro.c:504
msgid "Macro %%%s has unterminated opts"
msgstr ""
-#: lib/macro.c:508
+#: lib/macro.c:509
msgid "Macro %%%s has empty body"
msgstr ""
-#: lib/macro.c:513
+#: lib/macro.c:514
msgid "Macro %%%s failed to expand"
msgstr ""
-#: lib/macro.c:538
+#: lib/macro.c:539
msgid "Macro %%%s has illegal name (%%undefine)"
msgstr ""
-#: lib/macro.c:615
+#: lib/macro.c:616
msgid "Macro %%%s (%s) was not used below level %d"
msgstr ""
-#: lib/macro.c:712
+#: lib/macro.c:713
#, c-format
msgid "Unknown option %c in %s(%s)"
msgstr ""
-#: lib/macro.c:892
+#: lib/macro.c:893
#, c-format
msgid "Recursion depth(%d) greater than max(%d)"
msgstr ""
-#: lib/macro.c:958 lib/macro.c:974
+#: lib/macro.c:959 lib/macro.c:975
#, c-format
msgid "Unterminated %c: %s"
msgstr ""
-#: lib/macro.c:1014
+#: lib/macro.c:1015
msgid "A %% is followed by an unparseable macro"
msgstr ""
-#: lib/macro.c:1140
+#: lib/macro.c:1141
msgid "Macro %%%.*s not found, skipping"
msgstr ""
-#: lib/macro.c:1221
+#: lib/macro.c:1222
msgid "Target buffer overflow"
msgstr ""
#. XXX Fstrerror
-#: lib/macro.c:1376 lib/macro.c:1381
+#: lib/macro.c:1377 lib/macro.c:1382
#, c-format
msgid "File %s: %s"
msgstr ""
-#: lib/macro.c:1384
+#: lib/macro.c:1385
#, c-format
msgid "File %s is smaller than %d bytes"
msgstr ""
diff --git a/rpm.spec b/rpm.spec
index d79cac874..9ff13b313 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -2,7 +2,7 @@ Summary: The Red Hat package management system.
Name: rpm
%define version 3.0.4
Version: %{version}
-Release: 0.2
+Release: 0.3
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Copyright: GPL
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 0323f2873..4d965a774 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -203,7 +203,8 @@ rdcl(char *buf, size_t size, FD_t fd, int escapes)
*q = '\0';
do {
- if (fgets(q, size, fpio->ffileno(fd)) == NULL) /* read next line */
+ /* read next line */
+ if (fgets(q, size, (FILE *)fdGetFp(fd)) == NULL)
break;
nb = strlen(q);
nread += nb;