summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1998-09-24 20:36:54 +0000
committerjbj <devnull@localhost>1998-09-24 20:36:54 +0000
commit54b2849f61f86f75c1eb7481c6aa7ebd4acb6284 (patch)
tree16e51226467b4ffb186bc928b495d51a9b86c92c
parentd6a3e244e0aa5308844623f7973f03bd87dc3aaf (diff)
downloadrpm-54b2849f61f86f75c1eb7481c6aa7ebd4acb6284.tar.gz
rpm-54b2849f61f86f75c1eb7481c6aa7ebd4acb6284.tar.bz2
rpm-54b2849f61f86f75c1eb7481c6aa7ebd4acb6284.zip
skip arch checks if only packaging source rpm.
CVS patchset: 2352 CVS date: 1998/09/24 20:36:54
-rw-r--r--CHANGES1
-rw-r--r--build.c8
-rw-r--r--build/parsePreamble.c7
-rw-r--r--build/parseSpec.c7
-rw-r--r--build/rpmbuild.h4
5 files changed, 17 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index 41ef9f768..534b9928f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,7 @@
- add new fully recursive macro.c
2.5.3 -> 2.5.4:
+ - skip arch checks if only packaging source rpm.
- add license field to rpmpopt -qi alias.
- provides/obsoletes requires tokens that begin with alnum or _.
- non-zero exit status for verify failures.
diff --git a/build.c b/build.c
index dfd7a6779..23ad4f99a 100644
--- a/build.c
+++ b/build.c
@@ -129,9 +129,13 @@ int buildplatform(char *arg, int buildAmount, char *passPhrase,
s++;
}
- if (parseSpec(&spec, specfile, buildRoot, 0, passPhrase, cookie)) {
- return 1;
+#define _anyarch(_f) \
+(((_f)&(RPMBUILD_PACKAGESOURCE|RPMBUILD_PACKAGEBINARY)) == RPMBUILD_PACKAGESOURCE)
+ if (parseSpec(&spec, specfile, buildRoot, 0, passPhrase, cookie,
+ _anyarch(buildAmount))) {
+ return 1;
}
+#undef _anyarch
if (buildSpec(spec, buildAmount, test)) {
freeSpec(spec);
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index c4798635f..84d0fc8d6 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -626,7 +626,7 @@ static int findPreambleTag(Spec spec, int *tag, char **macro, char *lang)
return 0;
}
-int parsePreamble(Spec spec, int initialPackage)
+int parsePreamble(Spec spec, int initialPackage, int anyarch)
{
int nextPart;
int tag, rc;
@@ -705,8 +705,9 @@ int parsePreamble(Spec spec, int initialPackage)
return RPMERR_BADSPEC;
}
- if (checkForValidArchitectures(spec)) {
- return RPMERR_BADSPEC;
+ /* XXX Skip valid arch check if only doing -bs processing */
+ if (!anyarch && checkForValidArchitectures(spec)) {
+ return RPMERR_BADSPEC;
}
if (pkg == spec->packages) {
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 4b90462f9..b7668c2b9 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -214,7 +214,8 @@ void closeSpec(Spec spec)
int noLang = 0; /* XXX FIXME: pass as arg */
int parseSpec(Spec *specp, char *specFile, char *buildRoot,
- int inBuildArch, char *passPhrase, char *cookie)
+ int inBuildArch, char *passPhrase, char *cookie,
+ int anyarch)
{
int parsePart = PART_PREAMBLE;
int initialPackage = 1;
@@ -266,7 +267,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot,
while (parsePart != PART_NONE) {
switch (parsePart) {
case PART_PREAMBLE:
- parsePart = parsePreamble(spec, initialPackage);
+ parsePart = parsePreamble(spec, initialPackage, anyarch);
initialPackage = 0;
break;
case PART_PREP:
@@ -319,7 +320,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot,
rpmSetMachine(spec->buildArchitectures[x], NULL);
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
specFile, buildRoot, 1,
- passPhrase, cookie)) {
+ passPhrase, cookie, anyarch)) {
spec->buildArchitectureCount = index;
freeSpec(spec);
return RPMERR_BADSPEC;
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index c8bd622e2..add90f57b 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -104,7 +104,7 @@ char *cleanFileName(char *name);
int parseChangelog(Spec spec);
int parseDescription(Spec spec);
int parseFiles(Spec spec);
-int parsePreamble(Spec spec, int initialPackage);
+int parsePreamble(Spec spec, int initialPackage, int anyarch);
int parsePrep(Spec spec);
int parseRequiresConflicts(Spec spec, Package pkg, char *field,
int tag, int index);
@@ -137,7 +137,7 @@ int processSourceFiles(Spec spec);
/* global entry points */
int parseSpec(Spec *specp, char *specFile, char *buildRoot,
- int inBuildArch, char *passPhrase, char *cookie);
+ int inBuildArch, char *passPhrase, char *cookie, int anyarch);
int buildSpec(Spec spec, int what, int test);
int packageBinaries(Spec spec);