This line
|
# verify we have no "ruby" packages installed |
|
! dpkg -l | grep -i ruby; \ |
won't work as expected. Because of the ! it will always succeed.
Shellcheck tracks this behavior with
! dpkg -l | grep -i ruby
^-- SC2251: This ! is not on a condition and skips errexit. Use `&& exit 1` instead, or make sure $? is checked.
I can't see a clean one-liner to solve this, I think the correct way is to rather run:
if dpkg -l | grep -i 'ruby'; then return 1; fi
also dpkg -l can list previously uninstalled packages, to verify a package is actually installed it would rather be | grep -iP '^ii.*ruby.*'
This line
ruby/Dockerfile-slim.template
Lines 101 to 102 in e040029
won't work as expected. Because of the
!it will always succeed.Shellcheck tracks this behavior with
I can't see a clean one-liner to solve this, I think the correct way is to rather run:
if dpkg -l | grep -i 'ruby'; then return 1; fialso
dpkg -lcan list previously uninstalled packages, to verify a package is actually installed it would rather be| grep -iP '^ii.*ruby.*'