Re: [PATCH] Makefile: Handle broken curl version number in version check

2015-01-30 Thread Junio C Hamano
"Tom G. Christensen"  writes:

> diff --git a/Makefile b/Makefile
> index c44eb3a..69a2ce3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1035,13 +1035,13 @@ else
>   REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
>   PROGRAM_OBJS += http-fetch.o
>   PROGRAMS += $(REMOTE_CURL_NAMES)
> - curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | 
> sort -r | sed -ne 2p)
> + curl_check := $(shell (echo 070908; curl-config --vernum | sed -e 
> '/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)
>   ifeq "$(curl_check)" "070908"
>   ifndef NO_EXPAT
>   PROGRAM_OBJS += http-push.o
>   endif
>   endif
> - curl_check := $(shell (echo 072200; curl-config --vernum) 2>/dev/null | 
> sort -r | sed -ne 2p)
> + curl_check := $(shell (echo 072200; curl-config --vernum | sed -e 
> '/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)
>   ifeq "$(curl_check)" "072200"
>   USE_CURL_FOR_IMAP_SEND = YesPlease
>   endif

Thanks, will apply but with sed part tweaked to '/^70[BC]/s/^/0/'
instead.

The existing tests that copied and pasted are bad enough.  Can we
consolidate them into some helper or a shorter idiom that lets us
more easily ask "Do we have cURL version X or higher?"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Makefile: Handle broken curl version number in version check

2015-01-30 Thread Kyle J. McKay

On Jan 30, 2015, at 06:50, Andreas Schwab wrote:


"Tom G. Christensen"  writes:


diff --git a/Makefile b/Makefile
index c44eb3a..69a2ce3 100644
--- a/Makefile
+++ b/Makefile
@@ -1035,13 +1035,13 @@ else
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
-	curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/ 
null | sort -r | sed -ne 2p)
+	curl_check := $(shell (echo 070908; curl-config --vernum | sed -e  
'/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)


How about 's/^.$/0&/' ?


Much nicer.  But that '$' will have to be escaped from make so it will  
need to be 's/^.$$/0&/'

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Makefile: Handle broken curl version number in version check

2015-01-30 Thread Tom G. Christensen

On 30/01/15 15:50, Andreas Schwab wrote:

"Tom G. Christensen"  writes:


diff --git a/Makefile b/Makefile
index c44eb3a..69a2ce3 100644
--- a/Makefile
+++ b/Makefile
@@ -1035,13 +1035,13 @@ else
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
-   curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | 
sort -r | sed -ne 2p)
+   curl_check := $(shell (echo 070908; curl-config --vernum | sed -e 
'/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)


How about 's/^.$/0&/' ?



I have no preference so whatever is the most likely to be accepted and 
does the job is fine with me.


-tgc
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Makefile: Handle broken curl version number in version check

2015-01-30 Thread Andreas Schwab
"Tom G. Christensen"  writes:

> diff --git a/Makefile b/Makefile
> index c44eb3a..69a2ce3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1035,13 +1035,13 @@ else
>   REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
>   PROGRAM_OBJS += http-fetch.o
>   PROGRAMS += $(REMOTE_CURL_NAMES)
> - curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | 
> sort -r | sed -ne 2p)
> + curl_check := $(shell (echo 070908; curl-config --vernum | sed -e 
> '/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)

How about 's/^.$/0&/' ?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Makefile: Handle broken curl version number in version check

2015-01-30 Thread Tom G. Christensen
curl 7.11.0 through 7.12.2 when built from their official release
archives will present a 5 digit version number instead of the documented
6 digits which breaks the version check in the Makefile.
Correct these broken version numbers on the fly when extracting them to
ensure the comparison works correctly.

Signed-off-by: Tom G. Christensen 
---

This was discoved while building on RHEL4 which has curl 7.12.1.
The makefile check for curl >= 7.34.0 failed and enabled
USE_CURL_FOR_IMAP_SEND.

# curl-config --vernum
70C01
# { echo 072200; curl-config --vernum 2>/dev/null ; } | sort -r | sed -ne 2p
072200
#

I checked the curl release tarballs and this problem seems to exist for
curl 7.11.0 (0x70B00) through 7.12.2 (0x70C02). In both 7.10.7 (0x070a07)
and 7.12.3 (0x070c03) the version is correctly set using 6 hex digits as
documented.
I tried to verify this using the official curl repo on github but it does
not seem to record this discrepancy and shows the correct 6 digit version
numbers for the affected releases.

 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c44eb3a..69a2ce3 100644
--- a/Makefile
+++ b/Makefile
@@ -1035,13 +1035,13 @@ else
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
-   curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | 
sort -r | sed -ne 2p)
+   curl_check := $(shell (echo 070908; curl-config --vernum | sed -e 
'/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "070908"
ifndef NO_EXPAT
PROGRAM_OBJS += http-push.o
endif
endif
-   curl_check := $(shell (echo 072200; curl-config --vernum) 2>/dev/null | 
sort -r | sed -ne 2p)
+   curl_check := $(shell (echo 072200; curl-config --vernum | sed -e 
'/^70[B-C]/ s/^7/07/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
USE_CURL_FOR_IMAP_SEND = YesPlease
endif
-- 
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html