chiark / gitweb /
Work around curl -sS -I printing `HTTP/1.0 200 Connection established' before the...
[dgit.git] / dgit
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);