Changes between Version 16 and Version 17 of Scripts/testport_script


Ignore:
Timestamp:
May 24, 2012, 11:52:04 AM (13 years ago)
Author:
kato23@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/testport_script

    v16 v17  
    2929# testport -r openal
    3030# testport -c openal configure.cc='/opt/macports-test/bin/clang-mp-3.1' configure.cxx='/opt/macports-test/bin/clang++-mp-3.1'
     31# testport -c -u -l /opt/macports-test-universal
    3132
    3233
     
    4546-r: remove / uninstall specified port and exit
    4647-s: build and install from source only
    47 -u: update MacPorts system and upgrade outdated ports (cleans work directories)
     48-u: update MacPorts system, upgrade outdated ports and exit (cleans work directories)
    4849-v: enable verbose mode
    4950-l dir: specify dir as location of MacPorts system (otherwise defaults to /opt/macports-test)
     
    236237
    237238
     239# make sure the current working directory exists
     240pwd -P 1>/dev/null || exit 1
     241
     242# prevent idle sleep
     243pmset -a force sleep 0 displaysleep 0 disksleep 0
     244
     245
     246sleep 1
     247unset usr_local_off opt_local_off tmpDir
     248usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
     249opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
     250
     251tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1
     252
     253declare -rx usr_local_off opt_local_off tmpDir
     254
     255trap on_exit EXIT TERM HUP INT QUIT
     256
     257dsclHome="$(dscl . -read /Users/macports NFSHomeDirectory | sed 's/^NFSHomeDirectory: *//')"
     258dscl . -change /Users/macports NFSHomeDirectory "${dsclHome}" "${MP_PREFIX}/var/macports/home"
     259
     260echo
     261
     262# make sure /usr/local is not interfering with MacPorts build processes for ${MP_PREFIX}
     263[[ -d '/usr/local' ]] && sudo mv -iv /usr/local "${usr_local_off}"
     264
     265# make sure /opt/local is not interfering with MacPorts build processes for ${MP_PREFIX}
     266[[ -d '/opt/local' ]] && sudo mv -iv /opt/local "${opt_local_off}"
     267
     268echo
     269
     270
    238271if [[ $# -eq 0 ]]; then
    239272   if [[ $clean_all -eq 1 ]] && [[ $update -eq 1 ]]; then
     
    256289
    257290
    258 # make sure the current working directory exists
    259 pwd -P 1>/dev/null || exit 1
    260 
    261 # prevent idle sleep
    262 pmset -a force sleep 0 displaysleep 0 disksleep 0
    263 
    264 
    265 sleep 1
    266 unset usr_local_off opt_local_off tmpDir
    267 usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
    268 opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
    269 
    270 tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1
    271 
    272 declare -rx usr_local_off opt_local_off tmpDir
    273 
    274 trap on_exit EXIT TERM HUP INT QUIT
    275 
    276 dsclHome="$(dscl . -read /Users/macports NFSHomeDirectory | sed 's/^NFSHomeDirectory: *//')"
    277 dscl . -change /Users/macports NFSHomeDirectory "${dsclHome}" "${MP_PREFIX}/var/macports/home"
    278 
    279 echo
    280 
    281 # make sure /usr/local is not interfering with MacPorts build processes for ${MP_PREFIX}
    282 [[ -d '/usr/local' ]] && sudo mv -iv /usr/local "${usr_local_off}"
    283 
    284 # make sure /opt/local is not interfering with MacPorts build processes for ${MP_PREFIX}
    285 [[ -d '/opt/local' ]] && sudo mv -iv /opt/local "${opt_local_off}"
    286 
    287 echo
    288 
    289 
    290291if [[ $all_new -eq 1 ]]; then
    291292
     
    334335      do_clean_all
    335336   elif [[ -d "$(port dir "$@")/work" ]]; then
    336       port -f clean --all "$@"
     337      #port -f -v clean --all "$@"
     338      port -f -v clean --work "$@"
    337339   fi
    338340fi
     
    341343if [[ $update -eq 1 ]]; then
    342344   do_update
     345   exit
    343346fi
    344347
     
    350353      port -f -v uninstall "$@"
    351354   elif [[ -d "$(port dir "$@")/work" ]]; then
    352       port -f clean --all "$@"
     355      printf '\n\n%s\n\n\n' "Removing: $(port dir "$@")/work"
     356      port -f -v clean --all "$@"
     357   else
     358      printf '\n\n%s\n\n\n' "Force uninstalling: $@"
     359      port -f -v clean --all "$@" || true
     360      port -f -v uninstall "$@" || true
    353361   fi
    354362   exit