Skip to content

Commit

Permalink
use double-quotes to make output more readable
Browse files Browse the repository at this point in the history
commit 766b70c quoted these values to
prevent globbing, but used single quotes. However, these commands are
executed with `sh -c` using single quotes, which makes the output hard
to read because of the embedded quotes being escaped.

This patch changes to use double-quotes, which should still prevent
globbing to happen, but make the output more readable.

Before:

    CHANNEL=test ./install.sh
    ...
    Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
    + '[' test '!=' stable ']'
    + sh -c 'dnf config-manager --set-disabled '\''docker-ce-*'\'''
    + sh -c 'dnf config-manager --set-enabled '\''docker-ce-test'\'''
    + sh -c 'dnf makecache'

After:

    CHANNEL=test ./install.sh
    ...
    Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
    + '[' test '!=' stable ']'
    + sh -c 'dnf config-manager --set-disabled "docker-ce-*"'
    + sh -c 'dnf config-manager --set-enabled "docker-ce-test"'
    + sh -c 'dnf makecache'

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Sep 12, 2024
1 parent 992da63 commit 65cca2f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -569,26 +569,26 @@ do_install() {
$sh_c "rm -f '${TMP_REPO_FILE}'"

if [ "$CHANNEL" != "stable" ]; then
$sh_c "dnf5 config-manager setopt 'docker-ce-*.enabled=0'"
$sh_c "dnf5 config-manager setopt 'docker-ce-$CHANNEL.enabled=1'"
$sh_c "dnf5 config-manager setopt \"docker-ce-*.enabled=0\""
$sh_c "dnf5 config-manager setopt \"docker-ce-$CHANNEL.enabled=1\""
fi
$sh_c "dnf makecache"
elif command_exists dnf; then
$sh_c "dnf -y -q --setopt=install_weak_deps=False install dnf-plugins-core"
$sh_c "dnf config-manager --add-repo $repo_file_url"

if [ "$CHANNEL" != "stable" ]; then
$sh_c "dnf config-manager --set-disabled 'docker-ce-*'"
$sh_c "dnf config-manager --set-enabled 'docker-ce-$CHANNEL'"
$sh_c "dnf config-manager --set-disabled \"docker-ce-*\""
$sh_c "dnf config-manager --set-enabled \"docker-ce-$CHANNEL\""
fi
$sh_c "dnf makecache"
else
$sh_c "yum -y -q install yum-utils"
$sh_c "yum config-manager --add-repo $repo_file_url"

if [ "$CHANNEL" != "stable" ]; then
$sh_c "yum config-manager --disable 'docker-ce-*'"
$sh_c "yum config-manager --enable 'docker-ce-$CHANNEL'"
$sh_c "yum config-manager --disable \"docker-ce-*\""
$sh_c "yum config-manager --enable \"docker-ce-$CHANNEL\""
fi
$sh_c "yum makecache"
fi
Expand Down

0 comments on commit 65cca2f

Please sign in to comment.