mirror of
https://github.com/sbopkg/sbopkg
synced 2025-01-28 19:58:22 +01:00
commit another little patch from slakmagik (return_of_the_qfm); thanks to slakmagik for the patch
This commit is contained in:
parent
f149581c51
commit
18bf6405f2
1 changed files with 11 additions and 9 deletions
|
@ -388,7 +388,7 @@ function read_nonblock () {
|
||||||
|
|
||||||
function progressbar_interrupted () {
|
function progressbar_interrupted () {
|
||||||
# This function checks whether the user pressed ESC
|
# This function checks whether the user pressed ESC
|
||||||
local ESC="" KEY
|
local ESC=$'\033' KEY
|
||||||
|
|
||||||
read_nonblock KEY
|
read_nonblock KEY
|
||||||
[[ "$KEY" = "$ESC" ]]
|
[[ "$KEY" = "$ESC" ]]
|
||||||
|
@ -1181,6 +1181,7 @@ validate_queue_name() {
|
||||||
rename_user_queue() {
|
rename_user_queue() {
|
||||||
# this function renames queues
|
# this function renames queues
|
||||||
local QRN=$TMP/sbopkg-queue-rename
|
local QRN=$TMP/sbopkg-queue-rename
|
||||||
|
local NEWNAME
|
||||||
|
|
||||||
queue_dir_lister "Rename Queue" "$(crunch "Select the queue(s) you \
|
queue_dir_lister "Rename Queue" "$(crunch "Select the queue(s) you \
|
||||||
wish to rename and choose <OK> or choose <Back> to \
|
wish to rename and choose <OK> or choose <Back> to \
|
||||||
|
@ -1196,18 +1197,21 @@ rename_user_queue() {
|
||||||
while :; do
|
while :; do
|
||||||
dialog --title "Rename Queue" \
|
dialog --title "Rename Queue" \
|
||||||
--inputbox "Enter the new filename for ${USERQUEUE[$i]}" \
|
--inputbox "Enter the new filename for ${USERQUEUE[$i]}" \
|
||||||
0 0 2>$QRN
|
0 0 $NEWNAME 2>$QRN
|
||||||
|
NEWNAME="$(cat $QRN)"
|
||||||
if [[ $? = 0 ]]; then
|
if [[ $? = 0 ]]; then
|
||||||
if ! validate_queue_name $QRN; then
|
if ! validate_queue_name $QRN; then
|
||||||
continue
|
continue
|
||||||
elif [ -e "$QUEUEDIR/$(cat $QRN)" ]; then
|
elif [ -f "$QUEUEDIR/$NEWNAME" ]; then
|
||||||
dialog --title "ERROR" --msgbox "$(crunch "File \
|
dialog --title "ERROR" --msgbox "$(crunch "File \
|
||||||
exists. Please choose another name.")" 0 0
|
exists. Please choose another name.")" 0 0
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
mv "$FILE" "$QUEUEDIR/$(cat $QRN)"
|
mv "$FILE" "$QUEUEDIR/$NEWNAME"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
continue 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# I've already forgotten why this is here, but it was important
|
# I've already forgotten why this is here, but it was important
|
||||||
|
@ -1260,7 +1264,7 @@ save_user_queue () {
|
||||||
if [[ ! -s $TMP/sbopkg-user-queue ]]; then
|
if [[ ! -s $TMP/sbopkg-user-queue ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
USERQUEUE="$QUEUEDIR/$(cat $TMP/sbopkg-user-queue)"
|
USERQUEUE="$(cat $TMP/sbopkg-user-queue)"
|
||||||
DEFAULT="${USERQUEUE##*/}"
|
DEFAULT="${USERQUEUE##*/}"
|
||||||
if ! validate_queue_name $TMP/sbopkg-user-queue; then
|
if ! validate_queue_name $TMP/sbopkg-user-queue; then
|
||||||
continue
|
continue
|
||||||
|
@ -1274,7 +1278,7 @@ save_user_queue () {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
cp $TMPQUEUE $USERQUEUE ||
|
cp $TMPQUEUE $QUEUEDIR/$USERQUEUE ||
|
||||||
dialog --title "ERROR" --msgbox "Problem saving build queue."\
|
dialog --title "ERROR" --msgbox "Problem saving build queue."\
|
||||||
8 30
|
8 30
|
||||||
fi
|
fi
|
||||||
|
@ -2756,9 +2760,7 @@ control_c () {
|
||||||
done;
|
done;
|
||||||
rm -f $TMP/sbopkgpidlist
|
rm -f $TMP/sbopkgpidlist
|
||||||
fi
|
fi
|
||||||
if [ "$DIAG" = 1 ]; then
|
if [ "$DIAG" != 1 ]; then
|
||||||
break
|
|
||||||
else
|
|
||||||
cleanup
|
cleanup
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue