[MacPorts] Scripts/testport_script modified
MacPorts
noreply at macports.org
Tue Apr 24 03:40:27 PDT 2012
Changed page "Scripts/testport_script" by kato23 at mailinator.com from 84.163.37.219*
Page URL: <https://trac.macports.org/wiki/Scripts/testport_script>
Diff URL: <https://trac.macports.org/wiki/Scripts/testport_script?action=diff&version=7>
Revision 7
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: Scripts/testport_script
=========================================================================
--- Scripts/testport_script (version: 6)
+++ Scripts/testport_script (version: 7)
@@ -190,13 +190,13 @@
if [[ $# -eq 0 ]]; then
if [[ $clean_all -eq 1 ]]; then
- ( port -f clean --all installed 2>/dev/null ) || true
+ [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
exit
elif [[ $update -eq 1 ]]; then
- port -f clean --all installed
+ [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
port selfupdate
port outdated
- ( port upgrade -R -u outdated 2>/dev/null ) || true
+ [[ $(port outdated | wc -l) -gt 1 ]] && port upgrade -R -u outdated
exit
else
echo
@@ -250,9 +250,9 @@
# clean up previous "${MP_PREFIX}" directory
if [[ -x "${MP_PREFIX}/bin/port" ]]; then
if [[ $clean_all -eq 1 ]]; then
- ( port -f clean --all installed 2>/dev/null ) || true
+ [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
else
- ( port -f clean --work "$@" 2>/dev/null ) || true
+ [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f clean --work "$@"
fi
fi
@@ -260,7 +260,7 @@
if [[ $all_new -eq 1 ]]; then
if [[ -x "${MP_PREFIX}/bin/port" ]]; then
- ( port -f uninstall installed 2>/dev/null ) || true
+ [[ $(port installed | wc -l) -gt 1 ]] && port -f uninstall installed
fi
# since "rm -rf" is a dangerous command, we restrict its use to /opt/somedir
@@ -300,13 +300,13 @@
port -f clean --all installed
port selfupdate
port outdated
- ( port upgrade -R -u outdated 2>/dev/null ) || true
+ [[ $(port outdated | wc -l) -gt 1 ]] && port upgrade -R -u outdated
fi
if [[ $remove -eq 1 ]]; then
- port -f clean --all "$@"
- port -f -v uninstall "$@"
+ [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f clean --all "$@"
+ [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f -v uninstall "$@"
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