kde-projects: Add --no-metadata command line option.

BUG:331939
FIXED-IN:1.16
wilder
Michael Pyne 12 years ago
parent 3888b31653
commit 900a08a7d8
  1. 12
      doc/index.docbook
  2. 20
      doc/man-kdesrc-build.1.docbook
  3. 18
      modules/ksb/Application.pm
  4. 2
      modules/ksb/BuildContext.pm

@ -2855,6 +2855,18 @@ Skip the build process.
</para></listitem>
</varlistentry>
<varlistentry id="cmdline-no-metadata">
<term><parameter>--no-metadata</parameter></term>
<listitem><para>
Do not automatically download the extra metadata needed for &kde; git modules.
The source updates for the modules themselves will still occur unless you pass
<link linkend="cmdline-no-src">--no-src</link> as well.
</para><para>
This can be useful if you are frequently re-running &kdesrc-build; since the
metadata does not change very often.
</para></listitem>
</varlistentry>
<varlistentry id="cmdline-no-install">
<term><parameter>--no-install</parameter></term>
<listitem><para>

@ -161,6 +161,26 @@ combining short options into one at this point. (E.g. running
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--no-metadata</option>
</term>
<listitem>
<para>
Skips the metadata update phase for KDE modules. Other phases (including
the source update phase) are included as normal. If you wish to avoid all network
updates you should also pass <option>--no-src</option>.
</para>
<para>
This option can be useful if you are frequently running
<command>kdesrc-build</command> since the metadata itself does not change
very often.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--no-install</option>

@ -259,7 +259,7 @@ DONE
GetOptionsFromArray(\@options, \%foundOptions,
'version', 'author', 'help', 'disable-snapshots|no-snapshots',
'install', 'uninstall', 'no-src|no-svn', 'no-install', 'no-build',
'no-tests', 'build-when-unchanged|force-build',
'no-tests', 'build-when-unchanged|force-build', 'no-metadata',
'verbose|v', 'quiet|quite|q', 'really-quiet', 'debug',
'reconfigure', 'colorful-output|color!', 'async!',
'src-only|svn-only', 'build-only', 'install-only', 'build-system-only',
@ -609,9 +609,9 @@ sub generateModuleList
return @modules;
}
# Causes kde-projects metadata to be downloaded (unless --pretend or --no-src
# is in effect, although we'll download even in --pretend if nothing is
# available).
# Causes kde-projects metadata to be downloaded (unless --pretend, --no-src, or
# --no-metadata is in effect, although we'll download even in --pretend if
# nothing is available).
#
# No return value.
sub _downloadKDEProjectMetadata
@ -624,13 +624,17 @@ sub _downloadKDEProjectMetadata
my $sourceDir = $metadataModule->getSourceDir();
super_mkdir($sourceDir);
my $updateDesired = !$ctx->getOption('no-metadata') && $ctx->phases()->has('update');
my $updateNeeded = (! -e "$sourceDir/dependency-data-common");
if (!$ctx->phases()->has('update') && $updateNeeded) {
warning (" r[b[*] Skipping build metadata update due to b[--no-src], but this is apparently required!");
my $lastUpdate = $ctx->getPersistentOption('global', 'last-metadata-update') // 0;
if (!$updateDesired && $updateNeeded && (time - ($lastUpdate)) >= 7200) {
warning (" r[b[*] Skipping build metadata update, but it hasn't been updated recently!");
}
if ($ctx->phases()->has('update') && (!pretending() || $updateNeeded)) {
if ($updateDesired && (!pretending() || $updateNeeded)) {
$metadataModule->scm()->updateInternal();
$ctx->setPersistentOption('global', 'last-metadata-update', time);
}
};

@ -878,7 +878,7 @@ sub getKDEProjectMetadataFilehandle
# Must use ->phases() directly to tell if we will be updating since
# modules are not all processed until after this function is called...
my $updating = grep { /^update$/ } (@{$self->phases()});
my $updating = grep { /^update$/ } (@{$self->phases()}) && !$self->getOption('no-metadata');
if (!pretending() && $updating) {
info (" * Downloading projects.kde.org project database...");
$result = download_file($url, $file, $self->getOption('http-proxy'));

Loading…
Cancel
Save