[39796] contrib/select/select.sh

raimue at macports.org raimue at macports.org
Thu Sep 4 17:45:52 PDT 2008


Revision: 39796
          http://trac.macports.org/changeset/39796
Author:   raimue at macports.org
Date:     2008-09-04 17:45:51 -0700 (Thu, 04 Sep 2008)
Log Message:
-----------
contrib/select/select.sh:
Add new -d switch to enable debug output (set -x)

Modified Paths:
--------------
    contrib/select/select.sh

Modified: contrib/select/select.sh
===================================================================
--- contrib/select/select.sh	2008-09-05 00:21:04 UTC (rev 39795)
+++ contrib/select/select.sh	2008-09-05 00:45:51 UTC (rev 39796)
@@ -42,6 +42,8 @@
 ## GLOBALS
 # dont actually execute, just show what would have been done
 noexec=0
+# enable debug mode
+debug=0
 # enforce action
 force=0
 # skip check for required rights
@@ -54,9 +56,10 @@
 # print the usage of this tool
 usage() {
 	cat <<EOD
-usage: ${TOOL} [-n] [-f] [-r] [-h] [-v] version
+usage: ${TOOL} [-n] [-d] [-f] [-r] [-h] [-v] version
 
 -n        Show commands to do selection but do not execute them.
+-d        Show debug messages during execution
 -f        Ensure the links are correct for the specified version
           even if it maches the current default version.
 -h        Display this help info.
@@ -143,7 +146,7 @@
 fi
 
 # parse command line args
-args=$(/usr/bin/getopt i:fhnlrv $*)
+args=$(/usr/bin/getopt i:fhndlrv $*)
 set -- ${args}
 for i; do
 	case "${i}" in
@@ -153,6 +156,8 @@
 			noexec=1; shift;;
 		-f)
 			force=1; shift;;
+		-d)
+			debug=1; shift;;
 		-l)
 			list_version; exit 0;;
 		-r)
@@ -166,6 +171,11 @@
 	esac
 done
 
+# enable debug output if requested
+if [ "1" = "${debug}" ]; then
+    set -x
+fi
+
 # install mode - bypass all checks and add DESTDIR
 if [ "1" = "${inst_mode}" ]; then
 	echo "install mode: destroot: \"${DESTDIR}\""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080904/af2ca932/attachment.html 


More information about the macports-changes mailing list