public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: bin/
Date: Mon, 17 Oct 2016 17:39:35 +0000 (UTC)	[thread overview]
Message-ID: <1476725889.b5e71f6f2ed3483422df611fc2450081c72332ac.fuzzyray@gentoo> (raw)

commit:     b5e71f6f2ed3483422df611fc2450081c72332ac
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 17:38:09 2016 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 17:38:09 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=b5e71f6f

eread: Fix bash error when the elog directory is empty

This fixes the following error from bash which causes an infinite loop.

/usr/bin/eread: line 64: break: only meaningful in a `for', `while', or
`until' loop

X-Gentoo-bug: 597132
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=597132

 bin/eread | 124 +++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 62 insertions(+), 62 deletions(-)

diff --git a/bin/eread b/bin/eread
index fe095a6..2289f2d 100755
--- a/bin/eread
+++ b/bin/eread
@@ -57,72 +57,72 @@ find_files() {
 }
 
 select_loop() {
-	ANY_FILES=$(find_files)
-
-	if [[ -z ${ANY_FILES} ]]; then
-		echo "No log items to read"
-		break
-	fi
-
-	echo
-	echo "This is a list of portage log items. Choose a number to view that file or type q to quit."
-	echo
-
-	# Pick which file to read
-	select FILE in ${ANY_FILES}; do
-		case ${REPLY} in
-			q)
-				echo "Quitting"
-				QUIT="yes"
-				break
-				;;
-			a)
-				SORT="alphabet"
-				;;
-			t)
-				SORT="time"
-				;;
-			*)
-				if [ -f "$FILE" ]; then
-					${PAGER} ${FILE}
-					read -p "Delete file? [y/N] " DELETE
-					case ${DELETE} in
-						q)
-							echo "Quitting"
-							QUIT="yes"
-							break
-							;;
-						y|Y)
-							rm -f ${FILE}
-							SUCCESS=$?
-							if [[ ${SUCCESS} = 0 ]]; then
-								echo "Deleted ${FILE}"
-							else
-								echo "Unable to delete ${FILE}"
-							fi
-							;;
-						# Empty string defaults to N (save file)
-						n|N|"")
-							echo "Saving ${FILE}"
-							;;
-						*)
-							echo "Invalid response. Saving ${FILE}"
-							;;
-					esac
-				else
-					echo
-					echo "Invalid response."
-				fi
-				;;
-		esac
-		break
+	until [[ -n ${QUIT} ]]; do
+		ANY_FILES=$(find_files)
+
+		if [[ -z ${ANY_FILES} ]]; then
+			echo "No log items to read"
+			break
+		fi
+
+		echo
+		echo "This is a list of portage log items. Choose a number to view that file or type q to quit."
+		echo
+
+		# Pick which file to read
+		select FILE in ${ANY_FILES}; do
+			case ${REPLY} in
+				q)
+					echo "Quitting"
+					QUIT="yes"
+					break
+					;;
+				a)
+					SORT="alphabet"
+					;;
+				t)
+					SORT="time"
+					;;
+				*)
+					if [ -f "$FILE" ]; then
+						${PAGER} ${FILE}
+						read -p "Delete file? [y/N] " DELETE
+						case ${DELETE} in
+							q)
+								echo "Quitting"
+								QUIT="yes"
+								break
+								;;
+							y|Y)
+								rm -f ${FILE}
+								SUCCESS=$?
+								if [[ ${SUCCESS} = 0 ]]; then
+									echo "Deleted ${FILE}"
+								else
+									echo "Unable to delete ${FILE}"
+								fi
+								;;
+							# Empty string defaults to N (save file)
+							n|N|"")
+								echo "Saving ${FILE}"
+								;;
+							*)
+								echo "Invalid response. Saving ${FILE}"
+								;;
+						esac
+					else
+						echo
+						echo "Invalid response."
+					fi
+					;;
+			esac
+			break
+		done
 	done
 }
 
 pushd ${ELOGDIR} > /dev/null
 
-until [[ -n ${QUIT} ]]; do
-	select_loop
-done
+select_loop
 
 popd > /dev/null


             reply	other threads:[~2016-10-17 17:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 17:39 Paul Varner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-24 18:05 [gentoo-commits] proj/gentoolkit:master commit in: bin/ Matt Turner
2024-06-24 18:05 Matt Turner
2024-06-24 18:05 Matt Turner
2024-05-25  3:45 Matt Turner
2024-05-25  3:45 Matt Turner
2024-05-25  3:45 Matt Turner
2023-08-29 15:48 Mike Gilbert
2023-08-29  1:38 Sam James
2023-08-29  0:51 Sam James
2022-12-03 13:54 Michał Górny
2022-12-03 13:54 Michał Górny
2022-07-28 15:29 Brian Dolbec
2022-07-09 19:50 Brian Dolbec
2022-05-19  4:30 Sam James
2021-03-12  2:31 Matt Turner
2021-02-25  0:06 Matt Turner
2020-12-31 22:11 Matt Turner
2020-03-16 14:24 Ben Kohler
2016-06-06 21:15 Paul Varner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476725889.b5e71f6f2ed3483422df611fc2450081c72332ac.fuzzyray@gentoo \
    --to=fuzzyray@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox