build.c,parsePrep.c: quoted buildSubdir, to allow spaces.

This commit is contained in:
Igor Vlasenko 2011-08-06 18:38:30 +03:00
parent 712e95b521
commit c9505d67b9
2 changed files with 6 additions and 6 deletions

View File

@ -171,11 +171,11 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
(void) fputs(buildTemplate, fp);
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 (spec->buildSubdir)
fprintf(fp, "rm -rf %s\n", spec->buildSubdir);
fprintf(fp, "rm -rf '%s'\n", spec->buildSubdir);
} else
fprintf(fp, "%s", getStringBuf(sb));

View File

@ -364,20 +364,20 @@ static int doSetupMacro(Spec spec, char *line)
const char *buildDir;
(void) urlPath(buildDirURL, &buildDir);
snprintf(buf, sizeof(buf), "cd %s", buildDir);
snprintf(buf, sizeof(buf), "cd '%s'", buildDir);
appendLineStringBuf(spec->prep, buf);
buildDirURL = _free(buildDirURL);
}
/* delete any old sources */
if (!leaveDirs) {
snprintf(buf, sizeof(buf), "rm -rf %s", spec->buildSubdir);
snprintf(buf, sizeof(buf), "rm -rf '%s'", spec->buildSubdir);
appendLineStringBuf(spec->prep, buf);
}
/* if necessary, create and cd into the proper dir */
if (createDir) {
snprintf(buf, sizeof(buf), MKDIR_P " %s\ncd %s",
snprintf(buf, sizeof(buf), MKDIR_P " '%s'\ncd '%s'",
spec->buildSubdir, spec->buildSubdir);
appendLineStringBuf(spec->prep, buf);
}
@ -394,7 +394,7 @@ static int doSetupMacro(Spec spec, char *line)
before = freeStringBuf(before);
if (!createDir) {
snprintf(buf, sizeof(buf), "cd %s", spec->buildSubdir);
snprintf(buf, sizeof(buf), "cd '%s'", spec->buildSubdir);
appendLineStringBuf(spec->prep, buf);
}