From b281ae0c2291d498bda2fd4215bdefdfb74de47d Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Wed, 29 Jan 2025 11:27:05 +0100 Subject: [PATCH] contrib/makerepo.sh: fix script for fedpkg 1.44 If the user of the script still uses fedpkg 1.44 the script fails because the -build directory doesn't exist. Now it was tested in both versions. --- contrib/fedora/utils/makerepo.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/fedora/utils/makerepo.sh b/contrib/fedora/utils/makerepo.sh index e81c478bf6..25c42db51f 100755 --- a/contrib/fedora/utils/makerepo.sh +++ b/contrib/fedora/utils/makerepo.sh @@ -265,9 +265,11 @@ detect_dirname() { # At some point FEDPKG changed the behavior of "prep" command # now it generates the directory with "-build" suffix and the # real directory inside. We just move it out. - rm -rf $D - mv $D-build/$D . - rm -rf $D-build + if [ -d "$D-build" ]; then + rm -rf "$D" + mv "$D-build/$D" . + rm -rf "$D-build" + fi [[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D") done done