From aca5784832b090e0220bb6677c0d85fda5c4b0df Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Sep 2017 23:58:57 +0300 Subject: Add scripts resetsrc.sh and resetsrcall.sh for reset local changes in packages sources. --- scripts/include/common.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'scripts/include/common.sh') 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}" -- cgit v1.2.3-70-g09d2