Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,27 @@ do_install() {
# Run setup for each distro accordingly
case "$lsb_dist" in
ubuntu|debian|raspbian)
use_deb822=true
case "$lsb_dist.$dist_version" in
debian.jessie|ubuntu.trusty)
use_deb822=false
;;
esac
Comment on lines +559 to +564
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already make these old distros a hard failure, so we can probably skip this check; older distros are no longer supported by the script, so it's fine if things would fail.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any hard failure here. Is that in some other component?

        # Print deprecation warnings for distro versions that recently reached EOL,
        # but may still be commonly used (especially LTS versions).
        case "$lsb_dist.$dist_version" in
                centos.8|centos.7|rhel.7)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                debian.buster|debian.stretch|debian.jessie)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                raspbian.buster|raspbian.stretch|raspbian.jessie)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                ubuntu.focal|ubuntu.bionic|ubuntu.xenial|ubuntu.trusty)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                ubuntu.oracular|ubuntu.mantic|ubuntu.lunar|ubuntu.kinetic|ubuntu.impish|ubuntu.hirsute|ubuntu.groovy|ubuntu.eoan|ubuntu.disco|ubuntu.cosmic)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                fedora.*)
                        if [ "$dist_version" -lt 41 ]; then
                                deprecation_notice "$lsb_dist" "$dist_version"
                        fi
                        ;;
        esac

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right; it's not a hard failure (we may have in the past), but it sleeps for 10 seconds and a warning;

deprecation_notice() {

Regardless, we should prefer keeping the script focused on what's still supported, and try to avoid complexity for things no longer supported; users can still download older versions of the script, or (better) create their own implementation targeted at their situation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I change it to a hard fail for those distro versions?

pre_reqs="ca-certificates curl"
apt_repo="deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL"
(
if [ "$use_deb822" = true ]; then
if [ -f /etc/apt/sources.list.d/docker.list ]; then
echo
echo "# WARNING: An existing Docker APT repository file using the sources.list format was found at /etc/apt/sources.list.d/docker.list."
echo "# Please remove this file to avoid conflicting repository settings."
echo
fi
Comment on lines +568 to +573
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a warning if the script detects that docker is installed already (as its main purpose is for fresh installs, not upgrades); honestly, I think we can keep it simple; assume the docker.list is created either by this script, or manually, but for the docker installation, so just remove it;

if [ -f /etc/apt/sources.list.d/docker.list ]; then
	rm -f /etc/apt/sources.list.d/docker.list
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

apt_repo="Types: deb\nURIs: $DOWNLOAD_URL/linux/$lsb_dist\nSuites: $dist_version\nComponents: $CHANNEL\nArchitectures: $(dpkg --print-architecture)\nSigned-By: /etc/apt/keyrings/docker.asc"
apt_repo_file="/etc/apt/sources.list.d/docker.sources"
else
apt_repo="deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL"
apt_repo_file="/etc/apt/sources.list.d/docker.list"
fi
if ! is_dry_run; then
set -x
fi
Expand All @@ -567,7 +585,7 @@ do_install() {
$sh_c 'install -m 0755 -d /etc/apt/keyrings'
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
$sh_c "chmod a+r /etc/apt/keyrings/docker.asc"
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
$sh_c "echo \"$apt_repo\" > $apt_repo_file"
$sh_c 'apt-get -qq update >/dev/null'
)

Expand Down