Use %{__mkdir_p} macro in build instead of hardwired RPM_MKDIR_P

This commit is contained in:
Panu Matilainen 2009-12-22 15:32:17 +02:00
parent 6760122281
commit 4d328c0b69
2 changed files with 5 additions and 3 deletions

View File

@ -931,12 +931,14 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
} else {
/* XXX FIXME: this is easy to do as macro expansion */
if (! fl->passedSpecialDoc) {
char *mkdocdir = rpmExpand("%{__mkdir_p} $DOCDIR", NULL);
pkg->specialDoc = newStringBuf();
appendStringBuf(pkg->specialDoc, "DOCDIR=$RPM_BUILD_ROOT");
appendLineStringBuf(pkg->specialDoc, pkg->specialDocDir);
appendLineStringBuf(pkg->specialDoc, "export DOCDIR");
appendLineStringBuf(pkg->specialDoc, "rm -rf $DOCDIR");
appendLineStringBuf(pkg->specialDoc, RPM_MKDIR_P " $DOCDIR");
appendLineStringBuf(pkg->specialDoc, mkdocdir);
free(mkdocdir);
*fileName = pkg->specialDocDir;
fl->passedSpecialDoc = 1;

View File

@ -326,8 +326,8 @@ static int doSetupMacro(rpmSpec spec, const char *line)
/* if necessary, create and cd into the proper dir */
if (createDir) {
rasprintf(&buf, RPM_MKDIR_P " %s\ncd '%s'",
spec->buildSubdir, spec->buildSubdir);
buf = rpmExpand("%{__mkdir_p} ", spec->buildSubdir, "\n",
"cd '", spec->buildSubdir, "'", NULL);
appendLineStringBuf(spec->prep, buf);
free(buf);
}