| 239 | # make sure the current working directory exists |
| 240 | pwd -P 1>/dev/null || exit 1 |
| 241 | |
| 242 | # prevent idle sleep |
| 243 | pmset -a force sleep 0 displaysleep 0 disksleep 0 |
| 244 | |
| 245 | |
| 246 | sleep 1 |
| 247 | unset usr_local_off opt_local_off tmpDir |
| 248 | usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')" |
| 249 | opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')" |
| 250 | |
| 251 | tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1 |
| 252 | |
| 253 | declare -rx usr_local_off opt_local_off tmpDir |
| 254 | |
| 255 | trap on_exit EXIT TERM HUP INT QUIT |
| 256 | |
| 257 | dsclHome="$(dscl . -read /Users/macports NFSHomeDirectory | sed 's/^NFSHomeDirectory: *//')" |
| 258 | dscl . -change /Users/macports NFSHomeDirectory "${dsclHome}" "${MP_PREFIX}/var/macports/home" |
| 259 | |
| 260 | echo |
| 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 | |
| 268 | echo |
| 269 | |
| 270 | |
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 | | |