Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
add shellcheck test, fix code for shellcheck #8
Conversation
ogra1
added some commits
Apr 25, 2017
| @@ -0,0 +1,24 @@ | ||
| +language: C | ||
| +dist: xenial |
zyga
Apr 25, 2017
Contributor
Is that a real thing now? I thought travis just "upgraded" defaults to 14.04 but only supported precise and trusty.
ogra1
Apr 25, 2017
Contributor
well, it isnt ... but it is also ignored and describes that we now use a xenial chroot inside when testing ;)
| -if [ "$(stat -c %s $FILE)" -ne "$((1024*1024*$SIZE))" ]; then | ||
| - delete_swapfile $FILE | ||
| - create_swapfile $FILE $SIZE | ||
| +if [ "$(stat -c %s "$FILE")" -ne "$((1024*1024*SIZE))" ]; then |
| else | ||
| # we are not at the end ! get the start of the next partition | ||
| # (minus 1 byte) instead of using the absolute end of the disk | ||
| - endsize=$(($(parted -ms $DEV unit B print|grep ^$(($num+1)):|\ |
ogra1
Apr 25, 2017
Contributor
yes, $num never existed, and likewise we do not have any image yet where the "else" would actually be in effect (only if "writable" is not the last partition on disk, we do not have such images yet)
ogra1
added some commits
Apr 25, 2017
niemeyer
approved these changes
Apr 27, 2017
Looks reasonable, although I'm not aware of the details of the actual tests run.
| +script: | ||
| + - sudo chroot $CHROOT sh -c 'cd build; for file in $(find . | xargs file | grep shell |grep -v .git| sed "s/:.*$/ /g" | tr -d "\n"); do shellcheck $SHCKOPTS $file; done' | ||
| + # test build src packages unsigned in a xenial chroot | ||
| + - sudo chroot xenial-test-chroot sh -c 'cd build/initramfs; LC_ALL=C.UTF-8 dpkg-buildpackage -rfakeroot -S -sa -us -uc' |
niemeyer
Apr 27, 2017
Why above uses $CHROOT but these don't?
The common prefix here might also be turned into a variable btw ($CHROOT_RUN or something).
ogra1
Apr 27, 2017
Contributor
nice catch! i was testing the line locally and forgot to substitute the variable back in when i copy/pasted it after testing...
zyga
approved these changes
Apr 28, 2017
All the shellcheck-driven changes look correct. I didn't dig into the travis testing but I trust it works.
| } | ||
| do_mbr() | ||
| { | ||
| DEV=$1 | ||
| PART=$2 | ||
| - endsize=$(get_end $PART) | ||
| - parted -s $DEV resizepart $PART $endsize | ||
| + endsize=$(get_end "$PART") |
zyga
Apr 28, 2017
Contributor
You can also quote the outer part but I think it's actually not required here.
ogra1 commentedApr 25, 2017
•
Edited 1 time
-
ogra1
Apr 26, 2017