Skip to content

Commit

Permalink
Download files only on the "last" *.spec files
Browse files Browse the repository at this point in the history
When executing multiple services, different versions of the same .spec
might be generated. Before this patch, download_files downloaded files
from all of them, which however could cause problems for example for
deb/ubuntu builds that may automatically detect the orig archive (e.g.
if set_version changes the URL to download files from).

This patch fixes the problem by looking at all the *.spec files
referencing the same base spec file and by considering only the longest
file name, because it is the one where the more services were applied.
  • Loading branch information
ret2libc committed Oct 13, 2021
1 parent 0bf6b2a commit f691793
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion download_files
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,17 @@ default_config="/usr/lib/build/configs/sl12.3.conf"

SRCDIR=$PWD

declare -A spec_files
for i in *.spec; do
basespec=$(echo ${i##*:})
existing_longest=$(echo ${spec_files[${basespec}]})
if [[ ${#i} -gt ${#existing_longest} ]]; then
spec_files[${basespec}]=$i
fi
done

RETURN=0
for i in *.spec PKGBUILD appimage.yml; do
for i in ${spec_files[@]} PKGBUILD appimage.yml; do
test -e "$i" || continue

for url in `perl -I/usr/lib/build -MBuild -e Build::show $default_config "$i" sources` `perl -I/usr/lib/build -MBuild -e Build::show $default_config "$i" patches`; do
Expand Down

0 comments on commit f691793

Please sign in to comment.