From: Harald Hoyer Date: Thu, 13 Jun 2013 09:09:52 +0000 (+0200) Subject: Don't use do syncheck for target all and refine syncheck X-Git-Tag: 029~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36c34f4e71620faf7ca34c44497ab53580d965c5;p=thirdparty%2Fdracut.git Don't use do syncheck for target all and refine syncheck instead of "dash -n" we now use "bash --posix -n" we also check for "[[ " in posix shell files --- diff --git a/Makefile b/Makefile index d1201d607..436421cc3 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages) .PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh -all: syncheck dracut-version.sh dracut-install +all: dracut-version.sh dracut-install DRACUT_INSTALL_OBJECTS = \ install/dracut-install.o \ @@ -176,11 +176,11 @@ rpm: dracut-$(VERSION).tar.bz2 ( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm ) syncheck: - @ret=0;for i in dracut-initramfs-restore.sh dracut-logger.sh \ - modules.d/99base/init.sh modules.d/*/*.sh; do \ + @ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \ [ "$${i##*/}" = "module-setup.sh" ] && continue; \ read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \ - [ $$V ] && echo "dash syntax check: $$i"; dash -n "$$i" ; ret=$$(($$ret+$$?)); \ + [ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \ + [ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \ done;exit $$ret @ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \ modules.d/*/module-setup.sh; do \ diff --git a/dracut-logger.sh b/dracut-logger.sh index f39e5e7ad..9fa76d4af 100755 --- a/dracut-logger.sh +++ b/dracut-logger.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 et filetype=sh # diff --git a/dracut.spec b/dracut.spec index a475e08e6..922474a09 100644 --- a/dracut.spec +++ b/dracut.spec @@ -30,7 +30,7 @@ URL: https://dracut.wiki.kernel.org/ # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2 -BuildRequires: dash bash git +BuildRequires: bash git %if 0%{?fedora} || 0%{?rhel} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)