summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-07-29 22:22:20 +0100
committerColin Guthrie <colin@mageia.org>2014-07-29 22:22:20 +0100
commit93ad64817afac1c3e014948e83d604f34db1e671 (patch)
tree25d272ba6132197ebb300a4d36ed25ff92fcd8cd
parent67cd8e961a48ec2201a56bcfb31a6a7cc9d50b89 (diff)
downloadmgatools-user/colin/improvements.tar
mgatools-user/colin/improvements.tar.gz
mgatools-user/colin/improvements.tar.bz2
mgatools-user/colin/improvements.tar.xz
mgatools-user/colin/improvements.zip
move: Fix sanity check display.user/colin/improvements
Also some cosmetic changes and fixes for the handling of the sanity check response.
-rwxr-xr-xmga-move-pkg16
1 files 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"