Permalink
Browse files

convert to sed expression: devscripts checkbashisms-command-v.patch

macOS X and Ubuntu Travis VM's use divergent versions of the
Upstream Debian devscripts package. This introduces the burden
of rebasing 2 patches, to add 'command -v' handling support to
'/scripts/checkbashism.pl'.

This commit uses a sed expression, to add 'command -v' handling
support to '/scripts/checkbashism.pl', for any version of
the devscripts package (that does not already have this support
patched in).
  • Loading branch information...
bobwya authored and austin987 committed Oct 12, 2018
1 parent 5a4a828 commit 023d407bb82e5350938a4d8a9e0969f74dc34491
Showing with 6 additions and 20 deletions.
  1. +0 −18 misc/checkbashisms-command-v.patch
  2. +6 −2 tests/shell-checks

This file was deleted.

Oops, something went wrong.
@@ -63,9 +63,13 @@ command -v grep
_EOF
if ! "$checkbashisms" --posix "${temp}/test.sh"; then
echo "checkbashisms fails on command -v, using patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733511 on a copy in ${temp} to work around"
echo "Use a sed expression, to add checkbashisms support for 'command -v', based on the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733511"
echo "Creating a copy of the checkbashisms script, in ${temp}, to workaround this issue"
# /usr/bin/ (or /usr/local/bin on OSX) isn't writable on Travis, so we have to patch it in /tmp and use that:
( cd "$(dirname "$checkbashisms")" && patch -p1 -o "${temp}/checkbashisms.patched" < "$OLDPWD/misc/checkbashisms-command-v.patch" && chmod +x "${temp}/checkbashisms.patched" )
(
sed -e '/qr'\''command\\s+\-\[\^p\]\\s'\''/ { ' -e 's|\[\^p\]|[^pvV]|' -e 's| \-p>| -p/-v/-V>|' -e '}' "$checkbashisms" > "${temp}/checkbashisms.patched" && \
chmod +x "${temp}/checkbashisms.patched"
)
checkbashisms="${temp}/checkbashisms.patched"
fi

0 comments on commit 023d407

Please sign in to comment.