build.c,parsePrep.c: quoted buildSubdir, to allow spaces.
This commit is contained in:
parent
712e95b521
commit
c9505d67b9
@ -171,11 +171,11 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
|
|||||||
(void) fputs(buildTemplate, fp);
|
(void) fputs(buildTemplate, fp);
|
||||||
|
|
||||||
if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir)
|
if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir)
|
||||||
fprintf(fp, "cd %s\n", spec->buildSubdir);
|
fprintf(fp, "cd '%s'\n", spec->buildSubdir);
|
||||||
|
|
||||||
if (what == RPMBUILD_RMBUILD) {
|
if (what == RPMBUILD_RMBUILD) {
|
||||||
if (spec->buildSubdir)
|
if (spec->buildSubdir)
|
||||||
fprintf(fp, "rm -rf %s\n", spec->buildSubdir);
|
fprintf(fp, "rm -rf '%s'\n", spec->buildSubdir);
|
||||||
} else
|
} else
|
||||||
fprintf(fp, "%s", getStringBuf(sb));
|
fprintf(fp, "%s", getStringBuf(sb));
|
||||||
|
|
||||||
|
@ -364,20 +364,20 @@ static int doSetupMacro(Spec spec, char *line)
|
|||||||
const char *buildDir;
|
const char *buildDir;
|
||||||
|
|
||||||
(void) urlPath(buildDirURL, &buildDir);
|
(void) urlPath(buildDirURL, &buildDir);
|
||||||
snprintf(buf, sizeof(buf), "cd %s", buildDir);
|
snprintf(buf, sizeof(buf), "cd '%s'", buildDir);
|
||||||
appendLineStringBuf(spec->prep, buf);
|
appendLineStringBuf(spec->prep, buf);
|
||||||
buildDirURL = _free(buildDirURL);
|
buildDirURL = _free(buildDirURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete any old sources */
|
/* delete any old sources */
|
||||||
if (!leaveDirs) {
|
if (!leaveDirs) {
|
||||||
snprintf(buf, sizeof(buf), "rm -rf %s", spec->buildSubdir);
|
snprintf(buf, sizeof(buf), "rm -rf '%s'", spec->buildSubdir);
|
||||||
appendLineStringBuf(spec->prep, buf);
|
appendLineStringBuf(spec->prep, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if necessary, create and cd into the proper dir */
|
/* if necessary, create and cd into the proper dir */
|
||||||
if (createDir) {
|
if (createDir) {
|
||||||
snprintf(buf, sizeof(buf), MKDIR_P " %s\ncd %s",
|
snprintf(buf, sizeof(buf), MKDIR_P " '%s'\ncd '%s'",
|
||||||
spec->buildSubdir, spec->buildSubdir);
|
spec->buildSubdir, spec->buildSubdir);
|
||||||
appendLineStringBuf(spec->prep, buf);
|
appendLineStringBuf(spec->prep, buf);
|
||||||
}
|
}
|
||||||
@ -394,7 +394,7 @@ static int doSetupMacro(Spec spec, char *line)
|
|||||||
before = freeStringBuf(before);
|
before = freeStringBuf(before);
|
||||||
|
|
||||||
if (!createDir) {
|
if (!createDir) {
|
||||||
snprintf(buf, sizeof(buf), "cd %s", spec->buildSubdir);
|
snprintf(buf, sizeof(buf), "cd '%s'", spec->buildSubdir);
|
||||||
appendLineStringBuf(spec->prep, buf);
|
appendLineStringBuf(spec->prep, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user