From f58339ad566233a2e1252dcf309480029f84ab48 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 26 Jul 2015 22:10:35 +0100 Subject: [PATCH] Work around curl -sS -I printing `HTTP/1.0 200 Connection established' before the actual header, so dgit works with https_proxy set (!) --- debian/changelog | 2 ++ dgit | 3 +++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4111fcdc..3a54ce5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,6 +47,8 @@ dgit (1.1~~) unstable; urgency=low but only does it if not disabled in config). * Set up git user.email and user.name from distro access config or DEBEMAIL/DEBFULLNAME. Closes:#793410. + * Work around curl -sS -I printing `HTTP/1.0 200 Connection established' + before the actual header, so dgit works with https_proxy set (!) -- diff --git a/dgit b/dgit index 867ba3c5..660c0c33 100755 --- a/dgit +++ b/dgit @@ -1157,6 +1157,9 @@ sub check_for_git () { my $url = "$prefix/$package$suffix"; my @cmd = (qw(curl -sS -I), $url); my $result = cmdoutput @cmd; + $result =~ s/^\S+ 200 .*\n\r?\n//; + # curl -sS -I with https_proxy prints + # HTTP/1.0 200 Connection established $result =~ m/^\S+ (404|200) /s or fail "unexpected results from git check query - ". Dumper($prefix, $result); -- 2.30.2