summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-20 18:27:49 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-20 18:27:49 +0200
commit463c3aff0fa586aa5ff203af8b76d8a05148840d (patch)
tree794ef5a730e40b42990ca695ab1bce67645ea557 /bin
parent83b3e0b7824f37a4e0f08815918594e1cd92c8a9 (diff)
bin/pkg: Check whether a package is tracked in the same VCS local and remote
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/pkg b/bin/pkg
index ed52e78..4f2cb40 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -203,6 +203,10 @@ list_type () {
grep ^"$1 " $PDIR/.list-remote | cut -d ' ' -f 2
}
+list_type_local () {
+ grep ^"$1 " $PDIR/.list | cut -d ' ' -f 2
+}
+
list_update_remote () {
if [[ "$PKG_PROTO" = 'ssh' ]] {
scp -q $PKG_HOST:$(echo $PKG_ROOT | cut -d / -f 4- | sed 's!~/!!')/.list .list-remote
@@ -465,8 +469,12 @@ pkg_upgrade () {
check_installed $1
check_valid $1
cd $PDIR/$1
- list_incoming $1
- if [[ $? = 0 ]] {
+ if [[ $(list_type $1) != $(list_type_local $1) ]] {
+ clear_line
+ warn "Incompatible systems. Please reinstall: $1\n"
+ return 9
+ }
+ if {list_incoming $1} {
clear_line
info "Updating $1 to $(list_remote_version $1)\n"
vcs_upgrade