From 04e2e85de859b37c6c81db6b9515518c860457b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aljaz=CC=8C=20=22g5pw=22=20Srebrnic=CC=8C?= Date: Wed, 19 Feb 2014 15:26:52 +0100 Subject: [PATCH] Use the -q flag when calling port The -q flag suppresses any output other than port names, eliminating the need to further modify output. --- src/_port | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/_port b/src/_port index 7ac5a6e..3a6eaf2 100644 --- a/src/_port +++ b/src/_port @@ -135,8 +135,14 @@ _port() { '-y[Perform a dry run.]' \ '-t[Enable trace mode debug facilities on platforms that support it (Mac OS X).]' \ "1:Port actions:(($actions))" \ - '*:extra:_port_dispatch' \ + '*:extra:->extra' \ && return 0 + + case "$state" in + extra) + _port_dispatch + ;; + esac } _port_dispatch() { @@ -219,16 +225,8 @@ _port_select() { } _port_caching_policy() { - local reg_time comp_time check_file - case "${1##*/}" in - PORT_INSTALLED_PACKAGES) - check_file=$port_prefix/var/macports/registry/registry.db - ;; - PORT_AVAILABLE_PACKAGES) - check_file=${$(port dir MacPorts)%/*/*}/PortIndex - ;; - esac - reg_time=$(stat -c '%Z' $check_file) + local reg_time comp_time + reg_time=$(stat -c '%Z' $port_prefix/var/macports/registry/registry.db) comp_time=$(stat -c '%Z' $1) return $(( reg_time < comp_time )) }