diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-24 17:45:03 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-24 17:45:03 +0200 |
commit | eb6eda9ccef4d42a37a86d5039d6a9e371aab4c2 (patch) | |
tree | 21f61a902fd3548fee48ecb2c4150873216ecfb6 /bin | |
parent | 5b15075a5b1e4240a3e4bc21bc9a52f2cfcfeb2b (diff) |
pkg: Removed unneccessary directory changes in the pkg_ functions
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -675,14 +675,12 @@ function pkg_add { check_valid $1 info "Retrieving package $1...\n" vcs_add $1 || return 255 - cd $1 || return 255 global_hook $1 post-add } function pkg_push { check_installed $1 check_valid $1 - cd $PDIR/$1 if list_incoming $1; then clear_line info "Pushing $1\n" @@ -694,10 +692,9 @@ function pkg_push { function pkg_remove { check_installed $1 - cd $PDIR/$1 - if [[ -r priority ]] { - if (( $(cat priority) > 3 )) { - confirm_no "Package '$1' is $(real_priority $(cat priority)). Really remove?" || return + if [[ -r $PDIR/$1/priority ]] { + if (( $(cat $PDIR/$1/priority) > 3 )) { + confirm_no "Package '$1' is $(real_priority $(cat $PDIR/$1/priority)). Really remove?" || return } } global_hook $1 pre-remove @@ -708,7 +705,6 @@ function pkg_remove { function pkg_upgrade { check_installed $1 check_valid $1 - cd $PDIR/$1 if [[ $(list_type $1) != $(list_type_local $1) ]] { clear_line warn "Incompatible systems. Please reinstall: $1\n" @@ -744,7 +740,6 @@ function pkg_list { function pkg_status { typeset vcs_status check_installed $1 - cd $PDIR/$1 vcs_status=$(PAGER='' vcs_status $1) if [[ -n $vcs_status && $(echo $vcs_status | tail -n 1) != 'nothing to commit (working directory clean)' ]] { clear_line @@ -755,12 +750,11 @@ function pkg_status { function pkg_refresh { check_installed $1 - cd $PDIR/$1 global_hook $1 pre-update - if [[ -r Makefile ]] { + if [[ -r $PDIR/$1/Makefile ]] { wrap_info $1 info "Cleaning build diroctery\n" - make clean + make -C $PDIR/$1 clean } global_hook $1 post-update } @@ -838,7 +832,6 @@ function pkg_info { function pkg_log { check_installed $1 - cd $PDIR/$1 vcs_log $1 } |