From 5d0960ecd763178077a5670cf05014ceb732086a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Apr 05 2011 16:06:26 +0000 Subject: Merge branch 'master' into f15 --- diff --git a/rpm-4.9.0-fstate-deps.patch b/rpm-4.9.0-fstate-deps.patch new file mode 100644 index 0000000..a4f5050 --- /dev/null +++ b/rpm-4.9.0-fstate-deps.patch @@ -0,0 +1,51 @@ +commit 566a15c9c08aa593d05e2f55f1c171a48bc1b1bc +Author: Panu Matilainen +Date: Wed Mar 9 09:39:32 2011 +0200 + + Take file state into account for file dependencies + - Files which are not installed, have been replaced or are of wrong + color can not actually satisfy a dependency despite what the package's + file list says. + - This prevents breaking the system despite seemingly correct dependencies + in some situations, such as on multilib systems where a colored + files can appear to be shared between primary and secondary architecture + packages, but only the file from primary arch package is physically + present, and removing the primary arch package would remove the + file and silently break any dependencies on such files in practise. + Similarly replaced files become owned by the replacing package in + practise, so the original package whose files were replaced can no + longer satisfy dependency on those files. + +diff --git a/lib/depends.c b/lib/depends.c +index 4daa512..69aecbb 100644 +--- a/lib/depends.c ++++ b/lib/depends.c +@@ -345,12 +345,25 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep) + return rc; + } + +- /* See if a filename dependency is a real file in some package */ ++ /* ++ * See if a filename dependency is a real file in some package, ++ * taking file state into account: replaced, wrong colored and ++ * not installed files can not satisfy a dependency. ++ */ + if (Name[0] == '/') { + mi = rpmtsPrunedIterator(ts, RPMDBI_BASENAMES, Name); + while ((h = rpmdbNextIterator(mi)) != NULL) { +- rpmdsNotify(dep, "(db files)", rc); +- break; ++ int fs = RPMFILE_STATE_MISSING; ++ struct rpmtd_s states; ++ if (headerGet(h, RPMTAG_FILESTATES, &states, HEADERGET_MINMEM)) { ++ rpmtdSetIndex(&states, rpmdbGetIteratorFileNum(mi)); ++ fs = rpmtdGetNumber(&states); ++ rpmtdFreeData(&states); ++ } ++ if (fs == RPMFILE_STATE_NORMAL || fs == RPMFILE_STATE_NETSHARED) { ++ rpmdsNotify(dep, "(db files)", rc); ++ break; ++ } + } + rpmdbFreeIterator(mi); + } diff --git a/rpm-4.9.0-fstate-verify.patch b/rpm-4.9.0-fstate-verify.patch new file mode 100644 index 0000000..97026ed --- /dev/null +++ b/rpm-4.9.0-fstate-verify.patch @@ -0,0 +1,41 @@ +commit ee0ae58b442c5f79967a0d0580144b5c84e0c888 +Author: Panu Matilainen +Date: Wed Mar 9 10:25:29 2011 +0200 + + Verify some properties of replaced and wrong-colored files (RhBug:528383) + - We can't verify any properties of replaced files, but we can and + should still see if it exists at all. + - Files skipped due to wrong color are supposed to share some of + the attributes with the file that got actually installed, such + as permissions and whether it exists at all. Verify what we can + instead of silently ignoring. + +diff --git a/lib/verify.c b/lib/verify.c +index 3be357d..46210bc 100644 +--- a/lib/verify.c ++++ b/lib/verify.c +@@ -70,12 +70,22 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, + */ + switch (rpmfiFState(fi)) { + case RPMFILE_STATE_NETSHARED: +- case RPMFILE_STATE_REPLACED: + case RPMFILE_STATE_NOTINSTALLED: +- case RPMFILE_STATE_WRONGCOLOR: + case RPMFILE_STATE_MISSING: + return 0; + break; ++ case RPMFILE_STATE_REPLACED: ++ /* For replaced files we can only verify if it exists at all */ ++ flags = RPMVERIFY_LSTATFAIL; ++ break; ++ case RPMFILE_STATE_WRONGCOLOR: ++ /* ++ * Files with wrong color are supposed to share some attributes ++ * with the actually installed file - verify what we can. ++ */ ++ flags &= ~(RPMVERIFY_FILEDIGEST | RPMVERIFY_FILESIZE | ++ RPMVERIFY_MTIME | RPMVERIFY_RDEV); ++ break; + case RPMFILE_STATE_NORMAL: + break; + } diff --git a/rpm-4.9.0-prefcolor-erase.patch b/rpm-4.9.0-prefcolor-erase.patch new file mode 100644 index 0000000..1a4c763 --- /dev/null +++ b/rpm-4.9.0-prefcolor-erase.patch @@ -0,0 +1,46 @@ +commit 4a16d55f1f689ab06e8dd45c50b86e478a732367 +Author: Panu Matilainen +Date: Tue Mar 8 13:28:32 2011 +0200 + + Preferred color pkgs should be erased last + - On install we need to queue preferred colored pkgs before others + to account for the way colored files get laid on disk. On erase, + we need to revert this for the same reason. Most of the time + dependencies take care of this, but the queue placement matters in + cases such as RhBug:680261 where the order is not dependency-driven. + +diff --git a/lib/order.c b/lib/order.c +index 3b0849d..18fe05c 100644 +--- a/lib/order.c ++++ b/lib/order.c +@@ -208,6 +208,8 @@ static void addQ(tsortInfo p, tsortInfo * qp, tsortInfo * rp, + rpm_color_t prefcolor) + { + tsortInfo q, qprev; ++ rpm_color_t pcolor = rpmteColor(p->te); ++ int tailcond; + + /* Mark the package as queued. */ + p->tsi_reqx = 1; +@@ -218,13 +220,18 @@ static void addQ(tsortInfo p, tsortInfo * qp, tsortInfo * rp, + return; + } + +- /* Find location in queue using metric tsi_qcnt. */ ++ if (rpmteType(p->te) == TR_ADDED) ++ tailcond = (pcolor && pcolor != prefcolor); ++ else ++ tailcond = (pcolor && pcolor == prefcolor); ++ ++ /* Find location in queue using metric tsi_qcnt and color. */ + for (qprev = NULL, q = (*qp); + q != NULL; + qprev = q, q = q->tsi_suc) + { +- /* XXX Insure preferred color first. */ +- if (rpmteColor(p->te) != prefcolor && rpmteColor(p->te) != rpmteColor(q->te)) ++ /* Place preferred color towards queue head on install, tail on erase */ ++ if (tailcond && (pcolor != rpmteColor(q->te))) + continue; + + if (q->tsi_qcnt <= p->tsi_qcnt) diff --git a/rpm-4.9.0-rpmts-noref.patch b/rpm-4.9.0-rpmts-noref.patch new file mode 100644 index 0000000..4951488 --- /dev/null +++ b/rpm-4.9.0-rpmts-noref.patch @@ -0,0 +1,30 @@ +commit 077d2c850cf0a719d7abacc3256168d60a4ec7bb +Author: Panu Matilainen +Date: Tue Apr 5 17:33:12 2011 +0300 + + Dont reference transaction set from transaction elements + - Elements referencing ts prevents rpmtsFree() from freeing anything + unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage + from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9. + +diff --git a/lib/rpmte.c b/lib/rpmte.c +index 860b3f4..dfd7b6f 100644 +--- a/lib/rpmte.c ++++ b/lib/rpmte.c +@@ -291,7 +291,6 @@ rpmte rpmteFree(rpmte te) + rpmfsFree(te->fs); + rpmpsFree(te->probs); + rpmteCleanDS(te); +- rpmtsFree(te->ts); + + argvFree(te->collections); + argvFree(te->lastInCollectionsAny); +@@ -308,7 +307,7 @@ rpmte rpmteNew(rpmts ts, Header h, rpmElementType type, fnpyKey key, + rpmRelocation * relocs) + { + rpmte p = xcalloc(1, sizeof(*p)); +- p->ts = rpmtsLink(ts); ++ p->ts = ts; + p->type = type; + addTE(p, h, key, relocs); + switch (type) { diff --git a/rpm-4.9.0-specquery-pkgs.patch b/rpm-4.9.0-specquery-pkgs.patch new file mode 100644 index 0000000..f0f7d89 --- /dev/null +++ b/rpm-4.9.0-specquery-pkgs.patch @@ -0,0 +1,23 @@ +commit 94fb6eed6a7a8957152035c3156974fc00bc4b42 +Author: Jindrich Novy +Date: Mon Apr 4 16:03:11 2011 +0200 + + Don't list packages which will not be created in spec query (RhBug:693338) + - particularly, while doing "rpm -q --specfile " + +diff --git a/build/spec.c b/build/spec.c +index 6861753..353ae47 100644 +--- a/build/spec.c ++++ b/build/spec.c +@@ -412,8 +412,10 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) + + res = 0; + if (qva->qva_source == RPMQV_SPECRPMS) { +- for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) ++ for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) { ++ if (pkg->fileList == NULL) continue; + xx = qva->qva_showPackage(qva, ts, pkg->header); ++ } + } else { + xx = qva->qva_showPackage(qva, ts, spec->sourceHeader); + } diff --git a/rpm.spec b/rpm.spec index f25172e..2081b84 100644 --- a/rpm.spec +++ b/rpm.spec @@ -21,7 +21,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}4%{?dist} +Release: %{?snapver:0.%{snapver}.}5%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2 @@ -44,6 +44,16 @@ Patch4: rpm-4.8.1-use-gpg2.patch Patch100: rpm-4.9.0-manifest-fix.patch # Recognize elf executables with sticky bit as elf Patch101: rpm-4.9.0-sticky-elf.patch +# Fix leaks on freeing a populated transaction set +Patch102: rpm-4.9.0-rpmts-noref.patch +# Only list packages that will be built on spec query (#693338) +Patch103: rpm-4.9.0-specquery-pkgs.patch +# Verify some properties of replaced and wrong-colored files (#528383) +Patch104: rpm-4.9.0-fstate-verify.patch +# Take file state into account for file dependencies +Patch105: rpm-4.9.0-fstate-deps.patch +# Preferred color pkgs should be erased last +Patch106: rpm-4.9.0-prefcolor-erase.patch # These are not yet upstream Patch301: rpm-4.6.0-niagara.patch @@ -211,6 +221,11 @@ packages on a system. %patch100 -p1 -b .manifest-fix %patch101 -p1 -b .sticky-elf +%patch102 -p1 -b .rpmts-noref +%patch103 -p1 -b .specquery-pkgs +%patch104 -p1 -b .fstate-verify +%patch105 -p1 -b .fstate-deps +%patch106 -p1 -b .prefcolor-erase %patch301 -p1 -b .niagara %patch302 -p1 -b .geode @@ -424,6 +439,13 @@ exit 0 %doc COPYING doc/librpm/html/* %changelog +* Tue Apr 05 2011 Panu Matilainen - 4.9.0-5 +- verify some properties of replaced and wrong-colored files (#528383) +- only list packages that would be generated on spec query (#693338) +- preferred color packages should be erased last (#680261) +- fix leaks when freeing a populated transaction set +- take file state into account for file dependencies + * Tue Mar 22 2011 Panu Matilainen - 4.9.0-4 - fix classification of elf executables with sticky bit set (#689182)