contrib/makerepo.sh: adapt to "fedpkg prep" new behavior

Now "fedpkg prep" command is generating a directory with the "-build"
suffix containing the build directory inside. We need to extract it.

Real example:

If the script is used for a branch related to nm-1-46, the "fedpkg prep"
command will generate a NetworkManager-1.46-build/ directory containing
the NetworkManager-1.46/ sources directory. We just need to move the
NetworkManager-1.46/ out.
This commit is contained in:
Fernando Fernandez Mancera
2025-01-08 13:15:47 +01:00
parent 9be28970a6
commit 6819f05644

View File

@@ -262,6 +262,12 @@ detect_dirname() {
# the unpacked tarball (that is, stripping the suffix).
for T in $(ls -1 "$BUILD_TYPE"*"$suffix" 2>/dev/null); do
D="${T%$suffix}"
# 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
[[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D")
done
done