diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-20 16:53:31 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-20 16:53:31 +0200 |
commit | be19b2565868a9d5c48bfa52ee6ba99a9ae494aa (patch) | |
tree | 559986fd3978b9166ef01f53b3318810d38ec4c9 | |
parent | f2bd9398dc450499817c80af1b878d5466277e42 (diff) |
pkg: Moved all direct package list access into the list_ functions
-rwxr-xr-x | bin/pkg | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -298,6 +298,14 @@ function list_exists { grep "^$1 " $PDIR/.list-remote &> /dev/null } +function list_packages_local { + cut -d ' ' -f 1 $PDIR/.list +} + +function list_packages_remote { + cut -d ' ' -f 1 $PDIR/.list-remote +} + function list_incoming { [[ $(list_local_version $1) != $(list_remote_version $1) ]] } @@ -634,7 +642,7 @@ function wrap { info "$1: " } cd $PDIR - [[ -n $progress ]] && all=$(wc -l < $PDIR/.list) + [[ -n $progress ]] && all=$(list_packages_local | wc -l) [[ -n $progress ]] && current=0 for i in *(-/); { (( current++ )) @@ -712,15 +720,15 @@ function pkg_list { typeset package crap case $1 in ''|local) - cut -d ' ' -f 1 $PDIR/.list + list_packages_local ;; all|remote) - cut -d ' ' -f 1 $PDIR/.list-remote + list_packages_remote ;; not-installed) - while read package crap; do + for package in $(list_packages_remote); { list_is_installed $package || echo $package - done < $PDIR/.list-remote + } ;; esac } |