diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -25,7 +25,7 @@ check_installed () { } check_valid () { - [[ -d $PDIR/$1/.hg || -d $PDIR/$1/.git ]] || die "Not a valid package name: '$1'\n" + [[ -d $PDIR/$1/.git ]] || die "Not a valid package name: '$1'\n" } clear_line () { @@ -143,15 +143,11 @@ progress () { ## VCS Wrappers vcs_to_list () { - if [[ -d $1/.hg ]] { - echo -n "$1 hg " - hg -R $1 log | fgrep changeset | head -n 1 | cut -d ' ' -f 4 - } elif [[ -d $1/.git ]] { + if [[ -d $1/.git ]] { echo -n "$1 git " git --git-dir=$1/.git log | fgrep commit | head -n 1 | cut -d ' ' -f 2 } else { - echo -n "$i plain " >> .list - ls -ablR $i | md5sum | cut -d ' ' -f 1 >> .list + warn "Unsupported or no repository: $1\n" } } @@ -159,28 +155,24 @@ vcs_add () { cd $PDIR case $(list_type $1) in git) git clone "$PKG_ROOT/$1" ;; - hg) hg clone "$PKG_ROOT/$1" ;; - *) die "Cannot handle repository format '$1'\n" ;; + *) die "$1: Cannot handle repository format '$(list_type $1)'\n" ;; esac } vcs_log () { - [[ -d .hg ]] && {hg glog | less ; return} - [[ -d .git ]] && {git log ; return} + git log } vcs_upgrade () { - [[ -d .hg ]] && {hg pull --update $PKG_ROOT/$PWD:t; return} - [[ -d .git ]] && {git pull $PKG_ROOT/$PWD:t master ; return} + git pull $PKG_ROOT/${PWD:t} master } vcs_push () { - [[ -d .hg ]] && {hg push $PKG_ROOT/$PWD:t ; return} - [[ -d .git ]] && {git push $PKG_ROOT/$PWD:t master; return} + git push $PKG_ROOT/${PWD:t} master } vcs_status () { - $(list_type $1) status + git status } ## List stuff |