summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-05-16 19:19:15 +0000
committerjbj <devnull@localhost>2001-05-16 19:19:15 +0000
commitcec2fe637a8b872282e7029867a253384ed1d553 (patch)
treeba74f60ff601f82858dbfc007faa3733a803d983
parent56510bc6e99ed2bde5cb8e9845031c26b42a406e (diff)
downloadlibrpm-tizen-cec2fe637a8b872282e7029867a253384ed1d553.tar.gz
librpm-tizen-cec2fe637a8b872282e7029867a253384ed1d553.tar.bz2
librpm-tizen-cec2fe637a8b872282e7029867a253384ed1d553.zip
- fix: filter duplicate package removals (#35828).
- add armv3l arch. CVS patchset: 4795 CVS date: 2001/05/16 19:19:15
-rw-r--r--CHANGES2
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/depends.c29
-rw-r--r--lib/fsm.c1
-rw-r--r--lib/header.c10
-rw-r--r--rpmdb/db3.c13
-rw-r--r--rpmrc.in14
7 files changed, 50 insertions, 21 deletions
diff --git a/CHANGES b/CHANGES
index 32f1458f5..4c0699a07 100644
--- a/CHANGES
+++ b/CHANGES
@@ -57,6 +57,8 @@
- harden rpmdb iterators from damaged header instance segfaults.
- add cron/logrotate scripts to save installed package filenames.
- upgrade to db-3.3.4.
+ - fix: filter duplicate package removals (#35828).
+ - add armv3l arch.
4.0 -> 4.0.[12]
- add doxygen and lclint annotations most everywhere.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7a112e608..6449c8f2d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -40,7 +40,7 @@ librpm_la_SOURCES = \
# XXX Add internal libtool dependence
install-data-local:
@cd $(DESTDIR)/$(libdir) && \
- sed -e "s|^dependency_libs='|& -lrpmdb -lrpmio|" < librpm.la > .librpm.la && \
+ sed -e "s|^dependency_libs='|& -lrpmdb -lrpmio -lpopt|" < librpm.la > .librpm.la && \
mv .librpm.la librpm.la
tagtable.c: rpmlib.h
diff --git a/lib/depends.c b/lib/depends.c
index 477837e1d..0cefc9e71 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -385,8 +385,9 @@ static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList
p->fd = (fd != NULL ? fdLink(fd, "alAddPackage") : NULL);
if (relocs) {
- for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++);
- p->relocs = xmalloc(sizeof(*p->relocs) * (i + 1));
+ for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++)
+ ;
+ p->relocs = xmalloc((i + 1) * sizeof(*p->relocs));
for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++) {
p->relocs[i].oldPath = r->oldPath ? xstrdup(r->oldPath) : NULL;
@@ -738,6 +739,13 @@ rpmTransactionSet rpmtransCreateSet(rpmdb rpmdb, const char * rootDir)
static void removePackage(rpmTransactionSet ts, int dboffset, int depends)
/*@modifies ts @*/
{
+ int i;
+
+ /* Filter out duplicate erasures. */
+ if (ts->removedPackages != NULL)
+ for (i = 0; i < ts->numRemovedPackages; i++)
+ if (dboffset == ts->removedPackages[i]) return;
+
if (ts->numRemovedPackages == ts->allocedRemovedPackages) {
ts->allocedRemovedPackages += ts->delta;
ts->removedPackages = xrealloc(ts->removedPackages,
@@ -1081,16 +1089,19 @@ static int unsatisfiedDepend(rpmTransactionSet ts,
}
#ifndef DYING
- { const char * rcProvidesString;
+ { static /*@observer@*/ const char noProvidesString[] = "nada";
+ static /*@observer@*/ const char * rcProvidesString = noProvidesString;
const char * start;
int i;
- if (!(keyFlags & RPMSENSE_SENSEMASK) &&
- (rcProvidesString = rpmGetVar(RPMVAR_PROVIDES))) {
+ if (rcProvidesString == noProvidesString)
+ rcProvidesString = rpmGetVar(RPMVAR_PROVIDES);
+
+ if (rcProvidesString != NULL && !(keyFlags & RPMSENSE_SENSEMASK)) {
i = strlen(keyName);
- /*@-nullpass -observertrans -mayaliasunique@*/
+ /*@-observertrans -mayaliasunique@*/
while ((start = strstr(rcProvidesString, keyName))) {
- /*@=nullpass =observertrans =mayaliasunique@*/
+ /*@=observertrans =mayaliasunique@*/
if (xisspace(start[i]) || start[i] == '\0' || start[i] == ',') {
rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (rpmrc provides)\n"),
keyType, keyDepend+2);
@@ -1897,7 +1908,7 @@ rescan:
* the new package. This would be easier if we could sort the
* addedPackages array, but we store indexes into it in various places.
*/
- orderList = xmalloc(sizeof(*orderList) * npkgs);
+ orderList = xmalloc(npkgs * sizeof(*orderList));
for (i = 0, j = 0; i < ts->orderCount; i++) {
if (ts->order[i].type == TR_ADDED) {
orderList[j].alIndex = ts->order[i].u.addedIndex;
@@ -1909,7 +1920,7 @@ rescan:
qsort(orderList, npkgs, sizeof(*orderList), orderListIndexCmp);
- newOrder = xmalloc(sizeof(*newOrder) * ts->orderCount);
+ newOrder = xmalloc(ts->orderCount * sizeof(*newOrder));
for (i = 0, newOrderCount = 0; i < orderingCount; i++) {
struct orderListIndex * needle, key;
diff --git a/lib/fsm.c b/lib/fsm.c
index b5ccb6d68..ef807e5a7 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -574,7 +574,6 @@ assert(fi->type == TR_ADDED);
break;
case FA_SAVE:
-fprintf(stderr, "*** %s:%s %s\n", fiTypeString(fi), fileActionString(fsm->action), (fsm->path ? fsm->path : ""));
assert(fi->type == TR_ADDED);
fsm->osuffix = SUFFIX_RPMSAVE;
break;
diff --git a/lib/header.c b/lib/header.c
index 2d1564929..192bd3446 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -910,8 +910,13 @@ t = te;
}
/* Insure that there are no memcpy underruns/overruns. */
+#if 0
assert(((char *)pe) == dataStart);
assert((((char *)ei)+len) == te);
+#else
+ if (((char *)pe) != dataStart) goto errxit;
+ if ((((char *)ei)+len) != te) goto errxit;
+#endif
if (lengthPtr)
*lengthPtr = len;
@@ -923,10 +928,9 @@ t = te;
errxit:
/*@-usereleased@*/
- if (ei) {
+ if (ei)
free(ei);
- ei = NULL;
- }
+ ei = NULL;
/*@=usereleased@*/
return (void *) ei;
}
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 11d735c41..7daf6dcd3 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -748,10 +748,17 @@ static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
}
/* ... DB_RDONLY maps dphome perms across files ... */
- oflags |= DB_RDONLY;
+ if (dbi->dbi_temporary) {
+ oflags |= DB_CREATE;
+ dbi->dbi_oeflags |= DB_CREATE;
+ oflags &= ~DB_RDONLY;
+ dbi->dbi_oflags &= ~DB_RDONLY;
+ } else {
+ oflags |= DB_RDONLY;
+ /* ... and DB_WRITECURSOR won't be needed ... */
+ dbi->dbi_oflags |= DB_RDONLY;
+ }
- /* ... and DB_WRITECURSOR won't be needed ... */
- dbi->dbi_oflags |= DB_RDONLY;
} else { /* dbhome is writable, check for persistent dbenv. */
const char * dbf = rpmGetPath(dbhome, "/__db.001", NULL);
diff --git a/rpmrc.in b/rpmrc.in
index 78091e71a..0ad704c4a 100644
--- a/rpmrc.in
+++ b/rpmrc.in
@@ -1,7 +1,7 @@
#/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc
# \verbatim
#
-# $Id: rpmrc.in,v 2.36 2001/05/11 17:18:16 jbj Exp $
+# $Id: rpmrc.in,v 2.37 2001/05/16 19:19:15 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
@@ -40,8 +40,9 @@ optflags: hppa1.2 -O2 -mpa-risc-1-0
optflags: hppa2.0 -O2 -mpa-risc-1-0
optflags: mipseb -O2
optflags: mipsel -O2
-optflags: armv4b -O2 -fsigned-char -fomit-frame-pointer
-optflags: armv4l -O2 -fsigned-char -fomit-frame-pointer
+optflags: armv3l -O2 -fsigned-char -fomit-frame-pointer -march=armv3
+optflags: armv4b -O2 -fsigned-char -fomit-frame-pointer -march=armv4
+optflags: armv4l -O2 -fsigned-char -fomit-frame-pointer -march=armv4
optflags: atarist -O2 -fomit-frame-pointer
optflags: atariste -O2 -fomit-frame-pointer
optflags: ataritt -O2 -fomit-frame-pointer
@@ -82,6 +83,7 @@ arch_canon: sparc64:sparc64 10
arch_canon: sun4u: sparc64 10
arch_canon: mipsel: mipsel 11
+arch_canon: armv3l: armv3l 12
arch_canon: armv4b: armv4b 12
arch_canon: armv4l: armv4l 12
@@ -211,7 +213,8 @@ arch_compat: hppa1.0: parisc
arch_compat: parisc: noarch
arch_compat: armv4b: noarch
-arch_compat: armv4l: noarch
+arch_compat: armv4l: armv3l
+arch_compat: armv3l: noarch
arch_compat: atarist: m68kmint noarch
arch_compat: atariste: m68kmint noarch
@@ -280,8 +283,11 @@ buildarch_compat: m68k: noarch
buildarch_compat: ppc: noarch
buildarch_compat: mipsel: noarch
buildarch_compat: mipseb: noarch
+
+buildarch_compat: armv3l: noarch
buildarch_compat: armv4b: noarch
buildarch_compat: armv4l: noarch
+
buildarch_compat: parisc: noarch
buildarch_compat: atarist: m68kmint noarch