Skip to content

Commit

Permalink
scripts/generate-bootstraps.sh: make architecture-independent (arch "…
Browse files Browse the repository at this point in the history
…all") package list optional

It is not available in some repository types, e.g. in built with "aptly".
  • Loading branch information
Leonid Pliushch committed Apr 13, 2021
1 parent a6940e5 commit d0cea5a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/generate-bootstraps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,23 @@ for cmd in ar awk curl grep gzip find sed tar xargs xz zip; do
done

# Download package lists from remote repository.
# Actually, there 2 lists are downloaded: one architecture-independent and one
# for architecture specified as '$1' argument.
# Actually, there 2 lists can be downloaded: one architecture-independent and
# one for architecture specified as '$1' argument. That depends on repository.
# If repository has been created using "aptly", then architecture-independent
# list is not available.
read_package_list() {
local architecture
for architecture in all "$1"; do
if [ ! -e "${BOOTSTRAP_TMPDIR}/packages.${architecture}" ]; then
echo "[*] Downloading package list for architecture '${architecture}'..."
curl \
--fail \
--location \
if ! curl --fail --location \
--output "${BOOTSTRAP_TMPDIR}/packages.${architecture}" \
"${REPO_BASE_URL}/dists/stable/main/binary-${architecture}/Packages"
"${REPO_BASE_URL}/dists/stable/main/binary-${architecture}/Packages"; then
if [ "$architecture" = "all" ]; then
echo "[!] Skipping architecture-independent package list as not available..."
continue
fi
fi
echo >> "${BOOTSTRAP_TMPDIR}/packages.${architecture}"
fi

Expand Down

0 comments on commit d0cea5a

Please sign in to comment.