From 4c8c712ed656f20870d0363aae4cf4d46fa7c67a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 1 Jul 2008 22:48:31 +0200 Subject: bin/pkg: Groupd lst_ / vcs_ functions together --- bin/pkg | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/bin/pkg b/bin/pkg index 24e6a78..9224e6e 100755 --- a/bin/pkg +++ b/bin/pkg @@ -114,12 +114,8 @@ confirm_no () { ## ## Major internal functions ## -## Naming: -## vcs_ do something by accessing the package -## lst_ do something by accessing the list ## VCS Wrappers - vcs_to_lst () { if [[ -d $1/.hg ]] { echo -n "$1 hg " @@ -139,15 +135,21 @@ vcs_add () { esac } -lst_incoming () { - [ "$(lst_local_version $1)" != "$(lst_remote_version $1)" ] -} - vcs_log () { [[ -d .hg ]] && {hg glog | less ; return} [[ -d .git ]] && {git log ; return} } +vcs_upgrade () { + [[ -d .hg ]] && {hg pull --update ; return} + [[ -d .git ]] && {git pull ; return} +} + +## List stuff +lst_incoming () { + [ "$(lst_local_version $1)" != "$(lst_remote_version $1)" ] +} + lst_type () { grep ^"$1 " $PDIR/.list-remote | cut -d ' ' -f 2 } @@ -181,11 +183,6 @@ lst_remove_package () { echo $LIST > .list } -vcs_upgrade () { - [[ -d .hg ]] && {hg pull --update ; return} - [[ -d .git ]] && {git pull ; return} -} - lst_local_version () { grep ^"$1 " $PDIR/.list | cut -d ' ' -f 3 } -- cgit v1.2.3