Thread (4 messages) 4 messages, 3 authors, 2016-06-15

Re: [PATCH 7/8] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

From: Brandon Casey <hidden>
Date: 2016-06-15 22:46:56

Possibly related (same subject, not in this thread)

Brandon Casey wrote:
I never received the referenced email.  I'll try to extract from gmane
and test.
This patch works for me.

-brandon

Jeff King wrote:
quoted
On Mon, Jun 08, 2009 at 09:41:49AM -0700, Junio C Hamano wrote:
quoted
We could further uglify the patch like this.
[...]
+git_broken_path_fix () {
+	case ":$PATH:" in
+	*:$1:*) : ok ;;
+	*)
+		PATH=$(
+			SANE_TOOL_PATH="$1"
+			IFS=: path= sep=
+			set x $PATH
+			shift
+			for elem
+			do
+				case "$SANE_TOOL_PATH:$elem" in
+				(?*:/bin | ?*:/usr/bin)
+					path="$path$sep$SANE_TOOL_PATH"
+					sep=:
+					SANE_TOOL_PATH=
+				esac
+				path="$path$sep$elem"
+				sep=:
+			done
+			echo "$path"
+		)
+		;;
+	esac
+}
Wow. That _is_ ugly, but it actually addresses exactly both my concern
and Brandon's. I kind of like it.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help