chiark / gitweb /
Work around curl -sS -I printing `HTTP/1.0 200 Connection established' before the...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2015 21:10:35 +0000 (22:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 27 Jul 2015 02:51:44 +0000 (03:51 +0100)
debian/changelog
dgit

index 4111fcdc8c20f4b6f309a89181427f72c603942a..3a54ce5da5410d643327903d85e33fbe3199f8d2 100644 (file)
@@ -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 867ba3c51e46b9ffa178506b46f4bc1c8a6dce7e..660c0c33aaab3071ba79b7dfc8567716aadd9687 100755 (executable)
--- 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);