From: Zbigniew Jędrzejewski-Szmek Date: Thu, 2 Sep 2021 12:22:19 +0000 (+0200) Subject: mkosi: make mkosi.build shellcheck-clean X-Git-Tag: v250-rc1~732^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=068d133881305adcbc5f60c7a92b22ad4ac5556c;p=thirdparty%2Fsystemd.git mkosi: make mkosi.build shellcheck-clean Also remove the space after redirection operators. (Some redirections were with, some without, and I think it's nicer without.) --- diff --git a/mkosi.build b/mkosi.build index 4924bf300c7..e73cf554ca3 100755 --- a/mkosi.build +++ b/mkosi.build @@ -20,7 +20,7 @@ fi # that /usr/bin/ld is a symlink that points to a non-existing file in # /etc/alternative/ in this mode. Let's work around this for now by manually # redirect "ld" to "ld.bfd", i.e. circumventing the /usr/bin/ld symlink. -if [ ! -x /usr/bin/ld -a -x /usr/bin/ld.bfd ] ; then +if [ ! -x /usr/bin/ld ] && [ -x /usr/bin/ld.bfd ]; then mkdir -p "$HOME"/bin ln -s /usr/bin/ld.bfd "$HOME"/bin/ld PATH="$HOME/bin:$PATH" @@ -35,7 +35,7 @@ fi # So let's ensure we're running under UTF-8. # # If our current locale already is UTF-8, then we don't need to do anything: -if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then +if [ "$(locale charmap 2>/dev/null)" != "UTF-8" ] ; then # Try using C.UTF-8 locale, if available. This locale is not shipped # by upstream glibc, so it's not available in all distros. # (In particular, it's not available in Arch Linux.) @@ -54,9 +54,9 @@ if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then fi if [ ! -f "$BUILDDIR"/build.ninja ] ; then - sysvinit_path=`realpath /etc/init.d` + sysvinit_path=$(realpath /etc/init.d) - init_path=`realpath /sbin/init 2>/dev/null` + init_path=$(realpath /sbin/init 2>/dev/null) if [ -z "$init_path" ] ; then rootprefix="" else @@ -76,7 +76,7 @@ cd "$BUILDDIR" ninja "$@" if [ "$WITH_TESTS" = 1 ] ; then for id in 1 2 3; do - getent group $id > /dev/null || groupadd -g $id testgroup$id + getent group $id >/dev/null || groupadd -g $id testgroup$id done ninja test @@ -92,7 +92,7 @@ fi mkdir -p "$DESTDIR"/etc -cat > "$DESTDIR"/etc/issue <"$DESTDIR"/etc/issue <