From 93ad64817afac1c3e014948e83d604f34db1e671 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 29 Jul 2014 22:22:20 +0100 Subject: move: Fix sanity check display. Also some cosmetic changes and fixes for the handling of the sanity check response. --- mga-move-pkg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mga-move-pkg b/mga-move-pkg index beaf99e..fd2d22c 100755 --- a/mga-move-pkg +++ b/mga-move-pkg @@ -102,7 +102,7 @@ fi # Safety check -if [ -n "$exactsrpm" -a -z "$noconfirm" -o 'release' = "$destinationsubsection" ]; then +if [ -z "$exactsrpm" -o -n "$noconfirm" ]; then echo "This SRPM (and matching binaries) will be moved from '$sourcesubsection' to '$destinationsubsection':" echo "- $srcpkg" echo @@ -112,12 +112,10 @@ if [ -n "$exactsrpm" -a -z "$noconfirm" -o 'release' = "$destinationsubsection" echo fi - read -p "Are you sure? [Y/n] " yn - [ -z "$yn" ] yn=y - case $yn in - [Yy]*) continue;; - *) exit;; - esac + read -n 1 -p "Are you sure? [Y/n] " yn + [ -n "$yn" ] && echo + [ -z "$yn" -o "Y" = "$yn" ] && yn=y + [ "y" != "$yn" ] && exit fi function movepkg() @@ -169,7 +167,9 @@ echo >> "$mailcontent" $dryrun mv -v -f "$distribdir/$release/SRPMS/$section/$sourcesubsection/$srcpkg" "$distribdir/$release/SRPMS/$section/$destinationsubsection/" >>"$mailcommands" 2>&1 if [ -n "$dryrun" ]; then - cat "$mailcontent" "$mailcommands" + echo + echo "Raw Commands:" + cat "$mailcommands" else if [ -z "$sync" ]; then echo >>"$mailcontent" -- cgit v1.2.1