Rework the Original/Local selection code

Clean up the Original/Local selection code a
little, removing an useless loop and making
"Local" the default choice.
Thanks to "jsunx1" for raising the issue and
providing a partial implementation.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-01-23 16:12:26 +00:00
parent 15d6f98acf
commit f5af902be3

View file

@ -1925,33 +1925,29 @@ pick_slackbuild () {
SLACKBUILD="original" SLACKBUILD="original"
else else
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
while [ 0 ]; do dialog --title "Choose $PKG SlackBuild" --menu \
dialog --title "Choose $PKG SlackBuild" --menu \ "$(crunch "A local SlackBuild for $PKG was found in \
"$(crunch "A local SlackBuild for $PKG was found in \ addition to the original SlackBuild. Which one would \
addition to the original SlackBuild. Which one would \ you like to use?")" 10 60 2 \
you like to use?")" 10 60 2 \ "Local" "Use the local SlackBuild" \
"Original" "Use the original SlackBuild" \ "Original" "Use the original SlackBuild" 2> \
"Local" "Use the local SlackBuild" 2> \ $TMP/sbopkg_bld_selection
$TMP/sbopkg_bld_selection if [ $? != 0 ]; then
if [ $? = 1 ]; then # Need this to get back to $APP info menu
# Need this to get back to $APP info menu SLACKBUILD="cancel"
SLACKBUILD="cancel" rm -f $PKGPATH/$PKGNAME*.build
rm -f $PKGPATH/$PKGNAME*.build QUITBUILD=1
QUITBUILD=1 return 0
return 0 fi
fi B="$(cat $TMP/sbopkg_bld_selection)"
B="$(cat $TMP/sbopkg_bld_selection)" if [ "$B" = "Original" ]; then
if [ "$B" = "Original" ]; then SLACKBUILD="original"
SLACKBUILD="original" fi
break if [ "$B" = "Local" ]; then
fi SLACKBUILD="local"
if [ "$B" = "Local" ]; then fi
SLACKBUILD="local"
break
fi
done
else else
while true; do while :; do
crunch_fmt "A local SlackBuild for $PKGNAME was found in \ crunch_fmt "A local SlackBuild for $PKGNAME was found in \
addition to the original SlackBuild." addition to the original SlackBuild."
echo "Which one would you like to use?" echo "Which one would you like to use?"
@ -2023,30 +2019,27 @@ pick_info () {
DOTINFO="original" DOTINFO="original"
else else
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
while [ 0 ]; do dialog --title "Choose $PKG .info file" --menu \
dialog --title "Choose $PKG .info file" --menu \ "$(crunch "A local .info file for $PKG was found in \
"$(crunch "A local .info file for $PKG was found in \ addition to the original .info file. Which one would you \
addition to the original .info file. Which one would you \ like to use?")" 10 60 2 \
like to use?")" 10 60 2 \ "Local" "Use the local .info" \
"Original" "Use the original .info" \ "Original" "Use the original .info" \
"Local" "Use the local .info" 2>$TMP/sbopkg_info_selection 2>$TMP/sbopkg_info_selection
if [ $? != 0 ]; then if [ $? != 0 ]; then
rm -f $PKGPATH/$PKGNAME*.build rm -f $PKGPATH/$PKGNAME*.build
QUITBUILD=1 QUITBUILD=1
return 0 return 0
fi fi
I="$(cat $TMP/sbopkg_info_selection)" I="$(cat $TMP/sbopkg_info_selection)"
if [ "$I" = "Original" ]; then if [ "$I" = "Original" ]; then
DOTINFO="original" DOTINFO="original"
break fi
fi if [ "$I" = "Local" ]; then
if [ "$I" = "Local" ]; then DOTINFO="local"
DOTINFO="local" fi
break
fi
done
else else
while true; do while :; do
crunch_fmt "A local .info file for $PKG was found in \ crunch_fmt "A local .info file for $PKG was found in \
addition to the original .info file." addition to the original .info file."
echo "Which one would you like to use?" echo "Which one would you like to use?"