[MacPorts] Scripts/testport_script modified

MacPorts noreply at macports.org
Thu May 24 04:52:04 PDT 2012


Changed page "Scripts/testport_script" by kato23 at mailinator.com from 84.163.55.22*
Page URL: <https://trac.macports.org/wiki/Scripts/testport_script>
Diff URL: <https://trac.macports.org/wiki/Scripts/testport_script?action=diff&version=17>
Revision 17

-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: Scripts/testport_script
=========================================================================
--- Scripts/testport_script (version: 16)
+++ Scripts/testport_script (version: 17)
@@ -28,6 +28,7 @@
 # testport -s clang-3.1
 # testport -r openal
 # testport -c openal configure.cc='/opt/macports-test/bin/clang-mp-3.1' configure.cxx='/opt/macports-test/bin/clang++-mp-3.1'
+# testport -c -u -l /opt/macports-test-universal
 
 
 show_usage() {
@@ -44,7 +45,7 @@
 -p: print PATH variable value
 -r: remove / uninstall specified port and exit
 -s: build and install from source only
--u: update MacPorts system and upgrade outdated ports (cleans work directories)
+-u: update MacPorts system, upgrade outdated ports and exit (cleans work directories)
 -v: enable verbose mode
 -l dir: specify dir as location of MacPorts system (otherwise defaults to /opt/macports-test)
 '
@@ -235,6 +236,38 @@
 fi
 
 
+# make sure the current working directory exists
+pwd -P 1>/dev/null || exit 1
+
+# prevent idle sleep
+pmset -a force sleep 0 displaysleep 0 disksleep 0
+
+
+sleep 1
+unset usr_local_off opt_local_off tmpDir
+usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
+opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
+
+tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1
+
+declare -rx usr_local_off opt_local_off tmpDir
+
+trap on_exit EXIT TERM HUP INT QUIT
+
+dsclHome="$(dscl . -read /Users/macports NFSHomeDirectory | sed 's/^NFSHomeDirectory: *//')"
+dscl . -change /Users/macports NFSHomeDirectory "${dsclHome}" "${MP_PREFIX}/var/macports/home"
+
+echo
+
+# make sure /usr/local is not interfering with MacPorts build processes for ${MP_PREFIX}
+[[ -d '/usr/local' ]] && sudo mv -iv /usr/local "${usr_local_off}"
+
+# make sure /opt/local is not interfering with MacPorts build processes for ${MP_PREFIX}
+[[ -d '/opt/local' ]] && sudo mv -iv /opt/local "${opt_local_off}"
+
+echo
+
+
 if [[ $# -eq 0 ]]; then
    if [[ $clean_all -eq 1 ]] && [[ $update -eq 1 ]]; then
       do_clean_all
@@ -255,38 +288,6 @@
 fi
 
 
-# make sure the current working directory exists
-pwd -P 1>/dev/null || exit 1
-
-# prevent idle sleep
-pmset -a force sleep 0 displaysleep 0 disksleep 0
-
-
-sleep 1
-unset usr_local_off opt_local_off tmpDir
-usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
-opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
-
-tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1
-
-declare -rx usr_local_off opt_local_off tmpDir
-
-trap on_exit EXIT TERM HUP INT QUIT
-
-dsclHome="$(dscl . -read /Users/macports NFSHomeDirectory | sed 's/^NFSHomeDirectory: *//')"
-dscl . -change /Users/macports NFSHomeDirectory "${dsclHome}" "${MP_PREFIX}/var/macports/home"
-
-echo
-
-# make sure /usr/local is not interfering with MacPorts build processes for ${MP_PREFIX}
-[[ -d '/usr/local' ]] && sudo mv -iv /usr/local "${usr_local_off}"
-
-# make sure /opt/local is not interfering with MacPorts build processes for ${MP_PREFIX}
-[[ -d '/opt/local' ]] && sudo mv -iv /opt/local "${opt_local_off}"
-
-echo
-
-
 if [[ $all_new -eq 1 ]]; then
 
    if [[ -x "${MP_PREFIX}/bin/port" ]]; then
@@ -333,13 +334,15 @@
    if [[ $clean_all -eq 1 ]]; then
       do_clean_all
    elif [[ -d "$(port dir "$@")/work" ]]; then
-      port -f clean --all "$@"
+      #port -f -v clean --all "$@"
+      port -f -v clean --work "$@"
    fi
 fi
 
 
 if [[ $update -eq 1 ]]; then
    do_update
+   exit
 fi
 
 
@@ -349,7 +352,12 @@
       port -f clean --all "$@"
       port -f -v uninstall "$@"
    elif [[ -d "$(port dir "$@")/work" ]]; then
-      port -f clean --all "$@"
+      printf '\n\n%s\n\n\n' "Removing: $(port dir "$@")/work"
+      port -f -v clean --all "$@"
+   else
+      printf '\n\n%s\n\n\n' "Force uninstalling: $@"
+      port -f -v clean --all "$@" || true
+      port -f -v uninstall "$@" || true
    fi
    exit
 fi

-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on Scripts/testport_script. If it was not you, please
report to .


More information about the macports-changes mailing list