Wrap long lines

Fix bashate warning E006 by wrapping long lines.

Also make sure bashate runs on init scripts that don't end
in .sh.

Change-Id: I077a064505e6f11f61c65279a54c9b2430044bf0
This commit is contained in:
Ben Swartzlander 2017-01-28 15:39:09 -05:00
parent 0358d1f175
commit 0c98cfee3e
4 changed files with 16 additions and 10 deletions

View File

@ -17,7 +17,8 @@ check_net() {
json_metadata() {
F=$1/ec2/2009-04-04/meta-data.json
[ -f $F ] || return
JSON.sh < $F | sed -n 's/^\["public-keys","[0-9]\+","openssh-key"\]\t"\(.*\)\\n"$/\1/p'
SCRIPT='s/^\["public-keys","[0-9]\+","openssh-key"\]\t"\(.*\)\\n"$/\1/p'
JSON.sh < $F | sed -n "$SCRIPT"
}
check_cd() {

View File

@ -11,10 +11,12 @@
# Grab JSON.sh for json parsing
JSON_VERS=e05e69a0debdba68125a33ac786726cb860b2e7b
JSON_SH=https://raw.githubusercontent.com/dominictarr/JSON.sh/$JSON_VERS/JSON.sh
GITHUB_RAW=https://raw.githubusercontent.com
JSON_URL=$GITHUB_RAW/dominictarr/JSON.sh/$JSON_VERS/JSON.sh
JSON_SH=download/JSON.sh
if [ ! -x download/JSON.sh ] ; then
curl -s $JSON_SH > download/JSON.sh
chmod +x download/JSON.sh
curl -s $JSON_URL > $JSON_SH
chmod +x $JSON_SH
fi
# Create the filesystem overlays
@ -22,14 +24,14 @@ if [ ! -d overlay-client ] ; then
mkdir overlay-client
cp -a common-files/* overlay-client
mkdir -p overlay-client/usr/bin
cp download/JSON.sh overlay-server/usr/bin
cp $JSON_SH overlay-server/usr/bin
fi
if [ ! -d overlay-server ] ; then
mkdir overlay-server
cp -a common-files/* overlay-server
cp -a server-files/* overlay-server
mkdir -p overlay-server/usr/bin
cp download/JSON.sh overlay-server/usr/bin
cp $JSON_SH overlay-server/usr/bin
fi
# Copy the config files where they need to go (temporarily)

View File

@ -1,5 +1,7 @@
#!/bin/sh
qemu-img create -f qcow2 -b client.qcow2 client-test.qcow2
kvm -m 512 -monitor none -nographic -drive file=client-test.qcow2,if=virtio,format=qcow2 -netdev user,id=net0 -device virtio-net-pci,netdev=net0
kvm -m 512 -monitor none -nographic \
-drive file=client-test.qcow2,if=virtio,format=qcow2 \
-netdev user,id=net0 -device virtio-net-pci,netdev=net0
rm client-test.qcow2

View File

@ -6,11 +6,12 @@ deps = {env:BASHATE_INSTALL_PATH:bashate==0.5.1}
[testenv:bashate]
whitelist_externals = bash
commands = bash -c "find {toxinidir} \
commands = bash -c "(find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-not \( -type d -name output-\* -prune \) \
-not \( -type d -name overlay-\* -prune \) \
-not \( -type d -name buildroot -prune \) \
-not \( -type d -name download -prune \) \
-type f -name \*.sh \
-print0 | xargs -0 bashate -v"
-type f -name \*.sh -print0 ; \
find {toxinidir}/common-files/etc/init.d \
-type f -print0) | xargs -0 bashate -v"