Skip to content

Commit b07d13f

Browse files
roliver-rpitdewey-rpi
authored andcommitted
fetch-repo-package-list: POSIX sh compatible
Signed-off-by: Richard Oliver <[email protected]>
1 parent e0f4dc0 commit b07d13f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

fetch-repo-package-list/fetch-repo-package-list

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22

33
set -e
44

@@ -10,7 +10,6 @@ ARCH="${ARCH:-arm64}"
1010
# Should be set by systemd
1111
SERVICE_NAME="fetch-repo-package-list@https:--archive.raspberrypi.org-debian.service"
1212
CACHE_DIRECTORY="${CACHE_DIRECTORY:=/var/cache/${SERVICE_NAME}}"
13-
RUNTUME_DIRECTORY="${RUNTIME_DIRECTORY:=/run/${SERVICE_NAME}}"
1413

1514
PGZ="Packages.gz"
1615
PACKAGES_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}"
2120
curl \
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}")"
2928
PACKAGES_GZ_ETAG="${PACKAGES_GZ_ETAG%\"}"
3029
PACKAGES_GZ_ETAG="${PACKAGES_GZ_ETAG#\"}"
3130

3231
# Extract the downloaded file, use the etag as a suffix to create a unique file
3332
PACKAGES_FILE="${CACHE_DIRECTORY}/Packages_${PACKAGES_GZ_ETAG}"
34-
if [ ! -f ${PACKAGES_FILE} ]
33+
if [ ! -f "${PACKAGES_FILE}" ]
3534
then
36-
gunzip --to-stdout ${PACKAGES_GZ_FILE} > ${PACKAGES_FILE}
35+
gunzip --to-stdout "${PACKAGES_GZ_FILE}" > "${PACKAGES_FILE}"
3736
fi
3837

3938
>&2 echo "Copying Packages to runtime directory"

0 commit comments

Comments
 (0)