From 725ad53038e5de8f8ed679253f72a8cec0d0625c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 4 Oct 2008 16:27:56 +0200 Subject: [PATCH] Add another helper to replace default perl shebang path with the one pointing at PKGFS_MASTERDIR. --HG-- extra : convert_revision : d17d9634efe15636385b52e92f66434a89d1efae --- helper-templates/perl-replace-path.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 helper-templates/perl-replace-path.sh diff --git a/helper-templates/perl-replace-path.sh b/helper-templates/perl-replace-path.sh new file mode 100755 index 00000000000..aa3c6a332fb --- /dev/null +++ b/helper-templates/perl-replace-path.sh @@ -0,0 +1,18 @@ +# +# This helper transforms files with wrong perl path to the correct +# one pointing at PKGFS_MASTERDIR/bin/perl. +# + +perl_transform_file() +{ + local files="$@" + + [ -z "$files" ] && exit 1 + + for f in ${files}; do + [ ! -f $f ] && continue + $sed_cmd -e "s|^#!.*/usr/bin/perl|#!$PKGFS_MASTERDIR/bin/perl|" \ + $f > $f.in && $mv_cmd -f $f.in $f && \ + echo "=> Transformed $(basename $f) with correct path." + done +}