Allow using HTTP for kde-projects modules.

This adds an option git-desired-protocol to allow for using HTTP instead
of git protocol when updating git modules.

For non kde-projects modules, it should already be possible to use an
http:// URL as a repository instead of git:// (though I haven't tested
this yet).

This should implement wish 305409.

BUG:305409
FIXED-IN:1.16
wilder
Michael Pyne 14 years ago
parent 5785d4e829
commit 08372a530b
  1. 28
      doc/index.docbook
  2. 11
      kdesrc-build

@ -1771,6 +1771,34 @@ This option was removed in version 1.10
</entry>
</row>
<row id="conf-git-desired-protocol">
<entry>git-desired-protocol</entry>
<entry>Cannot be overridden</entry>
<entry><para>This option only applies to modules from a <link
linkend="kde-projects-module-sets">&kde; project</link> repository.</para>
<para>What this option actually does is configure which network protocol to
prefer when updating source code for these modules. Normally the very-efficient
<literal>git</literal> protocol is used, but this may be blocked in some
networks (e.g. corporate intranets, public Wi-Fi). An alternative protocol
which is much better supported is the <literal>HTTP</literal> protocol used for
Internet web sites.</para>
<para>If you are using one of these constrained networks you can set this
option to <userinput>http</userinput> to prefer <literal>HTTP</literal>
communications instead.</para>
<tip><para>You may also need the <link
linkend="conf-http-proxy">http-proxy</link> option if an HTTP proxy is also
needed for network traffic.</para></tip>
<para>In any other situation you should not set this option as the default
protocol is most efficient.</para>
<para>This option was added in &kdesrc-build; 1.16.</para>
</entry>
</row>
<row id="conf-git-repository-base">
<entry>git-repository-base</entry>
<entry>Cannot be overridden</entry>

@ -1599,6 +1599,7 @@ EOF
"dest-dir" => '${MODULE}', # single quotes used on purpose!
"disable-agent-check" => 0, # If true we don't check on ssh-agent
"do-not-compile" => "",
"git-desired-protocol" => 'git', # protocol to grab from kde-projects
"git-repository-base" => {}, # Base path template for use multiple times.
"http-proxy" => '', # Proxy server to use for HTTP.
"install-after-build" => 1, # Default to true
@ -6667,7 +6668,15 @@ sub expandXMLModules
my $srcdir = $ctx->getSourceDir();
my $xmlReader = KDEXMLReader->new($databaseFile);
my @allXmlResults = $xmlReader->getModulesForProject($name, 'git');
my $protocol = $ctx->getOption('git-desired-protocol') || 'git';
if (!list_has(['git', 'http'], $protocol)) {
error (" b[y[*] Invalid b[git-desired-protocol] $protocol");
error (" b[y[*] Try setting this option to 'git' if you're not using a proxy");
croak_runtime ("Invalid git-desired-protocol: $protocol");
}
my @allXmlResults = $xmlReader->getModulesForProject($name, $protocol);
# It's possible to match modules which are marked as inactive on
# projects.kde.org, elide those.

Loading…
Cancel
Save