{"thread":{"id":"2599","subject":"[PATCH] Decide whether to build http-push in the Makefile","startedAt":"2005-11-19T01:08:36Z","lastAt":"2005-11-19T01:08:36Z","messageCount":1,"participants":["Nick Hengeveld"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"12305","messageId":"20051119010836.GL3968@reactrix.com","threadId":"2599","inReplyTo":null,"subject":"[PATCH] Decide whether to build http-push in the Makefile","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-19T01:08:36Z","receivedAt":"2005-11-19T01:08:36Z","isPatch":true,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"The decision about whether to build http-push or not belongs in the\nMakefile.  This follows Junio's suggestion to determine whether curl\nis new enough to support http-push.\n\nSigned-off-by: Nick Hengeveld <nickh@reactrix.com>\n\n\n---\n\nI should have thought this through better before I posted the HTTP\nrefactoring patch set.  Apologies.\n\nI've confirmed that http-push will not build unless\n- curl-config is executable from the current PATH\n- the --vernum flag is a valid option\n- --vernum returns a value at least as recent as 070908\n\n\n Makefile    |    9 ++++++---\n http-push.c |    9 ---------\n 2 files changed, 6 insertions(+), 12 deletions(-)\n\napplies-to: 769e3c5498df32db6fc5ee764cd999608c6f1d9a\n6d56bf9f18c029e15fcfd59fdd65f652961913af\ndiff --git a/Makefile b/Makefile\nindex 285b3ed..0efb0b6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -242,9 +242,12 @@ ifndef NO_CURL\n \t\tCURL_LIBCURL = -lcurl\n \tendif\n \tPROGRAMS += git-http-fetch$X\n-\tifndef NO_EXPAT\n-\t\tEXPAT_LIBEXPAT = -lexpat\n-\t\tPROGRAMS += git-http-push$X\n+\tcurl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)\n+\tifeq \"$(curl_check)\" \"070908\"\n+\t\tifndef NO_EXPAT\n+\t\t\tEXPAT_LIBEXPAT = -lexpat\n+\t\t\tPROGRAMS += git-http-push$X\n+\t\tendif\n \tendif\n endif\n \ndiff --git a/http-push.c b/http-push.c\nindex f3c92c9..76c7886 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -6,8 +6,6 @@\n #include \"blob.h\"\n #include \"http.h\"\n \n-#ifdef USE_CURL_MULTI\n-\n #include <expat.h>\n \n static const char http_push_usage[] =\n@@ -1426,10 +1424,3 @@ int main(int argc, char **argv)\n \n \treturn rc;\n }\n-#else /* ifdef USE_CURL_MULTI */\n-int main(int argc, char **argv)\n-{\n-\tfprintf(stderr, \"http-push requires curl 7.9.8 or higher.\\n\");\n-\treturn 1;\n-}\n-#endif\n---\n0.99.9.GIT\n"}]}