summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:44:50 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:44:50 +0200
commitd79ed915438d57432a715f7df3a9b9e94533aee6 (patch)
tree00e69ba9523c3a9536e90c00d65c6ccbfd3565fb /bin/pkg
parent6dda4ac1a71364e532c280233a0a49c87abcf179 (diff)
bin/pkg: Added 'status' to show whether a package contains local modifications or has unmet dependencies
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index be0b347..4d81198 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -4,6 +4,7 @@ PKG_ROOT="ssh://derf.homelinux.org/packages"
VCS_CMD="hg"
VCS_OPTIONS="--quiet"
VCS_ADD="clone"
+VCS_STATUS="status"
VCS_UPDATE="pull"
VCS_UPDATE_OPTIONS="--update"
CL_OPTIONS="-q"
@@ -68,7 +69,6 @@ pkg_remove () {
pkg_update () {
cd $PDIR/$1
echo_status "Updating package $1"
- check_deps $1
$VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS
checklinks $CL_OPTIONS
if [ -f hooks/post-update ]; then
@@ -102,10 +102,29 @@ pkg_list_installed () {
=ls -1 $PDIR
}
+pkg_status () {
+ cd $PDIR/$1
+ echo_status "Checking $1 status..."
+ check_deps $1
+ $VCS_CMD $VCS_STATUS
+}
+
+pkg_status_wrapper () {
+ if [ -n "$1" ]; then
+ pkg_status "$1"
+ else
+ cd $PDIR
+ for i in *(/); {
+ pkg_status "$i"
+ }
+ fi
+}
+
case "$1" in
add) pkg_add "$2" ;;
changeroot) pkg_changesrc "$2" ;;
list) pkg_list_installed ;;
remove) pkg_remove "$2" ;;
+ status) pkg_status_wrapper "$2" ;;
update) pkg_update_wrapper "$2" ;;
esac