{"thread":{"id":"26056","subject":"[PATCH 04/14] lib-git-svn.sh: Add check for missing mod_dav_svn module","startedAt":"2010-12-14T18:23:54Z","lastAt":"2010-12-16T20:00:00Z","messageCount":3,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"158068","messageId":"4D07B63A.2020501@ramsay1.demon.co.uk","threadId":"26056","inReplyTo":null,"subject":"[PATCH 04/14] lib-git-svn.sh: Add check for missing mod_dav_svn module","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-14T18:23:54Z","receivedAt":"2010-12-14T18:23:54Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n t/lib-git-svn.sh |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 919d45a..154f3d3 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -101,6 +101,11 @@ start_httpd () {\n \t\techo >&2 'SVN_HTTPD_PORT is not defined!'\n \t\treturn\n \tfi\n+\tif test ! -e \"$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\"\n+\tthen\n+\t\techo >&2 'Apache module \"mod_dav_svn.so\" not found'\n+\t\treturn 1\n+\tfi\n \tif test -z \"$repo_base_path\"\n \tthen\n \t\trepo_base_path=svn\n@@ -128,6 +133,7 @@ EOF\n \n stop_httpd () {\n \ttest -z \"$SVN_HTTPD_PORT\" && return\n+\ttest ! -e \"$GIT_DIR/httpd.conf\" && return\n \t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k stop\n }\n \n-- \n1.7.3\n"},{"id":"158080","messageId":"7v8vzsuq48.fsf@alter.siamese.dyndns.org","threadId":"26056","inReplyTo":"4D07B63A.2020501@ramsay1.demon.co.uk","subject":"Re: [PATCH 04/14] lib-git-svn.sh: Add check for missing mod_dav_svn module","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-14T19:11:03Z","receivedAt":"2010-12-14T19:11:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>  t/lib-git-svn.sh |    6 ++++++\n>  1 files changed, 6 insertions(+), 0 deletions(-)\n>\n> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\n> index 919d45a..154f3d3 100644\n> --- a/t/lib-git-svn.sh\n> +++ b/t/lib-git-svn.sh\n> @@ -101,6 +101,11 @@ start_httpd () {\n>  \t\techo >&2 'SVN_HTTPD_PORT is not defined!'\n>  \t\treturn\n>  \tfi\n> +\tif test ! -e \"$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\"\n> +\tthen\n> +\t\techo >&2 'Apache module \"mod_dav_svn.so\" not found'\n> +\t\treturn 1\n> +\tfi\n\nOthers seem to check with \"test -f\" for things like this.\nAlso why \"return 1\" only on this codepath?\n\n>  \tif test -z \"$repo_base_path\"\n>  \tthen\n>  \t\trepo_base_path=svn\n> @@ -128,6 +133,7 @@ EOF\n>  \n>  stop_httpd () {\n>  \ttest -z \"$SVN_HTTPD_PORT\" && return\n> +\ttest ! -e \"$GIT_DIR/httpd.conf\" && return\n>  \t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k stop\n>  }\n>  \n> -- \n> 1.7.3\n"},{"id":"158233","messageId":"4D0A6FC0.5030106@ramsay1.demon.co.uk","threadId":"26056","inReplyTo":"7v8vzsuq48.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 04/14] lib-git-svn.sh: Add check for missing mod_dav_svn module","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-16T20:00:00Z","receivedAt":"2010-12-16T20:00:00Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\n>> index 919d45a..154f3d3 100644\n>> --- a/t/lib-git-svn.sh\n>> +++ b/t/lib-git-svn.sh\n>> @@ -101,6 +101,11 @@ start_httpd () {\n>>  \t\techo >&2 'SVN_HTTPD_PORT is not defined!'\n>>  \t\treturn\n>>  \tfi\n>> +\tif test ! -e \"$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\"\n>> +\tthen\n>> +\t\techo >&2 'Apache module \"mod_dav_svn.so\" not found'\n>> +\t\treturn 1\n>> +\tfi\n> \n> Others seem to check with \"test -f\" for things like this.\n\nOK, do you want me to send an updated patch?\n\n> Also why \"return 1\" only on this codepath?\n\nThis test, along with t9115-*.sh, t9118-*.sh and t9120-*.sh, have\nbeen written in such a way that it can access the svn repo using\neither file or http urls. By default (SVN_HTTPD_PORT not set), it\nuses file urls so that, despite it noisily printing to stderr that\n\"SVN_HTTPD_PORT is not defined!\", lack of an Apache installation is\nnot a problem. (In fact, I suspect very few people run it with\nSVN_HTTPD_PORT defined).\n\nSo, the initial test (of SVN_HTTPD_PORT) and return is not particularly\nnoteworthy, let alone an error. (Yes I have a patch to remove the\nmessage, see below). However, *if* the user requests the test be run\nwith http urls and the mod_sav_svn.so module is missing, then we want\nto fail the test noisily; thus we return 1. \n\nNote that we could easily reset SVN_HTTPD_PORT and return, thus silently\nconverting to the \"use file urls\" case, but I don't think that would be\nacceptable.\n\nThe reason I didn't submit the patch to remove the above message is\nbecause I felt I should add a note about how/why you would use the\nSVN_HTTPD_PORT variable to the t/README file. However, that started\nme thinking about other similar variables like:\n    SVN_HTTPD_{PATH,MODULE_PATH}, LIB_HTTPD_{PATH,PORT,SSL,DAV,SVN},\n    GIT_SVN_NO_OPTIMIZE_COMMITS, GIT_TEST_HTTPD, .....\nSo, that patch never got finished! :-P\n\nATB,\nRamsay Jones\n"}]}