diff options
author | crupest <crupest@outlook.com> | 2024-08-14 00:28:12 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-08-14 22:58:21 +0800 |
commit | fed3a15e621b530eb1b52cdea8544c51204a483c (patch) | |
tree | 4141dbea334763699c16c95183fa49269e97e629 /docker/crupest-debian-dev/bootstrap/apt-source/setup.bash | |
parent | 8cb9b351b122ef17b6026cce0d45432c5c28745d (diff) | |
download | crupest-fed3a15e621b530eb1b52cdea8544c51204a483c.tar.gz crupest-fed3a15e621b530eb1b52cdea8544c51204a483c.tar.bz2 crupest-fed3a15e621b530eb1b52cdea8544c51204a483c.zip |
feat(docker/debian-dev): support both 11 and 12 for apt source.
Diffstat (limited to 'docker/crupest-debian-dev/bootstrap/apt-source/setup.bash')
-rwxr-xr-x | docker/crupest-debian-dev/bootstrap/apt-source/setup.bash | 22 |
1 files changed, 19 insertions, 3 deletions
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." |