1- #! /usr/ bin/env bash
1+ #! /bin/sh
22
33set -e
44
@@ -10,7 +10,6 @@ ARCH="${ARCH:-arm64}"
1010# Should be set by systemd
1111SERVICE_NAME=" fetch-repo-package-list@https:--archive.raspberrypi.org-debian.service"
1212CACHE_DIRECTORY=" ${CACHE_DIRECTORY:=/ var/ cache/ ${SERVICE_NAME} } "
13- RUNTUME_DIRECTORY=" ${RUNTIME_DIRECTORY:=/ run/ ${SERVICE_NAME} } "
1413
1514PGZ=" Packages.gz"
1615PACKAGES_GZ_FILE=" ${CACHE_DIRECTORY} /${PGZ} "
@@ -19,21 +18,21 @@ PACKAGES_GZ_URL="${REPOSITORY}/dists/${RELEASE}/main/binary-${ARCH}/${PGZ}"
1918
2019>&2 echo " Downloading latest package information for ${RELEASE} :${ARCH} from ${REPOSITORY} "
2120curl \
22- --etag-compare ${PACKAGES_GZ_ETAG_FILE} \
23- --etag-save ${PACKAGES_GZ_ETAG_FILE} \
24- ${PACKAGES_GZ_URL} \
25- -o ${PACKAGES_GZ_FILE} \
21+ --etag-compare " ${PACKAGES_GZ_ETAG_FILE} " \
22+ --etag-save " ${PACKAGES_GZ_ETAG_FILE} " \
23+ " ${PACKAGES_GZ_URL} " \
24+ -o " ${PACKAGES_GZ_FILE} " \
2625 2> /dev/null
2726
28- PACKAGES_GZ_ETAG=" $( < ${PACKAGES_GZ_ETAG_FILE} ) "
27+ PACKAGES_GZ_ETAG=" $( cat " ${PACKAGES_GZ_ETAG_FILE} " ) "
2928PACKAGES_GZ_ETAG=" ${PACKAGES_GZ_ETAG% \" } "
3029PACKAGES_GZ_ETAG=" ${PACKAGES_GZ_ETAG# \" } "
3130
3231# Extract the downloaded file, use the etag as a suffix to create a unique file
3332PACKAGES_FILE=" ${CACHE_DIRECTORY} /Packages_${PACKAGES_GZ_ETAG} "
34- if [ ! -f ${PACKAGES_FILE} ]
33+ if [ ! -f " ${PACKAGES_FILE} " ]
3534then
36- gunzip --to-stdout ${PACKAGES_GZ_FILE} > ${PACKAGES_FILE}
35+ gunzip --to-stdout " ${PACKAGES_GZ_FILE} " > " ${PACKAGES_FILE} "
3736fi
3837
3938>&2 echo " Copying Packages to runtime directory"
0 commit comments