Skip to content

Commit 2f4ae48

Browse files
authored
Merge pull request #111 from seemethere/ih8whitespace
TAR-666: Fix inconsistent whitespace in apt-cache results
2 parents 1558f8d + ac63bbb commit 2f4ae48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ do_install() {
357357
else
358358
# Will work for incomplete versions IE (17.12), but may not actually grab the "latest" if in the test channel
359359
pkg_pattern="$(echo "$VERSION" | sed "s/-ce-/~ce~.*/g" | sed "s/-/.*/g").*-0~$lsb_dist"
360-
search_command="apt-cache madison 'docker-ce' | grep '$pkg_pattern' | head -1 | cut -d' ' -f 4"
360+
search_command="apt-cache madison 'docker-ce' | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3"
361361
pkg_version="$($sh_c "$search_command")"
362362
echo "INFO: Searching repository for VERSION '$VERSION'"
363363
echo "INFO: $search_command"
@@ -367,7 +367,7 @@ do_install() {
367367
echo
368368
exit 1
369369
fi
370-
search_command="apt-cache madison 'docker-ce-cli' | grep '$pkg_pattern' | head -1 | cut -d' ' -f 4"
370+
search_command="apt-cache madison 'docker-ce-cli' | grep '$pkg_pattern' | head -1 | awk '{\$1=\$1};1' | cut -d' ' -f 3"
371371
# Don't insert an = for cli_pkg_version, we'll just include it later
372372
cli_pkg_version="$($sh_c "$search_command")"
373373
pkg_version="=$pkg_version"

0 commit comments

Comments
 (0)