summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-09-25 20:51:34 +0000
committerjbj <devnull@localhost>2001-09-25 20:51:34 +0000
commit92556605afa18d27318aa526985e231e60ea70d7 (patch)
tree13feb3c89b657c880e660ff92e176c412bb4b5e0 /lib
parentcb216009409823affa8e24c880b910fdd9531fb0 (diff)
downloadrpm-92556605afa18d27318aa526985e231e60ea70d7.tar.gz
rpm-92556605afa18d27318aa526985e231e60ea70d7.tar.bz2
rpm-92556605afa18d27318aa526985e231e60ea70d7.zip
- legacy: drop brokenMD5 support (rrpm-2.3.3 to rpm-2.3.8 on sparc).
- eliminate DYING code. CVS patchset: 5082 CVS date: 2001/09/25 20:51:34
Diffstat (limited to 'lib')
-rw-r--r--lib/cpio.c1
-rw-r--r--lib/cpio.h3
-rw-r--r--lib/depends.c2
-rw-r--r--lib/fsm.c2
-rw-r--r--lib/fsm.h1
-rw-r--r--lib/manifest.c3
-rw-r--r--lib/misc.c10
-rw-r--r--lib/misc.h69
-rw-r--r--lib/psm.c3
-rw-r--r--lib/psm.h3
-rw-r--r--lib/rpmlib.h6
-rw-r--r--lib/rpmrc.c34
-rw-r--r--lib/signature.c6
-rw-r--r--lib/transaction.c110
-rw-r--r--lib/verify.c34
15 files changed, 101 insertions, 186 deletions
diff --git a/lib/cpio.c b/lib/cpio.c
index 231272d17..15242798d 100644
--- a/lib/cpio.c
+++ b/lib/cpio.c
@@ -8,7 +8,6 @@
*/
#include "system.h"
-#include <rpmlib.h>
#include "fsm.h"
#include "rpmerr.h"
diff --git a/lib/cpio.h b/lib/cpio.h
index 9fe288f4c..faf8a366c 100644
--- a/lib/cpio.h
+++ b/lib/cpio.h
@@ -12,10 +12,11 @@
*
*/
-#include <zlib.h>
#include <sys/types.h>
+#include <zlib.h>
#include <rpmio_internal.h>
+#include <rpmlib.h>
/** \ingroup payload
* @note CPIO_CHECK_ERRNO bit is set only if errno is valid.
diff --git a/lib/depends.c b/lib/depends.c
index 98c7895cf..15401ce5d 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -1305,7 +1305,7 @@ static int unsatisfiedDepend(rpmTransactionSet ts,
}
mi = rpmdbFreeIterator(mi);
-#ifndef DYING
+#ifdef DYING
mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, keyName, 0);
(void) rpmdbPruneIterator(mi,
ts->removedPackages, ts->numRemovedPackages, 1);
diff --git a/lib/fsm.c b/lib/fsm.c
index ad7497bf7..ec4a6d1d5 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -652,7 +652,6 @@ int fsmMapAttrs(FSM_t fsm)
/** \ingroup payload
* Create file from payload stream.
- * @todo Legacy: support brokenEndian MD5 checks?
* @param fsm file state machine data
* @return 0 on success
*/
@@ -672,7 +671,6 @@ static int expandRegular(/*@special@*/ FSM_t fsm)
/* XXX md5sum's will break on repackaging that includes modified files. */
fmd5sum = fsm->fmd5sum;
- /* XXX This doesn't support brokenEndian checks. */
if (st->st_size > 0 && fmd5sum)
fdInitMD5(fsm->wfd, 0);
diff --git a/lib/fsm.h b/lib/fsm.h
index 23f5c1457..8011636f2 100644
--- a/lib/fsm.h
+++ b/lib/fsm.h
@@ -6,7 +6,6 @@
* File state machine to handle a payload within an rpm package.
*/
-#include <rpmlib.h>
#include "cpio.h"
/**
diff --git a/lib/manifest.c b/lib/manifest.c
index c1480ec84..c1223835d 100644
--- a/lib/manifest.c
+++ b/lib/manifest.c
@@ -4,8 +4,9 @@
#include "system.h"
-#include <rpmlib.h>
#include <rpmio_internal.h>
+#include <rpmlib.h>
+
#include "stringbuf.h"
#include "manifest.h"
#include "misc.h"
diff --git a/lib/misc.c b/lib/misc.c
index c677d41cb..03934173d 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -6,19 +6,18 @@
static int _debug = 0;
-#include <rpmlib.h>
+#include "rpmio_internal.h"
#include <rpmurl.h>
#include <rpmmacro.h> /* XXX for rpmGetPath */
+#include <rpmlib.h>
-#include "rpmio_internal.h"
#include "misc.h"
#include "debug.h"
/*@access Header@*/ /* XXX compared with NULL */
/*@access FD_t@*/ /* XXX compared with NULL */
-int domd5(const char * fn, unsigned char * digest, int asAscii,
- int brokenEndian)
+int domd5(const char * fn, unsigned char * digest, int asAscii)
{
int rc;
@@ -33,8 +32,7 @@ int domd5(const char * fn, unsigned char * digest, int asAscii,
return 1;
}
- /* Preserve legacy "brokenEndian" behavior. */
- fdInitMD5(fd, brokenEndian);
+ fdInitMD5(fd, 0);
while ((rc = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
{};
diff --git a/lib/misc.h b/lib/misc.h
index dc4e91e6e..c4df521ab 100644
--- a/lib/misc.h
+++ b/lib/misc.h
@@ -26,12 +26,10 @@ extern "C" {
* @param fn file name
* @retval digest address of md5sum
* @param asAscii return md5sum as ascii string?
- * @param brokenEndian calculate broken MD5 sum?
* @return 0 on success, 1 on error
*/
/*@-exportlocal@*/
-int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii,
- int brokenEndian)
+int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii)
/*@modifies digest, fileSystem @*/;
/*@=exportlocal@*/
@@ -46,7 +44,7 @@ int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii,
int mdfile(const char * fn, /*@out@*/ unsigned char * digest)
/*@modifies digest, fileSystem @*/
{
- return domd5(fn, digest, 1, 0);
+ return domd5(fn, digest, 1);
}
/**
@@ -60,45 +58,22 @@ int mdfile(const char * fn, /*@out@*/ unsigned char * digest)
int mdbinfile(const char * fn, /*@out@*/ unsigned char * bindigest)
/*@modifies bindigest, fileSystem @*/
{
- return domd5(fn, bindigest, 0, 0);
-}
-
-/**
- * Return (broken!) MD5 sum of file as ASCII string.
- * @deprecated Here for compatibility with old (broken) versions of RPM.
- * @todo Eliminate, use beecrypt instead.
- * @param fn file name
- * @retval digest MD5 digest
- * @return 0 on success, 1 on error
- */
-/*@unused@*/ static inline
-int mdfileBroken(const char * fn, /*@out@*/ unsigned char * digest)
- /*@modifies digest, fileSystem @*/
-{
- return domd5(fn, digest, 1, 1);
-}
-
-/**
- * Return (broken!) MD5 sum of file as binary data.
- * @deprecated Here for compatibility with old (broken) versions of RPM.
- * @todo Eliminate, use beecrypt instead.
- * @param fn file name
- * @retval bindigest MD5 digest
- * @return 0 on success, 1 on error
- */
-/*@unused@*/ static inline
-int mdbinfileBroken(const char * fn, /*@out@*/ unsigned char * bindigest)
- /*@modifies bindigest, fileSystem @*/
-{
- return domd5(fn, bindigest, 0, 1);
+ return domd5(fn, bindigest, 0);
}
/**
+ * Split string into fields separated by a character.
+ * @param str string
+ * @param length length of string
+ * @param sep separator character
+ * @return (malloc'd) argv array
*/
/*@only@*/ char ** splitString(const char * str, int length, char sep)
/*@*/;
/**
+ * Free split string argv array.
+ * @param list argv array
*/
void freeSplitString( /*@only@*/ char ** list)
/*@modifies list @*/;
@@ -120,21 +95,27 @@ void freeSplitString( /*@only@*/ char ** list)
}
/**
+ * Check if file esists using stat(2).
+ * @param urlfn file name (may be URL)
+ * @return 1 if file exists, 0 if not
*/
int rpmfileexists(const char * urlfn)
/*@modifies fileSystem @*/;
-/*
- * These are like the libc functions, but they malloc() the space which
- * is needed.
- */
-
/**
+ * Like the libc function, but malloc()'s the space needed.
+ * @param name variable name
+ * @param value variable value
+ * @param overwrte should an existing variable be changed?
+ * @return 0 on success
*/
int dosetenv(const char * name, const char * value, int overwrite)
/*@modifies fileSystem @*/;
/**
+ * Like the libc function, but malloc()'s the space needed.
+ * @param str "name=value" string
+ * @return 0 on success
*/
int doputenv(const char * str)
/*@modifies fileSystem @*/;
@@ -165,16 +146,21 @@ int makeTempFile(/*@null@*/ const char * prefix,
/*@modifies fileSystem @*/;
/**
+ * Convert absolute path tag to (dirname,basename,dirindex) tags.
+ * @param h header
*/
void compressFilelist(Header h)
/*@modifies h @*/;
/**
+ * Convert (dirname,basename,dirindex) tags to absolute path tag.
+ * @param h header
*/
void expandFilelist(Header h)
/*@modifies h @*/;
/**
+ * @param h header
*/
void buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr,
/*@out@*/ int * fileCountPtr)
@@ -191,6 +177,9 @@ int rpmGlob(const char * patterns, /*@out@*/ int * argcPtr,
/*@modifies *argcPtr, *argvPtr, fileSystem @*/;
/**
+ * Retrofit a Provides: name = version-release dependency into legacy
+ * packages.
+ * @param h header
*/
void providePackageNVR(Header h)
/*@modifies h @*/;
diff --git a/lib/psm.c b/lib/psm.c
index 1e62d758c..32ba81013 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -5,11 +5,10 @@
#include "system.h"
-#include <rpmlib.h>
+#include "psm.h"
#include <rpmmacro.h>
#include <rpmurl.h>
-#include "psm.h"
#include "rpmlead.h" /* writeLead proto */
#include "signature.h" /* signature constants */
#include "misc.h"
diff --git a/lib/psm.h b/lib/psm.h
index a88b0de64..361db1ae9 100644
--- a/lib/psm.h
+++ b/lib/psm.h
@@ -6,9 +6,8 @@
* Package state machine to handle a package from a transaction set.
*/
-#include <rpmlib.h>
-#include "depends.h"
#include "fsm.h"
+#include "depends.h"
/**
*/
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index 3194a313b..0fd06593a 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -301,7 +301,7 @@ typedef enum rpmTag_e {
RPMTAG_CHANGELOGTIME = 1080,
RPMTAG_CHANGELOGNAME = 1081,
RPMTAG_CHANGELOGTEXT = 1082,
- RPMTAG_BROKENMD5 = 1083, /*!< internal */
+ RPMTAG_BROKENMD5 = 1083, /*!< internal - obsolete */
RPMTAG_PREREQ = 1084, /*!< internal */
RPMTAG_PREINPROG = 1085,
RPMTAG_POSTINPROG = 1086,
@@ -325,7 +325,7 @@ typedef enum rpmTag_e {
RPMTAG_AUTOREQ = 1103, /*!< internal */
RPMTAG_AUTOPROV = 1104, /*!< internal */
/*@-enummemuse@*/
- RPMTAG_CAPABILITY = 1105, /*!< internal obsolete */
+ RPMTAG_CAPABILITY = 1105, /*!< internal - obsolete */
/*@=enummemuse@*/
RPMTAG_SOURCEPACKAGE = 1106, /*!< internal */
/*@-enummemuse@*/
@@ -335,7 +335,7 @@ typedef enum rpmTag_e {
RPMTAG_BUILDREQUIRES = 1109, /*!< internal */
RPMTAG_BUILDCONFLICTS = 1110, /*!< internal */
/*@-enummemuse@*/
- RPMTAG_BUILDMACROS = 1111, /*!< internal */
+ RPMTAG_BUILDMACROS = 1111, /*!< internal - unused */
/*@=enummemuse@*/
RPMTAG_PROVIDEFLAGS = 1112,
RPMTAG_PROVIDEVERSION = 1113,
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
index 2f7ccc042..898719f3a 100644
--- a/lib/rpmrc.c
+++ b/lib/rpmrc.c
@@ -307,18 +307,11 @@ static int addCanon(canonEntry * table, int * tableLen, char * line,
const char * tshort_name;
int tnum;
-#ifdef DYING
- if (! *tableLen) {
- *tableLen = 2;
- *table = xmalloc(2 * sizeof(struct canonEntry_s));
- } else
-#endif
- {
- (*tableLen) += 2;
- /*@-unqualifiedtrans@*/
- *table = xrealloc(*table, sizeof(struct canonEntry_s) * (*tableLen));
- /*@=unqualifiedtrans@*/
- }
+ (*tableLen) += 2;
+ /*@-unqualifiedtrans@*/
+ *table = xrealloc(*table, sizeof(struct canonEntry_s) * (*tableLen));
+ /*@=unqualifiedtrans@*/
+
t = & ((*table)[*tableLen - 2]);
tname = strtok(line, ": \t");
@@ -363,18 +356,11 @@ static int addDefault(defaultEntry * table, int * tableLen, char * line,
{
defaultEntry t;
-#ifdef DYING
- if (! *tableLen) {
- *tableLen = 1;
- *table = xmalloc(sizeof(struct defaultEntry_s));
- } else
-#endif
- {
- (*tableLen)++;
- /*@-unqualifiedtrans@*/
- *table = xrealloc(*table, sizeof(struct defaultEntry_s) * (*tableLen));
- /*@=unqualifiedtrans@*/
- }
+ (*tableLen)++;
+ /*@-unqualifiedtrans@*/
+ *table = xrealloc(*table, sizeof(struct defaultEntry_s) * (*tableLen));
+ /*@=unqualifiedtrans@*/
+
t = & ((*table)[*tableLen - 1]);
/*@-temptrans@*/
diff --git a/lib/signature.c b/lib/signature.c
index 29abe7da0..b56a312b3 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -860,10 +860,6 @@ rpmVerifySignature(const char * file, int_32 sigTag, const void * sig,
case RPMSIGTAG_MD5:
return verifyMD5Signature(file, sig, result, mdbinfile);
/*@notreached@*/ break;
- case RPMSIGTAG_LEMD5_1:
- case RPMSIGTAG_LEMD5_2:
- return verifyMD5Signature(file, sig, result, mdbinfileBroken);
- /*@notreached@*/ break;
case RPMSIGTAG_PGP5: /* XXX legacy */
case RPMSIGTAG_PGP:
return verifyPGPSignature(file, sig, count, result);
@@ -871,6 +867,8 @@ rpmVerifySignature(const char * file, int_32 sigTag, const void * sig,
case RPMSIGTAG_GPG:
return verifyGPGSignature(file, sig, count, result);
/*@notreached@*/ break;
+ case RPMSIGTAG_LEMD5_1:
+ case RPMSIGTAG_LEMD5_2:
default:
sprintf(result, "Do not know how to verify sig type %d\n", sigTag);
return RPMSIG_UNKNOWN;
diff --git a/lib/transaction.c b/lib/transaction.c
index c64364f11..bcff11849 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -4,10 +4,9 @@
#include "system.h"
-#include <rpmlib.h>
+#include "psm.h"
#include <rpmmacro.h> /* XXX for rpmExpand */
-#include "psm.h"
#include "fprint.h"
#include "rpmhash.h"
#include "misc.h" /* XXX stripTrailingChar, splitString, currentDirectory */
@@ -47,6 +46,8 @@ extern const char * chroot_prefix;
/*@access rpmProblemSet@*/
/*@access rpmProblem@*/
+/**
+ */
struct diskspaceInfo {
dev_t dev; /*!< file system device number. */
signed long bneeded; /*!< no. of blocks needed. */
@@ -56,7 +57,9 @@ struct diskspaceInfo {
signed long iavail; /*!< no. of inodes available. */
};
-/* Adjust for root only reserved space. On linux e2fs, this is 5%. */
+/**
+ * Adjust for root only reserved space. On linux e2fs, this is 5%.
+ */
#define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
/* argon thought a shift optimization here was a waste of time... he's
@@ -65,6 +68,8 @@ struct diskspaceInfo {
#define XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b))))
+/**
+ */
static /*@null@*/ void * freeFl(rpmTransactionSet ts,
/*@only@*/ /*@null@*/ TFI_t flList)
/*@*/
@@ -119,6 +124,8 @@ int rpmtransGetKeys(const rpmTransactionSet ts, const void *** ep, int * nep)
return rc;
}
+/**
+ */
static rpmProblemSet psCreate(void)
/*@*/
{
@@ -131,6 +138,8 @@ static rpmProblemSet psCreate(void)
return probs;
}
+/**
+ */
static void psAppend(rpmProblemSet probs, rpmProblemType type,
const struct availablePackage * alp,
const char * dn, const char *bn,
@@ -196,6 +205,8 @@ static void psAppend(rpmProblemSet probs, rpmProblemType type,
}
}
+/**
+ */
static int archOkay(Header h)
/*@*/
{
@@ -227,6 +238,8 @@ static int archOkay(Header h)
return 1;
}
+/**
+ */
static int osOkay(Header h)
/*@*/
{
@@ -266,6 +279,8 @@ void rpmProblemSetFree(rpmProblemSet probs)
free(probs);
}
+/**
+ */
static /*@observer@*/ const char *const ftstring (fileTypes ft)
/*@*/
{
@@ -282,6 +297,8 @@ static /*@observer@*/ const char *const ftstring (fileTypes ft)
/*@notreached@*/
}
+/**
+ */
static fileTypes whatis(uint_16 mode)
/*@*/
{
@@ -369,11 +386,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi,
return headerLink(origH);
}
-#ifdef DYING
- h = headerCopy(origH);
-#else
h = headerLink(origH);
-#endif
relocations = alloca(sizeof(*relocations) * numRelocations);
@@ -721,7 +734,8 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi,
return h;
}
-/*
+/**
+ * Filter a problem set.
* As the problem sets are generated in an order solely dependent
* on the ordering of the packages in the transaction, and that
* ordering can't be changed, the problem sets must be parallel to
@@ -729,6 +743,10 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi,
* target set, given the operations available on transaction set.
* This is good, as it lets us perform this trim in linear time, rather
* then logarithmic or quadratic.
+ *
+ * @param filter filter
+ * @param target problem set
+ * @return 0 no problems, 1 if problems remain
*/
static int psTrim(rpmProblemSet filter, rpmProblemSet target)
/*@modifies target @*/
@@ -753,7 +771,7 @@ static int psTrim(rpmProblemSet filter, rpmProblemSet target)
}
if ((t - target->probs) == target->numProblems) {
- /* this can't happen ;-) lets be sane if it doesn though */
+ /* this can't happen ;-) let's be sane if it doesn though */
break;
}
@@ -767,6 +785,8 @@ static int psTrim(rpmProblemSet filter, rpmProblemSet target)
return gotProblems;
}
+/**
+ */
static int sharedCmp(const void * one, const void * two)
/*@*/
{
@@ -781,11 +801,13 @@ static int sharedCmp(const void * one, const void * two)
return 0;
}
+/**
+ */
static fileAction decideFileFate(const char * dirName,
const char * baseName, short dbMode,
const char * dbMd5, const char * dbLink, short newMode,
const char * newMd5, const char * newLink, int newFlags,
- int brokenMd5, rpmtransFlags transFlags)
+ rpmtransFlags transFlags)
/*@*/
{
char buffer[1024];
@@ -834,10 +856,7 @@ static fileAction decideFileFate(const char * dirName,
}
if (dbWhat == REG) {
- if (brokenMd5)
- rc = mdfileBroken(filespec, buffer);
- else
- rc = mdfile(filespec, buffer);
+ rc = mdfile(filespec, buffer);
if (rc) {
/* assume the file has been removed, don't freak */
@@ -878,6 +897,8 @@ static fileAction decideFileFate(const char * dirName,
return save;
}
+/**
+ */
static int filecmp(short mode1, const char * md51, const char * link1,
short mode2, const char * md52, const char * link2)
/*@*/
@@ -895,6 +916,8 @@ static int filecmp(short mode1, const char * md51, const char * link1,
return 0;
}
+/**
+ */
static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db,
struct sharedFileInfo * shared,
int sharedCount, int reportConflicts,
@@ -974,7 +997,6 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db,
fi->fmd5s[fileNum],
fi->flinks[fileNum],
fi->fflags[fileNum],
- !headerIsEntry(h, RPMTAG_RPMVERSION),
transFlags);
}
@@ -992,6 +1014,8 @@ static int handleInstInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db,
return 0;
}
+/**
+ */
static int handleRmvdInstalledFiles(TFI_t fi, /*@null@*/ rpmdb db,
struct sharedFileInfo * shared,
int sharedCount)
@@ -1232,6 +1256,8 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht,
if (filespec) free(filespec);
}
+/**
+ */
static int ensureOlder(struct availablePackage * alp, Header old,
rpmProblemSet probs)
/*@modifies alp, probs @*/
@@ -1251,6 +1277,8 @@ static int ensureOlder(struct availablePackage * alp, Header old,
return rc;
}
+/**
+ */
static void skipFiles(const rpmTransactionSet ts, TFI_t fi)
/*@modifies fi @*/
{
@@ -1524,9 +1552,6 @@ int rpmRunTransactions( rpmTransactionSet ts,
int i, j;
int ourrc = 0;
struct availablePackage * alp;
-#ifdef DYING
- Header * hdrs;
-#endif
int totalFileCount = 0;
hashTable ht;
TFI_t fi;
@@ -1625,10 +1650,6 @@ int rpmRunTransactions( rpmTransactionSet ts,
if (dip) ts->di[i].bsize = 0;
}
-#ifdef DYING
- hdrs = alloca(sizeof(*hdrs) * ts->addedPackages.size);
-#endif
-
/* ===============================================
* For packages being installed:
* - verify package arch/os.
@@ -1720,22 +1741,12 @@ int rpmRunTransactions( rpmTransactionSet ts,
fi->ap = tsGetAlp(tsi);
fi->record = 0;
loadFi(fi->ap->h, fi);
- if (fi->fc == 0) {
-#ifdef DYING
- hdrs[i] = headerLink(fi->h);
-#endif
+ if (fi->fc == 0)
continue;
- }
-#ifdef DYING
- /* Allocate file actions (and initialize to FA_UNKNOWN) */
- fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
- hdrs[i] = relocateFileList(ts, fi, fi->ap, fi->h, fi->actions);
-#else
{ Header foo = relocateFileList(ts, fi, fi->ap, fi->h, fi->actions);
foo = headerFree(foo);
}
-#endif
/* Skip netshared paths, not our i18n files, and excluded docs */
skipFiles(ts, fi);
@@ -1765,11 +1776,6 @@ int rpmRunTransactions( rpmTransactionSet ts,
}
tsi = tsFreeIterator(tsi);
-#ifdef DYING
- /* Open all database indices before installing. */
- (void) rpmdbOpenAll(ts->rpmdb);
-#endif
-
if (!ts->chrootDone) {
(void) chdir("/");
/*@-unrecog -superuser @*/
@@ -1978,16 +1984,6 @@ int rpmRunTransactions( rpmTransactionSet ts,
{
*newProbs = ts->probs;
-#ifdef DYING
- for (alp = ts->addedPackages.list, fi = ts->flList;
- (alp - ts->addedPackages.list) < ts->addedPackages.size;
- alp++, fi++)
- {
- hdrs[alp - ts->addedPackages.list] =
- headerFree(hdrs[alp - ts->addedPackages.list]);
- }
-#endif
-
ts->flList = freeFl(ts, ts->flList);
ts->flEntries = 0;
/*@-nullstate@*/
@@ -2040,11 +2036,8 @@ assert(alp == fi->ap);
if (alp->fd) {
rpmRC rpmrc;
-#ifdef DYING
- hdrs[i] = headerFree(hdrs[i]);
-#else
h = headerFree(h);
-#endif
+
/*@-mustmod@*/ /* LCL: segfault */
rpmrc = rpmReadPackageHeader(alp->fd, &h, NULL, NULL, NULL);
/*@=mustmod@*/
@@ -2054,15 +2047,10 @@ assert(alp == fi->ap);
alp->fd = NULL;
ourrc++;
} else {
-#ifdef DYING
- hdrs[i] = relocateFileList(ts, fi, alp, h, NULL);
- h = headerFree(h);
-#else
Header foo = relocateFileList(ts, fi, alp, h, NULL);
h = headerFree(h);
h = headerLink(foo);
foo = headerFree(foo);
-#endif
}
if (alp->fd) gotfd = 1;
}
@@ -2075,11 +2063,7 @@ assert(alp == fi->ap);
hsave = headerLink(fi->h);
fi->h = headerFree(fi->h);
}
-#ifdef DYING
- fi->h = headerLink(hdrs[i]);
-#else
fi->h = headerLink(h);
-#endif
if (alp->multiLib)
ts->transFlags |= RPMTRANS_FLAG_MULTILIB;
@@ -2098,11 +2082,7 @@ assert(alp == fi->ap);
lastFailed = i;
}
-#ifdef DYING
- hdrs[i] = headerFree(hdrs[i]);
-#else
h = headerFree(h);
-#endif
if (gotfd) {
(void)ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0,
diff --git a/lib/verify.c b/lib/verify.c
index 2d05dd93f..9d6d0d8c7 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -5,9 +5,9 @@
#include "system.h"
+#include "psm.h"
#include <rpmcli.h>
-#include "psm.h"
#include "misc.h" /* XXX for uidToUname() and gnameToGid() */
#include "debug.h"
@@ -16,14 +16,6 @@
/*@access FD_t*/ /* XXX compared with NULL */
/*@access rpmdb*/ /* XXX compared with NULL */
-static int _ie = 0x44332211;
-static union _vendian {
-/*@unused@*/ int i;
- char b[4];
-} *_endian = (union _vendian *)&_ie;
-#define IS_BIG_ENDIAN() (_endian->b[0] == '\x44')
-#define IS_LITTLE_ENDIAN() (_endian->b[0] == '\x11')
-
#define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m)))
int rpmVerifyFile(const char * root, Header h, int filenum,
@@ -41,27 +33,6 @@ int rpmVerifyFile(const char * root, Header h, int filenum,
int count;
int rc;
struct stat sb;
- int_32 useBrokenMd5;
-
- if (IS_BIG_ENDIAN()) { /* XXX was ifdef WORDS_BIGENDIAN */
- int_32 * brokenPtr;
- if (!hge(h, RPMTAG_BROKENMD5, NULL, (void **) &brokenPtr, NULL)) {
- HAE_t hae = (HAE_t)headerAddEntry;
- const char * rpmVersion;
-
- if (hge(h, RPMTAG_RPMVERSION, NULL, (void **) &rpmVersion, NULL)) {
- useBrokenMd5 = ((rpmvercmp(rpmVersion, "2.3.3") >= 0) &&
- (rpmvercmp(rpmVersion, "2.3.8") <= 0));
- } else {
- useBrokenMd5 = 1;
- }
- (void) hae(h, RPMTAG_BROKENMD5, RPM_INT32_TYPE, &useBrokenMd5, 1);
- } else {
- useBrokenMd5 = *brokenPtr;
- }
- } else {
- useBrokenMd5 = 0;
- }
(void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count);
if (hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL))
@@ -174,9 +145,6 @@ int rpmVerifyFile(const char * root, Header h, int filenum,
if (!hge(h, RPMTAG_FILEMD5S, &mdt, (void **) &md5List, NULL))
*result |= RPMVERIFY_MD5;
else {
- if (useBrokenMd5)
- rc = mdfileBroken(filespec, md5sum);
- else
rc = mdfile(filespec, md5sum);
if (rc)