summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-01 18:03:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-01 18:03:05 +0300
commit1c00fe0b5fc38af379e0b300dda66f996eed6fc3 (patch)
treec8034dcf181f85ee87e903fe31a49668ca266f56
parent2c4976a5286a9e0692106965156492eeacbe0799 (diff)
downloadlibrpm-tizen-1c00fe0b5fc38af379e0b300dda66f996eed6fc3.tar.gz
librpm-tizen-1c00fe0b5fc38af379e0b300dda66f996eed6fc3.tar.bz2
librpm-tizen-1c00fe0b5fc38af379e0b300dda66f996eed6fc3.zip
Combine spec parsing options into a common flag bitfield
-rw-r--r--build/parsePreamble.c2
-rw-r--r--build/parsePrep.c6
-rw-r--r--build/parseSpec.c3
-rw-r--r--build/rpmspec.h3
-rw-r--r--build/spec.c3
5 files changed, 7 insertions, 10 deletions
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 6a923a96a..6a56335ce 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -1075,7 +1075,7 @@ int parsePreamble(rpmSpec spec, int initialPackage)
}
/* XXX Skip valid arch check if not building binary package */
- if (!spec->anyarch && checkForValidArchitectures(spec)) {
+ if (!(spec->flags & RPMSPEC_ANYARCH) && checkForValidArchitectures(spec)) {
goto exit;
}
diff --git a/build/parsePrep.c b/build/parsePrep.c
index f7849ccba..3952acc7c 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -79,7 +79,7 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db,
fn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
/* On non-build parse's, file cannot be stat'd or read. */
- if (spec->force || checkOwners(fn)) goto exit;
+ if ((spec->flags & RPMSPEC_FORCE) || checkOwners(fn)) goto exit;
if (db) {
rasprintf(&arg_backup,
@@ -180,7 +180,7 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly)
#endif
/* XXX On non-build parse's, file cannot be stat'd or read */
- if (!spec->force && (rpmFileIsCompressed(fn, &compressed) || checkOwners(fn))) {
+ if (!(spec->flags & RPMSPEC_FORCE) && (rpmFileIsCompressed(fn, &compressed) || checkOwners(fn))) {
fn = _free(fn);
return NULL;
}
@@ -533,7 +533,7 @@ int parsePrep(rpmSpec spec)
} else {
appendLineStringBuf(spec->prep, *lines);
}
- if (res && !spec->force) {
+ if (res && !(spec->flags & RPMSPEC_FORCE)) {
/* fixup from RPMRC_FAIL do*Macro() codes for now */
nextPart = PART_ERROR;
goto exit;
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 074d33717..4f68fca13 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -540,8 +540,7 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
}
addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
spec->recursing = recursing;
- spec->anyarch = (flags & RPMSPEC_ANYARCH);
- spec->force = (flags & RPMSPEC_FORCE);
+ spec->flags = flags;
/* All the parse*() functions expect to have a line pre-read */
/* in the spec's line buffer. Except for parsePreamble(), */
diff --git a/build/rpmspec.h b/build/rpmspec.h
index 836123e3e..1ecfaaa65 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -71,8 +71,7 @@ struct rpmSpec_s {
int BACount;
int recursing; /*!< parse is recursive? */
- int force;
- int anyarch;
+ rpmSpecFlags flags;
struct Source * sources;
int numSources;
diff --git a/build/spec.c b/build/spec.c
index 7c3180861..ac3b8d905 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -230,8 +230,7 @@ rpmSpec newSpec(void)
spec->recursing = 0;
spec->BASpecs = NULL;
- spec->force = 0;
- spec->anyarch = 0;
+ spec->flags = RPMSPEC_NONE;
spec->macros = rpmGlobalMacroContext;