From: Mathieu Desnoyers Date: Mon, 1 Feb 2010 14:38:41 +0000 (-0500) Subject: lttctl scripts: ensure sh compatibility X-Git-Tag: 0.80~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6e8902bf55007831c1cbc3092f4f44b4106c9cff;p=ltt-control.git lttctl scripts: ensure sh compatibility Signed-off-by: Mathieu Desnoyers --- diff --git a/configure.in b/configure.in index 81c21c3..d67e7d4 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(ltt-control,0.78-04122009) +AM_INIT_AUTOMAKE(ltt-control,0.79-01022010) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/lttctl/Makefile.am b/lttctl/Makefile.am index b01d983..66df1b7 100644 --- a/lttctl/Makefile.am +++ b/lttctl/Makefile.am @@ -2,6 +2,9 @@ AM_CFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_BIN_DIR=\""$(bindir)"\" +# Ensure scripts are portable by depending only on /bin/sh +SH = /bin/sh + bin_PROGRAMS = lttctl bin_SCRIPTS = ltt-armall ltt-disarmall \ ltt-armtap ltt-disarmtap @@ -11,25 +14,25 @@ EXTRA_DIST = ltt-armall.sh ltt-disarmall.sh \ ltt-armall: ltt-armall.sh rm -f ltt-armall - echo "#!"$(BASH) > ltt-armall + echo "#!"$(SH) > ltt-armall cat $(srcdir)/ltt-armall.sh >> ltt-armall chmod ugo+x ltt-armall ltt-disarmall: ltt-disarmall.sh rm -f ltt-disarmall - echo "#!"$(BASH) > ltt-disarmall + echo "#!"$(SH) > ltt-disarmall cat $(srcdir)/ltt-disarmall.sh >> ltt-disarmall chmod ugo+x ltt-disarmall ltt-armtap: ltt-armtap.sh rm -f ltt-armtap - echo "#!"$(BASH) > ltt-armtap + echo "#!"$(SH) > ltt-armtap cat $(srcdir)/ltt-armtap.sh >> ltt-armtap chmod ugo+x ltt-armtap ltt-disarmtap: ltt-disarmtap.sh rm -f ltt-disarmtap - echo "#!"$(BASH) > ltt-disarmtap + echo "#!"$(SH) > ltt-disarmtap cat $(srcdir)/ltt-disarmtap.sh >> ltt-disarmtap chmod ugo+x ltt-disarmtap diff --git a/lttctl/ltt-armall.sh b/lttctl/ltt-armall.sh index 9b740d1..0314323 100755 --- a/lttctl/ltt-armall.sh +++ b/lttctl/ltt-armall.sh @@ -62,7 +62,7 @@ if [ ! ${NETWORK} ]; then TESTS="${TESTS} -path '*/net/*_extended' -prune -o" fi -(eval "find '${MARKERSROOT}' ${TESTS} -name metadata -prune -o -name enable -print0") | while read -r -d $'\0' marker; do +(eval "find '${MARKERSROOT}' ${TESTS} -name metadata -prune -o -name enable -print") | while read -r marker; do if [ ! ${QUIET} ]; then echo "Connecting ${marker%/enable}" fi diff --git a/lttctl/ltt-disarmall.sh b/lttctl/ltt-disarmall.sh index 4f4fdca..5fdcf1e 100755 --- a/lttctl/ltt-disarmall.sh +++ b/lttctl/ltt-disarmall.sh @@ -48,7 +48,7 @@ while getopts "qh" options; do done shift $((${OPTIND} - 1)) -(eval "find '${MARKERSROOT}' -name metadata -prune -o -name enable -print0") | while read -r -d $'\0' marker; do +(eval "find '${MARKERSROOT}' -name metadata -prune -o -name enable -print") | while read -r marker; do grep "^1$" "${marker}" -q if [ $? -ne 0 ]; then continue