summaryrefslogtreecommitdiffstats
path: root/share/scripts/curl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-17 17:40:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-23 16:29:28 +0000
commit13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1 (patch)
treea033edc5f91aa71f29e5f5688d56ac6f48c97d26 /share/scripts/curl
parentAdding upstream version 20180825. (diff)
downloadopen-infrastructure-compute-tools-13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1.tar.xz
open-infrastructure-compute-tools-13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1.zip
Adding upstream version 20190222.upstream/20190222
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts/curl')
-rwxr-xr-xshare/scripts/curl28
1 files changed, 15 insertions, 13 deletions
diff --git a/share/scripts/curl b/share/scripts/curl
index 72bdec3..80ccde6 100755
--- a/share/scripts/curl
+++ b/share/scripts/curl
@@ -1,7 +1,6 @@
#!/bin/sh
-# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2018 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,12 +19,15 @@
set -e
+PROJECT="open-infrastructure"
+SOFTWARE="compute-tools"
+PROGRAM="container"
SCRIPT="${0}"
-HOOKS="/etc/container-tools/hooks"
-KEYS="/etc/container-tools/keys"
+HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks"
+KEYS="/etc/${PROJECT}/${PROGRAM}/keys"
MACHINES="/var/lib/machines"
-CACHE="/var/cache/container-tools/system"
+CACHE="/var/cache/${PROJECT}/${PROGRAM}/system"
Parameters ()
{
@@ -172,7 +174,7 @@ then
exit 1
fi
-SERVER="${SERVER:-https://files.open-infrastructure.net/system/container/debian}"
+SERVER="${SERVER:-https://get.open-infrastructure.net/system/container/debian}"
PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}"
VERSION="$(container version)"
@@ -241,8 +243,8 @@ then
# Downloading container list
if curl --fail --head --output /dev/null --silent "${SERVER}/container-list.txt"
then
- mkdir -p /tmp/container-tools
- DEBCONF_TMPDIR="$(mktemp -d -p /tmp/container-tools -t $(basename ${0}).XXXX)"
+ mkdir -p "/tmp/${SOFTWARE}"
+ DEBCONF_TMPDIR="$(mktemp -d -p "/tmp/${SOFTWARE}" -t $(basename ${0}).XXXX)"
export DEBCONF_TMPDIR
if [ -z "${ARCHITECTURE}" ]
@@ -257,7 +259,7 @@ then
GREP_PATTERN="${GREP_PATTERN:-${ARCHITECTURE}}"
echo "Downloading $(echo ${SERVER} | awk -F/ '{ print $3 }') container list"
- curl --fail --location --progress-bar --user-agent container-tools/${VERSION} ${CURL_OPTIONS} \
+ curl --fail --location --progress-bar --user-agent ${SOFTWARE}/${VERSION} ${CURL_OPTIONS} \
"${SERVER}/container-list.txt" | grep -E "${GREP_PATTERN}" > "${DEBCONF_TMPDIR}/container-list.txt"
umask 0022
@@ -265,12 +267,12 @@ then
Debconf
# Run debconf parts
- for DEBCONF_SCRIPT in /usr/share/container-tools/scripts/curl.d/*
+ for DEBCONF_SCRIPT in /usr/share/${PROJECT}/${PROGRAM}/scripts/curl.d/*
do
if [ -x "${DEBCONF_SCRIPT}" ]
then
# FIXME
- # debconf -ocontainer-tools "${DEBCONF_SCRIPT}"
+ # debconf -o${SOFTWARE} "${DEBCONF_SCRIPT}"
"${DEBCONF_SCRIPT}"
fi
done
@@ -280,7 +282,7 @@ then
# Remove debconf temporary files
rm --preserve-root --one-file-system -rf "${DEBCONF_TMPDIR}"
- rmdir --ignore-fail-on-non-empty /tmp/container-tools 2>&1 || true
+ rmdir --ignore-fail-on-non-empty "/tmp/${SOFTWARE}" 2>&1 || true
fi
fi
@@ -320,7 +322,7 @@ do
fi
echo "Downloading ${FILE}"
- curl --fail --location --progress-bar --user-agent container-tools/${VERSION} ${CURL_OPTIONS} ${CURL_TIME_COND} \
+ curl --fail --location --progress-bar --user-agent ${SOFTWARE}/${VERSION} ${CURL_OPTIONS} ${CURL_TIME_COND} \
"${SERVER}/${FILE}" -o "${CACHE}/${FILE}"
fi
done