- add support for noarch subpackages

- fix segfault in case of insufficient disk space detected (#460146)
This commit is contained in:
Jindrich Novy 2008-08-29 05:25:44 +00:00
parent 05d01ee1a4
commit 42d9f1aba7
3 changed files with 64 additions and 1 deletions

View File

@ -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;

12
rpm-4.5.90-segfault.patch Normal file
View File

@ -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)

View File

@ -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 <jnovy@redhat.com>
- add support for noarch subpackages
- fix segfault in case of insufficient disk space detected (#460146)
* Wed Aug 13 2008 Panu Matilainen <pmatilai@redhat.com>
- 4.5.90-0.git8461.2
- fix archivesize tag generation on ppc (#458817)