From 4d328c0b6982a5782bdd9dc4722ccc5119279b57 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 22 Dec 2009 15:32:17 +0200 Subject: [PATCH] Use %{__mkdir_p} macro in build instead of hardwired RPM_MKDIR_P --- build/files.c | 4 +++- build/parsePrep.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/files.c b/build/files.c index 7db729a3f..0c95d2571 100644 --- a/build/files.c +++ b/build/files.c @@ -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; diff --git a/build/parsePrep.c b/build/parsePrep.c index 729bbca1b..670ed709d 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -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); }