Commit 180ed535 authored by Michael Shigorin's avatar Michael Shigorin

"if test ..." replaced by "if [ ... ]"

Fixed up the remnants of the early style mix to correspond to the proposed doc/style.txt; the rationale being that if [ ... ]; then ... ... fi is the more readable construct among itself, if test ...; then ... ... fi and [ ... ] && { ... ... } due to the condition being more distinguishable when bracketed and the body more apparent as the one inside "if" and not any other block; the less obvious difference is that the final construct of the latter form is prone to the whole script exit status being non-zero if the condition isn't met.
parent a8ccfb3d
...@@ -108,7 +108,7 @@ $(FEATURES): ...@@ -108,7 +108,7 @@ $(FEATURES):
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \ if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
if type -t git >&/dev/null && \ if type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" >/dev/null; then \ pushd "$(BUILDDIR)/" >/dev/null; then \
if test -n "`git status -s`"; then \ if [ -n "`git status -s`" ]; then \
git add . && \ git add . && \
git commit -qam "$$feat feature generation complete"; \ git commit -qam "$$feat feature generation complete"; \
fi; \ fi; \
......
...@@ -58,7 +58,7 @@ prep: ...@@ -58,7 +58,7 @@ prep:
@mkdir -p $(DSTDIR) @mkdir -p $(DSTDIR)
debug: debug:
@if test -n "$(DEBUG)"; then \ @if [ -n "$(DEBUG)" ]; then \
echo "** BOOTLOADER: $(BOOTLOADER)"; \ echo "** BOOTLOADER: $(BOOTLOADER)"; \
echo "** SYSLINUX_UI: $(SYSLINUX_UI)"; \ echo "** SYSLINUX_UI: $(SYSLINUX_UI)"; \
echo "** SYSLINUX_CFG: $(SYSLINUX_CFG)"; \ echo "** SYSLINUX_CFG: $(SYSLINUX_CFG)"; \
......
...@@ -16,15 +16,15 @@ esac ...@@ -16,15 +16,15 @@ esac
# copy extra files, if any # copy extra files, if any
SYSLINUX_FILES="$(cat .in/files.list)" SYSLINUX_FILES="$(cat .in/files.list)"
if test -n "${SYSLINUX_FILES% }"; then if [ -n "${SYSLINUX_FILES% }" ]; then
cp -a $SYSLINUX_FILES . cp -a $SYSLINUX_FILES .
fi fi
# prune module-specific config snippets; skip built-in one # prune module-specific config snippets; skip built-in one
SYSLINUX_MODULES="$(cat .in/modules.list)" SYSLINUX_MODULES="$(cat .in/modules.list)"
if test -n "$SYSLINUX_MODULES"; then if [ -n "$SYSLINUX_MODULES" ]; then
for module in $SYSLINUX_MODULES; do for module in $SYSLINUX_MODULES; do
if test "$modules" == "prompt"; then continue; fi if [ "$modules" == "prompt" ]; then continue; fi
cp -a $MODDIR/$module.c?? . || rm .in/[0-9][0-9]$module.cfg cp -a $MODDIR/$module.c?? . || rm .in/[0-9][0-9]$module.cfg
done done
fi fi
...@@ -33,7 +33,7 @@ fi ...@@ -33,7 +33,7 @@ fi
grep -hv '^#' .in/[0-9][0-9]*.cfg > "$BOOTLOADER.cfg" grep -hv '^#' .in/[0-9][0-9]*.cfg > "$BOOTLOADER.cfg"
# snippets are not going into the actual image # snippets are not going into the actual image
if test "$DEBUG" != 2; then rm -r .in/; fi if [ "$DEBUG" != 2 ]; then rm -r .in/; fi
# NB: there will be final macro expansion based on actual image sizes # NB: there will be final macro expansion based on actual image sizes
# (done by ../../scripts.d/10-propagator-ramdisk) # (done by ../../scripts.d/10-propagator-ramdisk)
...@@ -41,12 +41,12 @@ CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES) ...@@ -41,12 +41,12 @@ CHROOT_PACKAGES = $(STAGE1_PACKAGES) $(SYSTEM_PACKAGES)
# NB: we pass tested squashfs options for ../install2/Makefile # NB: we pass tested squashfs options for ../install2/Makefile
all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \ all: | debug prepare-workdir copy-tree run-scripts $(BUILD_PROPAGATOR) \
copy-$(BOOTLOADER) $(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR) copy-$(BOOTLOADER) $(COPY_SQUASHCFG) pack-image $(GLOBAL_CLEAN_WORKDIR)
@if test -s $(OUTDIR)/squashcfg.mk; then \ @if [ -s $(OUTDIR)/squashcfg.mk ]; then \
cp $(OUTDIR)/squashcfg.mk $(GLOBAL_BUILDDIR)/; \ cp $(OUTDIR)/squashcfg.mk $(GLOBAL_BUILDDIR)/; \
fi fi
debug: debug:
@if test -n "$(GLOBAL_VERBOSE)"; then \ @if [ -n "$(GLOBAL_VERBOSE)" ]; then \
echo "** BRANDING: $(BRANDING)"; \ echo "** BRANDING: $(BRANDING)"; \
echo "** IMAGE_INIT_LIST: $(IMAGE_INIT_LIST)"; \ echo "** IMAGE_INIT_LIST: $(IMAGE_INIT_LIST)"; \
echo "** STAGE1_PACKAGES: $(STAGE1_PACKAGES)"; \ echo "** STAGE1_PACKAGES: $(STAGE1_PACKAGES)"; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment