aboutsummaryrefslogtreecommitdiffstats
path: root/src/_port
diff options
context:
space:
mode:
authorAljaž "g5pw" Srebrnič <a2piratesoft@gmail.com>2014-02-19 15:26:52 +0100
committerAljaž "g5pw" Srebrnič <a2piratesoft@gmail.com>2014-06-26 17:58:00 +0200
commit04e2e85de859b37c6c81db6b9515518c860457b8 (patch)
tree5f29523f2b7bf0a05c52c79d77af250c3770e9d5 /src/_port
parentNo need to set cache policy in the main function (diff)
downloadzsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar.gz
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar.bz2
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar.lz
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar.xz
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.tar.zst
zsh-completions-04e2e85de859b37c6c81db6b9515518c860457b8.zip
Use the -q flag when calling port
The -q flag suppresses any output other than port names, eliminating the need to further modify output.
Diffstat (limited to 'src/_port')
-rw-r--r--src/_port20
1 files 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 ))
}