From 54b2849f61f86f75c1eb7481c6aa7ebd4acb6284 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 24 Sep 1998 20:36:54 +0000 Subject: [PATCH] skip arch checks if only packaging source rpm. CVS patchset: 2352 CVS date: 1998/09/24 20:36:54 --- CHANGES | 1 + build.c | 8 ++++++-- build/parsePreamble.c | 7 ++++--- build/parseSpec.c | 7 ++++--- build/rpmbuild.h | 4 ++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 41ef9f7..534b992 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 dfd7a67..23ad4f9 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 c479863..84d0fc8 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 4b90462..b7668c2 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 c8bd622..add90f5 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); -- 2.7.4