pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/wrapper Added a small program to test a single tran...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5bac5c6fe707
branches:  trunk
changeset: 522442:5bac5c6fe707
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Dec 09 12:42:43 2006 +0000

description:
Added a small program to test a single transformation plug-in.

diffstat:

 mk/wrapper/test-transform.sh |  41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r 6c5aa6c6aee6 -r 5bac5c6fe707 mk/wrapper/test-transform.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/wrapper/test-transform.sh      Sat Dec 09 12:42:43 2006 +0000
@@ -0,0 +1,41 @@
+#! /bin/sh
+# $NetBSD: test-transform.sh,v 1.1 2006/12/09 12:42:43 rillig Exp $
+#
+# NAME
+#      test-transform - Test for a single-argument transformation plug-in
+#
+# SYNOPSIS
+#      test-transform.sh transform-file arg...
+#
+# DESCRIPTION
+#      test-transform builds up an environment like in the wrapper.sh
+#      script and feeds the remaining arguments to the transformation
+#      file.  It prints the result of the transformation on stdout,
+#      suitable for manual checking.
+#
+# EXAMPLES
+#      sh test-transform.sh transform-xlc-cc -E -Wall -dynamiclib
+#
+
+set -eu
+
+wrapperdir=`dirname "$0"`
+. "${wrapperdir}/../scripts/shell-lib"
+. "${wrapperdir}/wrapper-subr.sh"
+
+msg_log() {
+       shift
+       echo "[msg_log] $*"
+}
+
+debug_log="msg_log"
+wrapperlog="stderr"
+
+transformation_file="$1"; shift
+
+for arg in "$@"; do
+       split_arg=no
+       addtocache=no
+       . "./$transformation_file"
+       echo "=> arg=$arg, split_arg=$split_arg, addtocache=$addtocache"
+done



Home | Main Index | Thread Index | Old Index