From 42d9f1aba7061a28b54e3103ae37df01bf88dcf6 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Aug 29 2008 05:25:44 +0000 Subject: - add support for noarch subpackages - fix segfault in case of insufficient disk space detected (#460146) --- diff --git a/rpm-4.5.90-noarch-subpackages.patch b/rpm-4.5.90-noarch-subpackages.patch new file mode 100644 index 0000000..4c84ca2 --- /dev/null +++ b/rpm-4.5.90-noarch-subpackages.patch @@ -0,0 +1,43 @@ +diff --git a/build/parsePreamble.c b/build/parsePreamble.c +index d168978..988b615 100644 +--- a/build/parsePreamble.c ++++ b/build/parsePreamble.c +@@ -632,19 +632,32 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, + case RPMTAG_EXCLUSIVEOS: + addOrAppendListEntry(spec->buildRestrictions, tag, field); + break; +- case RPMTAG_BUILDARCHS: +- if ((rc = poptParseArgvString(field, +- &(spec->BACount), +- &(spec->BANames)))) { ++ case RPMTAG_BUILDARCHS: { ++ int BACount; ++ const char **BANames = NULL; ++ if ((rc = poptParseArgvString(field, &BACount, &BANames))) { + rpmlog(RPMLOG_ERR, + _("line %d: Bad BuildArchitecture format: %s\n"), + spec->lineNum, spec->line); + return RPMRC_FAIL; + } +- if (!spec->BACount) ++ if (spec->packages == pkg) { ++ spec->BACount = BACount; ++ spec->BANames = BANames; ++ } else { ++ if (BACount != 1 || strcmp(BANames[0], "noarch")) { ++ rpmlog(RPMLOG_ERR, ++ _("line %d: Only noarch subpackages are supported: %s\n"), ++ spec->lineNum, spec->line); ++ BANames = _free(BANames); ++ return RPMRC_FAIL; ++ } ++ headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, "noarch", 1); ++ } ++ if (!BACount) + spec->BANames = _free(spec->BANames); + break; +- ++ } + default: + rpmlog(RPMLOG_ERR, _("Internal error: Bogus tag %d\n"), tag); + return RPMRC_FAIL; diff --git a/rpm-4.5.90-segfault.patch b/rpm-4.5.90-segfault.patch new file mode 100644 index 0000000..1d1cf4a --- /dev/null +++ b/rpm-4.5.90-segfault.patch @@ -0,0 +1,12 @@ +diff -up rpm-4.5.90.git8461/lib/rpmps.c.460146 rpm-4.5.90.git8461/lib/rpmps.c +--- rpm-4.5.90.git8461/lib/rpmps.c.460146 2008-06-30 14:50:49.000000000 +0200 ++++ rpm-4.5.90.git8461/lib/rpmps.c 2008-08-26 19:35:30.000000000 +0200 +@@ -319,7 +319,7 @@ char * rpmProblemString(const rpmProblem + break; + case RPMPROB_DISKSPACE: + rc = rasprintf(&buf, +- _("installing package %s needs %ld%cB on the %s filesystem"), ++ _("installing package %s needs %llu%cB on the %s filesystem"), + pkgNEVR, + prob->num1 > (1024*1024) + ? (prob->num1 + 1024 * 1024 - 1) / (1024 * 1024) diff --git a/rpm.spec b/rpm.spec index 21abaf9..ce1eb1f 100644 --- a/rpm.spec +++ b/rpm.spec @@ -18,7 +18,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: 0.%{snapver}.2 +Release: 0.%{snapver}.3 Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2 @@ -33,6 +33,8 @@ Patch100: rpm-4.6.x-no-pkgconfig-reqs.patch # Already in upstream, remove on next snapshot update Patch200: rpm-4.5.90-archivesize.patch +Patch201: rpm-4.5.90-noarch-subpackages.patch +Patch202: rpm-4.5.90-segfault.patch # These are not yet upstream Patch300: rpm-4.5.90-posttrans.patch @@ -164,6 +166,8 @@ that will manipulate RPM packages and databases. %patch100 -p1 -b .pkgconfig-deps %patch200 -p1 -b .archivesize +%patch201 -p1 -b .noarch-subpackages +%patch202 -p1 -b .segfault # needs a bit of upstream love first... #%patch300 -p1 -b .posttrans @@ -342,6 +346,10 @@ exit 0 %doc doc/librpm/html/* %changelog +* Tue Aug 26 2008 Jindrich Novy +- add support for noarch subpackages +- fix segfault in case of insufficient disk space detected (#460146) + * Wed Aug 13 2008 Panu Matilainen - 4.5.90-0.git8461.2 - fix archivesize tag generation on ppc (#458817)