aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-02-20 15:16:20 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-02-20 15:16:20 +0000
commit1d41bb467e16cd4e9321baad765a478485357fb5 (patch)
tree899e3b84dee3cc201b12ed47b45b3d6113264cc4
parent69fdda915bd19eae973ff53c61a255dfb9891bd0 (diff)
downloadspec-helper-1d41bb467e16cd4e9321baad765a478485357fb5.tar
spec-helper-1d41bb467e16cd4e9321baad765a478485357fb5.tar.gz
spec-helper-1d41bb467e16cd4e9321baad765a478485357fb5.tar.bz2
spec-helper-1d41bb467e16cd4e9321baad765a478485357fb5.tar.xz
spec-helper-1d41bb467e16cd4e9321baad765a478485357fb5.zip
don't gprintify if init scripts doesn't contain a source functions
-rwxr-xr-xspec-helper13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec-helper b/spec-helper
index 558c977..a2b4974 100755
--- a/spec-helper
+++ b/spec-helper
@@ -53,10 +53,15 @@ test -z "$DONT_STRIP" && echo -n "Stripping files..." && strip_files && echo "do
test -z "$DONT_RELINK" && echo -n "Relativisation of symlinks..." && relative_me_babe && echo "done"
test -z "$DONT_CLEAN_PERL" && echo -n "Clean perl..." && clean_perl && echo "done"
test -z "$DONT_SYMLINK_LIBS" && echo -n "Building libraries symlinks..." && lib_symlinks && echo "done"
-if [ -d $RPM_BUILD_ROOT/etc/rc.d/init.d -a -n "`ls $RPM_BUILD_ROOT/etc/rc.d/init.d/* 2> /dev/null`" ]; then
- test -z "$DONT_GPRINTIFY" && echo -n "Gprintifying init scripts..." && gprintify.py $RPM_BUILD_ROOT/etc/rc.d/init.d/* && echo "done"
-elif [ -d $RPM_BUILD_ROOT/etc/init.d -a -n "`ls $RPM_BUILD_ROOT/etc/init.d/* 2> /dev/null`" ]; then
- test -z "$DONT_GPRINTIFY" && echo -n "Gprintifying init scripts..." && gprintify.py $RPM_BUILD_ROOT/etc/init.d/* && echo "done"
+
+if test -z "$DONT_GPRINTIFY"; then
+ scripts=
+ for f in `ls $RPM_BUILD_ROOT/etc/rc.d/init.d/* $RPM_BUILD_ROOT/etc/init.d/* 2> /dev/null`; do
+ test -f $f && grep -q '[[:space:]]*\.[[:space:]]+.*/functions' $f && scripts="$scripts $f"
+ done
+ if [ -n "$scripts" ]; then
+ echo -n "Gprintifying init scripts..." && gprintify.py $scripts && echo "done"
+ fi
fi
exit 0