Re: [PATCH 7/8] Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jun 8, 2009, 23:39 UTC
- Message-ID
- <fzqJj0x9YB8Uli2Fx2vePY55fbueEEY-IiruKI-uLEgS08KF5M8miw@cipher.nrlssc.navy.mil>
- In-Reply-To
- <20090608221117.GC29942@sigill.intra.peff.net>
I never received the referenced email. I'll try to extract from gmane and test.
-brandon
Jeff King wrote:
Show 34 quoted lines
> On Mon, Jun 08, 2009 at 09:41:49AM -0700, Junio C Hamano wrote:
>
>> 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