diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2019-10-09 12:20:08 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2019-10-15 13:28:55 +0300 |
commit | a0699a1f9b9502c75d812b4fee52dec100ad5be7 (patch) | |
tree | 7936f4fbb5c56aa00c9d081010054b1ad635048d /build/parsePrep.c | |
parent | 0663b87c8e630a2fbdb3821e20410aa2fa19ba82 (diff) | |
download | rpm-a0699a1f9b9502c75d812b4fee52dec100ad5be7.tar.gz |
Cleanup + fix --build-in-place handling in %setup
If we don't want spec->buildSubdir to be set, then we should just bail
out before the logic that sets it, not undo it afterwards and set macro
body to NULL, amazing that this isn't blowing up someplace.
Lastly, %setup -a/-b would try to access tarballs that build-in-place
is supposed to skip entirely, just skip the whole argument checking
instead as they're not going to be used anyway.
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r-- | build/parsePrep.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index e2ba98ea1..0751cf494 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -242,7 +242,6 @@ static int doSetupMacro(rpmSpec spec, const char *line) uint32_t num; int leaveDirs = 0, skipDefaultAction = 0; int createDir = 0, quietly = 0; - int buildInPlace = 0; const char * dirName = NULL; struct poptOption optionsTable[] = { { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL}, @@ -262,6 +261,11 @@ static int doSetupMacro(rpmSpec spec, const char *line) goto exit; } + if (rpmExpandNumeric("%{_build_in_place}")) { + rc = RPMRC_OK; + goto exit; + } + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); while ((arg = poptGetNextOpt(optCon)) > 0) { optArg = poptGetOptArg(optCon); @@ -298,16 +302,7 @@ static int doSetupMacro(rpmSpec spec, const char *line) headerGetString(spec->packages->header, RPMTAG_NAME), headerGetString(spec->packages->header, RPMTAG_VERSION)); } - /* Mer addition - support --build-in-place */ - if (rpmExpandNumeric("%{_build_in_place}")) { - buildInPlace = 1; - spec->buildSubdir = NULL; - } rpmPushMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC); - if (buildInPlace) { - rc = RPMRC_OK; - goto exit; - } /* cd to the build dir */ { char * buildDir = rpmGenPath(spec->rootDir, "%{_builddir}", ""); |