aboutsummaryrefslogtreecommitdiff
path: root/src/dotnet/install.sh
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2022-10-11 01:33:01 +0300
committerGitHub <noreply@github.com>2022-10-11 01:33:01 +0300
commita8cb375d460840bbf8c91599d16fc87d9ee8b996 (patch)
tree73dd647775325582c17a452816457f5cec82004d /src/dotnet/install.sh
parent065b5ec9e19d4f289a070c3d5337696fd2394dc0 (diff)
Ensure remove apt-update cache at the beginning and end of the scripts (#210)
* remove apt lists * bump versions
Diffstat (limited to 'src/dotnet/install.sh')
-rwxr-xr-xsrc/dotnet/install.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh
index d9399ca..fe4f58d 100755
--- a/src/dotnet/install.sh
+++ b/src/dotnet/install.sh
@@ -30,6 +30,11 @@ DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hi
# alongside DOTNET_VERSION, but not set as default.
ADDITIONAL_VERSIONS=${ADDITIONALVERSIONS:-""}
+set -e
+
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
# Setup STDERR.
err() {
echo "(!) $*" >&2
@@ -109,8 +114,10 @@ updaterc() {
apt_get_update()
{
- echo "Running apt-get update..."
- apt-get update -y
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
}
# Check if packages are installed and installs them if not.
@@ -463,4 +470,7 @@ if [ "${CHANGE_OWNERSHIP}" = "true" ]; then
find "${TARGET_DOTNET_ROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
echo "Done!"