git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: recent patch breaks the build ?

From
Junio C Hamano <junkio@cox.net>
Date
Nov 17, 2005, 10:33 UTC
Message-ID
<7voe4jy36p.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051117021014.GC3968@reactrix.com>
Nick Hengeveld <nickh@reactrix.com> writes:
> Assuming --vernum does work, is there a reasonable/portable way to
> compare two hex values like 070801?

I would assume that it is always 6 lowercase hexdigits %06x when supported, or showing nothing to stdout for ancient ones.

A horrible but probably portable way would be:
	case `(echo 070801; curl-config --vernum) 2>/dev/null |
        	sort -r | sed -ne 2p` in
	070801)
        	echo Happy ;;
        *)
        	echo Sad ;;
	esac
The obvious one is unfortunately not very portable:
	if test 070801 \< `curl-config --vernum`
        then
        	echo "Happy"
	else
        	echo "Sad"
	fi

This would work if your test is bash/dash-builtin. The following do not seem to know about '<' '>' string comparison:

	GNU /usr/bin/test from coreutils (version 5.2.1)
        OpenBSD shell builtin
        Solaris /usr/bin/test
Previous: Nick HengeveldNext: Johannes Schindelin
Message 11 of 15 in “recent patch breaks the build ?”
  1. Andrew WozniakNov 16, 2005
  2. Junio C HamanoNov 16, 2005
  3. Andrew WozniakNov 16, 2005
  4. Andreas EricssonNov 16, 2005
  5. Junio C HamanoNov 16, 2005
  6. Nick HengeveldNov 16, 2005
  7. Johannes SchindelinNov 16, 2005
  8. Nick HengeveldNov 17, 2005
  9. Junio C HamanoNov 17, 2005
  10. Nick HengeveldNov 17, 2005
  11. Junio C HamanoNov 17, 2005
  12. Johannes SchindelinNov 17, 2005
  13. Johannes SchindelinNov 17, 2005
  14. Nick HengeveldNov 17, 2005
  15. Johannes SchindelinNov 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.