Skip to content

Commit

Permalink
fix({install,update}.sh): provide remote spdx-licenses for debian (pa…
Browse files Browse the repository at this point in the history
…cstall#1164)

Co-authored-by: ook37 <[email protected]>
  • Loading branch information
oklopfer and ook37 authored Jul 3, 2024
1 parent c31ae6f commit d8d590a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 17 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,23 @@ case "$reply" in
;;
esac

if [[ ${GITHUB_ACTIONS} == "true" ]]; then
apt-get install -qq -y "${pacstall_deps[@]}"
else
apt-get install -y "${pacstall_deps[@]}"
for pkg in "${pacstall_deps[@]}"; do
if ! dpkg -s "${pkg}" > /dev/null 2>&1; then
if [[ ${pkg} == "spdx-licenses" ]]; then
if [[ -z $(apt-cache search --names-only "^${pkg}$") ]]; then
curl -s "http://ftp.debian.org/debian/pool/main/s/${pkg}/${pkg}_3.8+dfsg-3_all.deb" -o "/tmp/${pkg}.deb" && \
sudo apt install "/tmp/${pkg}.deb" -y && sudo rm -f "/tmp/${pkg}.deb" && continue
fi
fi
to_install+=("${pkg}")
fi
done
if ((${#to_install[@]} != 0)); then
if [[ ${GITHUB_ACTIONS} == "true" ]]; then
apt-get install -qq -y "${to_install[@]}"
else
apt-get install -y "${to_install[@]}"
fi
fi

METADIR="/var/lib/pacstall/metadata"
Expand Down
6 changes: 6 additions & 0 deletions misc/scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ done

for pkg in "${pacstall_deps[@]}"; do
if ! dpkg -s "${pkg}" > /dev/null 2>&1; then
if [[ ${pkg} == "spdx-licenses" ]]; then
if [[ -z $(apt-cache search --names-only "^${pkg}$") ]]; then
curl -s "http://ftp.debian.org/debian/pool/main/s/${pkg}/${pkg}_3.8+dfsg-3_all.deb" -o "/tmp/${pkg}.deb" && \
sudo apt install "/tmp/${pkg}.deb" -y && sudo rm -f "/tmp/${pkg}.deb" && continue
fi
fi
to_install+=("${pkg}")
fi
done
Expand Down

0 comments on commit d8d590a

Please sign in to comment.