diff options
author | Srikant Patnaik | 2015-02-18 23:36:08 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-02-18 23:36:08 +0530 |
commit | 571e4efe0971ad182c765a2940fac061835a858c (patch) | |
tree | f5a7930f0626c10a52ff589d58541684a96490a4 | |
parent | 9f1d9c9d0fff5ad28d7b4c5c8b4540b87a093e1d (diff) | |
download | FOSSEE-netbook-tools-571e4efe0971ad182c765a2940fac061835a858c.tar.gz FOSSEE-netbook-tools-571e4efe0971ad182c765a2940fac061835a858c.tar.bz2 FOSSEE-netbook-tools-571e4efe0971ad182c765a2940fac061835a858c.zip |
execute clean_up function while user select cancel in dialog
-rwxr-xr-x | patcher.sh | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -111,7 +111,7 @@ function list_updates() { function check_past_updates() { # If no new/old update available, just quit (Ignoring HEAD based tags to avoid confusion) no_updates=$(cat $all_commits_dates_with_file_paths | sed '/HEAD/d' | wc -c) - [ $no_updates -eq 0 ] && alert_message -w 400 -h 250 "No available updates !!!" && exit 0 + [ $no_updates -eq 0 ] && alert_message -w 400 -h 250 "No available updates !!!" && clean_up && exit 0 # Look for previously applied updates(git tags) for hash in $(cat unique_tags/*); do @@ -127,7 +127,7 @@ function select_updates() { # Show updates using 'menu' of 'easybashgui' selected_update=$(menu -w 900 -h 550 "$(cat $all_commits_dates_with_file_paths | sed '/HEAD/d' | \ cut -d ';' -f 1,2,3,4,5| tr ';' ' ' )" 2>&1) - [ $? -eq 1 ] && exit 0 + [ $? -eq 1 ] && clean_up && exit 0 #get hash for selected_update selected_hash=$(echo $selected_update | grep -o \([0-9a-z]*\) | tr -d '(|)') selected_tag=$(echo $selected_update | grep -o \(tag:\ [A-Za-z0-9._-]*\) | sed 's/(tag:\ //' |sed 's/)//') @@ -193,7 +193,7 @@ fi function apply_updates() { question -w 400 -h 150 "Do you want to apply the selected update? This will affect the following file(s): '/$files_in_selected_hash'" 2>&1 - [ $? -eq 1 ] && exit 0 + [ $? -eq 1 ] && clean_up && exit 0 for each_file in $(echo $files_in_selected_hash | tr ',' '\n'); do echo "##### applying updates #####">>$logfile @@ -201,8 +201,8 @@ function apply_updates() { mv -v $local_updates/$each_file /$each_file>>$logfile done question -w 400 -h 150 "Update done. Select 'Yes' to revisit update selection menu. Select 'Cancel' to 'Quit' this program" - [ $? -eq 1 ] && exit 0 - call_functions + [ $? -eq 1 ] && clean_up && exit 0 + main } |