From fed3a15e621b530eb1b52cdea8544c51204a483c Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 14 Aug 2024 00:28:12 +0800 Subject: feat(docker/debian-dev): support both 11 and 12 for apt source. --- .../bootstrap/apt-source/setup.bash | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'docker/crupest-debian-dev/bootstrap/apt-source/setup.bash') diff --git a/docker/crupest-debian-dev/bootstrap/apt-source/setup.bash b/docker/crupest-debian-dev/bootstrap/apt-source/setup.bash index 60583d4..6e504ef 100755 --- a/docker/crupest-debian-dev/bootstrap/apt-source/setup.bash +++ b/docker/crupest-debian-dev/bootstrap/apt-source/setup.bash @@ -2,16 +2,32 @@ set -e -dir=$(dirname "$0") +dir=/bootstrap/apt-source + +echo "Getting debian version..." +debian_version=$(bash "$dir/../get-debian-version.bash") + +if [[ -z $debian_version ]]; then + echo "Debian version not found." + exit 1 +else + echo "Debian version: $debian_version" +fi + +if [[ $debian_version -ge 12 ]]; then + setup_dir=$dir/12 +else + setup_dir=$dir/11 +fi echo "Setting up apt source..." if [[ -n $CRUPEST_DEBIAN_DEV_IN_CHINA ]]; then echo "In China, using China source..." - "$dir/replace-domain.bash" "$(cat "$dir/china-source.txt")" + "$setup_dir/replace-domain.bash" "$(cat "$dir/china-source.txt")" fi "$dir/install-apt-https.bash" -"$dir/replace-http.bash" +"$setup_dir/replace-http.bash" echo "Setting up apt source done." -- cgit v1.2.3