]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools: config-gen: make scripts bourne sh compliant [checkbashisms]
authorSami Kerola <kerolasa@iki.fi>
Sun, 18 Mar 2012 20:38:39 +0000 (21:38 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 30 Mar 2012 14:48:13 +0000 (16:48 +0200)
$ checkbashisms config-gen
script config-gen does not appear to be a /bin/sh script
possible bashism in config-gen line 27 (export foo=bar should be foo=bar; export foo):
        export CFLAGS="$CFLAGS"
$ checkbashisms config-gen-functions.sh
possible bashism in config-gen-functions.sh line 14 ('function' is useless):

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tools/config-gen
tools/config-gen-functions.sh

index 441e5a46500f386146112670cd337cbbd2cb56a2..720c5a7dd3726dffb6eb4f8bc0def01e21a9eaae 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2011 Karel Zak <kzak@redhat.com> 
 # 
@@ -24,7 +24,8 @@ for x in $opts; do
 done
 if [ -n "$CFLAGS" ]; then
        echo "CFLAGS:   $CFLAGS"
-       export CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS"
+       export CFLAGS
 fi
 
 echo
index 4f0e575f60244064bb3005fe6325db61fc67eb42..17e5a41e74e15973213ba6708d5fd8d4c9c510f3 100644 (file)
@@ -11,7 +11,7 @@
 #
 #    ul_get_configuration $top_srcdir/tools/config-gen.d/all
 #
-function ul_get_configuration {
+ul_get_configuration() {
        local conf="$1"
        local dir=$(dirname $1)
        local opts=$(cat $conf)