summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-12-24 18:30:53 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-12-24 18:30:53 +0100
commit4bacfc13949bc977fda8b4373906091a82a24f93 (patch)
treeca436c2f86cc8bf776a12a1e6371cd642cd9de5c
parent3722c509b43172f9d8bb90010e7a81307982c818 (diff)
bin/pkg: Added fix_origin
todo: - Don't break the pkg refresh progressbar - Better integration with vcs_push / vcs_pull
-rwxr-xr-xbin/pkg12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/pkg b/bin/pkg
index 97431b4..abc08a5 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -331,6 +331,14 @@ function exec_hook {
}
}
+# Set the correct origin
+function fix_origin {
+ if ! git remote | grep -F origin &> /dev/null; then
+ git remote add origin $PKG_ROOT/$1
+ fi
+ git remote update
+}
+
# Check dependencies, conflicts etc.
function check_prereqs {
package=$1
@@ -544,6 +552,7 @@ function pkg_add {
populate_collected $1
update_provides $1
list_update_package $1
+ fix_origin $1
}
function pkg_push {
@@ -564,6 +573,7 @@ function pkg_push {
checklinks $CL_OPTIONS
populate_collected $1
update_provides $1
+ fix_origin $1
}
}
@@ -608,6 +618,7 @@ function pkg_upgrade {
populate_collected $1
update_provides $1
list_update_package $1
+ fix_origin $1
fi
}
@@ -643,6 +654,7 @@ function pkg_refresh {
checklinks $CL_OPTIONS
check_prereqs $1
triggers+=$1
+ fix_origin $1
}
function pkg_update {