summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/include/common.sh30
-rwxr-xr-xscripts/resetsrc.sh9
-rwxr-xr-xscripts/resetsrcall.sh5
3 files changed, 44 insertions, 0 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index 7b4b295..4431056 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -368,6 +368,19 @@ function common_update_source_all {
unset files
}
+function common_reset_source_all {
+ cd ../src/
+ check_error $?
+ files="*"
+ for package in $files
+ do
+ cd ../scripts/
+ ./resetsrc.sh $package
+ check_error $?
+ done
+ unset files
+}
+
function package_get_source {
echo "package_get_source"
run_clone "${SRCURL}"
@@ -393,6 +406,23 @@ function package_update_source {
fi
}
+function package_reset_source {
+ echo "package_reset_source"
+ cd "../src/${package}"
+ if [ -d .git ]; then
+ echo "git reset --hard HEAD"
+ git reset --hard HEAD
+ check_error $?
+ return
+ fi
+ if [ -d .hg ]; then
+ echo "hg update -C"
+ hg update -C
+ check_error $?
+ return
+ fi
+}
+
function common_clean_destination {
echo "clean ${bindir}"
rm -rf "${bindir}"
diff --git a/scripts/resetsrc.sh b/scripts/resetsrc.sh
new file mode 100755
index 0000000..05843c1
--- /dev/null
+++ b/scripts/resetsrc.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+export package=$1
+source ../scripts/include/common.sh
+
+common_package_init
+
+common_run_package
+package_reset_source
diff --git a/scripts/resetsrcall.sh b/scripts/resetsrcall.sh
new file mode 100755
index 0000000..7185785
--- /dev/null
+++ b/scripts/resetsrcall.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ../scripts/include/common.sh
+
+common_reset_source_all