Florian Festi 9c3f8c
From 021a7d3aaa5458d8956babf0220a3e574a2b8e62 Mon Sep 17 00:00:00 2001
Florian Festi 9c3f8c
From: Florian Festi <ffesti@redhat.com>
Florian Festi 9c3f8c
Date: Wed, 17 May 2023 17:23:59 +0200
Florian Festi 9c3f8c
Subject: [PATCH] Use mkdir -p for creating SPECPARTS dir
Florian Festi 9c3f8c
Florian Festi 9c3f8c
to not error out when invoking %setup more than once or shipping the
Florian Festi 9c3f8c
directory in the sources.
Florian Festi 9c3f8c
---
Florian Festi 9c3f8c
 build/parsePrep.c | 2 +-
Florian Festi 9c3f8c
 tests/rpmspec.at  | 2 +-
Florian Festi 9c3f8c
 2 files changed, 2 insertions(+), 2 deletions(-)
Florian Festi 9c3f8c
Florian Festi 9c3f8c
diff --git a/build/parsePrep.c b/build/parsePrep.c
Florian Festi 9c3f8c
index f8e09a8c7..ea8faa953 100644
Florian Festi 9c3f8c
--- a/build/parsePrep.c
Florian Festi 9c3f8c
+++ b/build/parsePrep.c
Florian Festi 9c3f8c
@@ -274,7 +274,7 @@ static int doSetupMacro(rpmSpec spec, const char *line)
Florian Festi 9c3f8c
     }
Florian Festi 9c3f8c
 
Florian Festi 9c3f8c
     /* mkdir for dynamic specparts */
Florian Festi 9c3f8c
-    buf = rpmExpand("%{__mkdir} SPECPARTS", NULL);
Florian Festi 9c3f8c
+    buf = rpmExpand("%{__mkdir_p} SPECPARTS", NULL);
Florian Festi 9c3f8c
     appendBuf(spec, buf, 1);
Florian Festi 9c3f8c
     free(buf);
Florian Festi 9c3f8c
 
Florian Festi 9c3f8c
diff --git a/tests/rpmspec.at b/tests/rpmspec.at
Florian Festi 9c3f8c
index 548b4b3cc..564479391 100644
Florian Festi 9c3f8c
--- a/tests/rpmspec.at
Florian Festi 9c3f8c
+++ b/tests/rpmspec.at
Florian Festi 9c3f8c
@@ -333,7 +333,7 @@ if [ $STATUS -ne 0 ]; then
Florian Festi 9c3f8c
   exit $STATUS
Florian Festi 9c3f8c
 fi
Florian Festi 9c3f8c
 cd 'hello-1.0'
Florian Festi 9c3f8c
-/usr/bin/mkdir SPECPARTS
Florian Festi 9c3f8c
+/usr/bin/mkdir -p SPECPARTS
Florian Festi 9c3f8c
 /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
Florian Festi 9c3f8c
 echo "Patch #0 (hello-1.0-modernize.patch):"
Florian Festi 9c3f8c
 /usr/bin/patch --no-backup-if-mismatch -f -p1 -b --suffix .modernize --fuzz=0 < /build/SOURCES/hello-1.0-modernize.patch
Florian Festi 9c3f8c
-- 
Florian Festi 9c3f8c
2.40.1
Florian Festi 9c3f8c