[kdesrc-build/make_it_mojo] /: svn: Clean up and streamline, remove obsolete features.
Michael Pyne
null at kde.org
Tue Oct 9 00:40:40 BST 2018
Git commit 63de897a5d878f739295683f8548f78272c91738 by Michael Pyne.
Committed on 08/10/2018 at 21:28.
Pushed by mpyne into branch 'make_it_mojo'.
svn: Clean up and streamline, remove obsolete features.
Gone: checkout-only, kde-languages (required the former)
Death's door: do-not-compile
I'm not even sure if there's anything left that a normal user needs
subversion for (artwork and wallpapers not too long ago but I think
those are in git as well now).
M +0 -1 CMakeLists.txt
M +13 -146 doc/index.docbook
M +0 -2 kdesrc-build
D +0 -621 kdesrc-build-test.pl
M +0 -10 kdesrc-buildrc-sample
M +0 -50 modules/ksb/Application.pm
M +0 -2 modules/ksb/BuildContext.pm
M +5 -59 modules/ksb/BuildSystem.pm
M +0 -1 modules/ksb/BuildSystem/KDE4.pm
M +1 -3 modules/ksb/Module.pm
M +51 -460 modules/ksb/Updater/Svn.pm
D +0 -221 modules/ksb/l10nSystem.pm
M +3 -3 vim/syntax/kdesrc-buildrc.vim
https://commits.kde.org/kdesrc-build/63de897a5d878f739295683f8548f78272c91738
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09b0b63..410cb4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,6 @@ if (KDESRC_BUILD_INSTALL_MODULES)
modules/ksb/Updater.pm
modules/ksb/Util.pm
modules/ksb/Version.pm
- modules/ksb/l10nSystem.pm
DESTINATION ${KDESRC_BUILD_MODULE_INSTALL_PREFIX}/ksb)
install(FILES
diff --git a/doc/index.docbook b/doc/index.docbook
index fdb7cdb..db786b9 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -1325,12 +1325,6 @@ use the <link linkend="cmdline-src-only">--src-only</link> option to let
&kdesrc-build; know that it is acceptable to perform the switch.
</para></listitem>
-<listitem><para>
-&kdesrc-build; can <link linkend="partial-builds">checkout only portions of a
-module</link>, for those situations where you only need one program from a
-large module.
-</para></listitem>
-
<listitem><para>
For developers: &kdesrc-build; will <link linkend="ssh-agent-reminder">remind
you</link> if you use svn+ssh:// but <application>ssh-agent</application> is
@@ -1941,16 +1935,8 @@ change at all.</para></important>
<row id="conf-checkout-only">
<entry>checkout-only</entry>
<entry>Module setting overrides global</entry>
-<entry><para>Set this option to checkout &subversion; sources piece by piece. The
-value for this option should be a space-separated list of directories to
-checkout. Although this option overrides the global option, be aware that
-setting this as a global option makes no sense.
-</para>
-
-<para>Note that this setting has no effect on &git; modules due to the
-operation of the &git; source control system.</para>
-
-<para>See <xref linkend="checking-out-parts"/> for an example.</para></entry>
+<entry><para>This option has been removed in &kdesrc-build; 18.10, as the use
+cases it supported are no longer significant issues for &kde; contributors.</para></entry>
</row>
<row id="conf-cmake-options">
@@ -2071,15 +2057,12 @@ for every module. You can disable this check by setting
<entry><para>Use this option to select a specific set of directories not to be built in a
module (instead of all of them). The directories not to build should be space-separated.</para>
-<para>Note that the sources to the programs will still be downloaded. You can use
-the <link linkend="conf-checkout-only">checkout-only</link>
-directive to choose directories that you want to check out.</para>
-
-<para>For example, to hold &juk; and &kscd; in the kdemultimedia module from
-compiling, you would add "do-not-compile juk kscd" to your kdemultimedia
-settings.</para>
+<para>Note that the sources to the programs will still be downloaded.</para>
-<para>See <xref linkend="not-compiling"/> for an example.</para>
+<para>This option currently only works for &cmake;-based modules. It works by
+passing appropriate <literal>-DBUILD_<replaceable>foo</replaceable></literal>
+options when running &cmake;, but this can also be done using <link
+linkend="conf-cmake-options">cmake-options</link>.</para>
</entry>
</row>
@@ -2394,24 +2377,8 @@ well.</entry>
<row id="conf-kde-languages">
<entry>kde-languages</entry>
<entry>Cannot be overridden</entry>
-<entry><para>This option allows you to choose to download and install
-localization packages along with &kde;. You might do this if you do not live in
-the United States and would like to use &kde; translated into your native
-language.</para>
-
-<para>To use this option, set it to a space-separated list of languages to
-install. Each language has a language code associated with it, which you
-can look up at this page: <ulink
-url="http://l10n.kde.org/teams-list.php">http://l10n.kde.org/teams-list.php</ulink>.
-</para>
-
-<para>It is alright to choose only one language. By default, none are
-downloaded, which means &kde; will display in American English.</para>
-
-<para>For instance, to choose to install French, you would set the option to
-something like: <userinput><option>kde-languages</option>
-<replaceable>fr</replaceable></userinput>. You would still need to use
-&systemsettings; in order to choose the French language, however.</para>
+<entry><para>This option was removed in &kdesrc-build; 18.10 due to inability to
+maintain the underlying &subversion; support that is required.</para>
</entry>
</row>
@@ -3838,102 +3805,6 @@ build a module.
<sect1 id="advanced-features">
<title>Advanced features</title>
-<sect2 id="partial-builds">
-<title>Partially building a module</title>
-<para>It is possible to build only pieces from a single &kde; module. For
-example, you may want to compile only one program from a module. &kdesrc-build;
-has features to make this easy. There are several complementing ways to
-do this.
-</para>
-
-<sect3 id="checking-out-parts">
-<title>Checking out portions of a module</title>
-
-<para>This is perhaps the best way to do this. When it works, it will save you
-download time and disk space. What happens is that &kdesrc-build; will download
-only the parts of a module that you specify. This is done using the &checkout-only;
-option for a module, which will specify a list of directories to download.
-</para>
-
-<tip><para>
-If you do not already know what to download from a module, it may be a good idea
-to browse the &subversion; layout for a module first, using
-<ulink url="https://websvn.kde.org/branches/KDE/4.6/">WebSVN</ulink>. <!--FIXME outdated-->
-</para></tip>
-
-<informalexample>
-<para>To only grab &kuser; and <application>KSystemLog</application> from
-kdeadmin, you could use &checkout-only; like this:</para>
-
-<screen>
-module <replaceable>kdeadmin</replaceable>
- &checkout-only; <replaceable>kuser ksystemlog</replaceable>
-end module
-</screen>
-
-</informalexample>
-
-<important><para>The directories will be built in the order they are listed
-in the option. If one of the directories needs something else from the module
-to compile, then you need to make sure they are both in the &checkout-only;
-line, and that the required dependency goes before the directory that needs it.</para>
-
-<para>Also, sometimes an application may need other directories and it is hard
-to figure out what they are, which may require some trial and error of constantly
-adding directories to the option to figure out. This option depends on support
-from the build system of the module, so it is only useful for modules that are
-collections of individual applications.</para>
-</important>
-
-<para>One final note to make about this option: If you change the value of this
-option, you should use <userinput><command>kdesrc-build</command>
-<option>&cmd-refresh-build;</option> <option><replaceable>module</replaceable></option></userinput>
-in order to ensure that the module is reconfigured properly. In addition,
-&kdesrc-build; will never remove existing files if you take away the number of
-directories from your &checkout-only; option, or add the option to a module that
-has already been checked out.</para>
-
-</sect3>
-
-<sect3 id="not-compiling">
-<title>Removing directories from a build</title>
-<para>Instead of restricting what is downloaded, it is possible to download
-everything but have the build system leave out a few directories when it does
-the build. This may be useful if one directory always breaks and is
-unnecessary to the rest of the module.
-</para>
-
-<para>This is controlled with the &do-not-compile; option. It works similar
-to the &checkout-only; option just described, in that it is simply a list of
-directories that should not be compiled.</para>
-
-<important><para>
-Also like &checkout-only;, this option requires at least that the
-build system for the module is reconfigured after changing
-it. This is done using the <userinput><command>kdesrc-build</command>
-<option>&cmd-reconfigure;</option>
-<option><replaceable>module</replaceable></option></userinput> command.
-</para></important>
-
-<informalexample>
-<para>To remove the <filename class="directory">python</filename> directory
-from the kdebindings build process:</para>
-
-<screen>
-module <replaceable>kdebindings</replaceable>
- &do-not-compile; <replaceable>python</replaceable>
-end module
-</screen>
-
-</informalexample>
-
-<note><para>This function depends on some standard conventions used in most
-&kde; modules. Therefore it may not work for all programs.</para></note>
-
-</sect3>
-
-</sect2>
-
<sect2 id="using-branches">
<title>Branching and tagging support for &kdesrc-build;</title>
@@ -4474,14 +4345,10 @@ Basically, instead of running <userinput><command>make</command> <option>-f</opt
then &make;, we simply run &cmake; and then &make;.
</para>
-<para>&kdesrc-build; has support for &cmake;. A few features of &kdesrc-build;
-were really features of the underlying buildsystem, including
-<link linkend="conf-configure-flags">configure-flags</link>
-and <link linkend="conf-do-not-compile">do-not-compile</link>. When equivalent
-features are available, they are provided. For instance, the equivalent to the
-configure-flags option is <link linkend="conf-cmake-options">cmake-options</link>, and the
-<link linkend="conf-do-not-compile">do-not-compile</link> option is also supported for &cmake;
-as of &kdesrc-build; version 1.6.3.
+<para>&kdesrc-build; has support for &cmake;. &cmake; options can be set for
+each module using <link linkend="conf-cmake-options">cmake-options</link>, and
+&kdesrc-build; will also pass required environment variable and command line
+options to &cmake; automatically.
</para>
</sect1>
diff --git a/kdesrc-build b/kdesrc-build
index aae861f..8cb9b33 100755
--- a/kdesrc-build
+++ b/kdesrc-build
@@ -75,8 +75,6 @@ $ksb::Version::SCRIPT_PATH = $RealBin;
# similar fashion to how the XFree/X.org lndir() program does it. This is
# reimplemented here since some systems lndir doesn't seem to work right.
#
-# Used from ksb::l10nSystem
-#
# As a special exception to the GNU GPL, you may use and redistribute this
# function however you would like (i.e. consider it public domain).
#
diff --git a/kdesrc-build-test.pl b/kdesrc-build-test.pl
deleted file mode 100755
index e6d2422..0000000
--- a/kdesrc-build-test.pl
+++ /dev/null
@@ -1,621 +0,0 @@
-#!/usr/bin/env perl
-# Test suite for kdesrc-build. If you encounter tests that fail on your
-# correctly-configured system please let myself or the kde-buildsystem mailing
-# list know so I can fix and/or workaround. -mpyne
-#
-# Copyright © 2008 - 2011 Michael Pyne. <mpyne at kde.org>
-# Home page: https://kdesrc-build.kde.org/
-#
-# You may use, alter, and redistribute this software under the terms
-# of the GNU General Public License, v2 (or any later version).
-
-use strict;
-use warnings;
-use 5.014;
-use Getopt::Long;
-use Scalar::Util qw(blessed);
-use FindBin qw($RealBin $Bin);
-
-# Control whether we actually try to svn checkouts, possibly more later.
-my $fullRun = 0;
-GetOptions("full-run!" => \$fullRun);
-
-package test; # Tells kdesrc-build not to run
-require 'kdesrc-build';
-
-# Reset to kdesrc-build's package so we don't have to import symbols back from
-# kdesrc-build.
-package main;
-
-use FindBin qw($RealBin);
-use lib "$RealBin/../share/apps/kdesrc-build/modules";
-use lib "$RealBin/modules";
-
-# Must come after require kdesrc-build. note will interfere with our debugging
-# function, and we don't use it in the test harness anyways.
-use Test::More import => ['!note'];
-use File::Temp 'tempdir';
-use Storable 'dclone';
-use File::Copy;
-use ksb::BuildSystem::QMake;
-use ksb::BuildContext;
-use ksb::Module;
-use ksb::l10nSystem;
-
-# is_deeply does not work under blessed references i.e. it will not verify
-# the contents of blessed array references are actually equal, which causes
-# some tests to spuriously pass in my experience :(
-# Instead we compare the canonical in-memory representations of data structures
-# which should have identical contents. This means we should use ok() instead
-# of is() since we don't want the expected value dumped to tty.
-$Storable::canonical = 1;
-
-# From kdesrc-build
-our %ENV_VARS;
-
-# List util functions from List::Util
-sub all { $_ || return 0 for @_; 1 }
-sub none { $_ && return 0 for @_; 1 }
-sub notall { $_ || return 1 for @_; 0 }
-
-# Base directory name to use for any needed filesystem tests.
-my $testSourceDirName =
- tempdir('kdesrc-build-test-XXXXXX',
- TMPDIR => 1, # Force creation under the temporary directory.
- CLEANUP => 1); # Delete temp directory when done.
-
-my $ctx = ksb::BuildContext->new();
-isa_ok($ctx, 'ksb::BuildContext', 'Ensure BuildContext classiness');
-isa_ok($ctx->phases(), 'ksb::PhaseList', 'Ensure PhaseList classiness');
-
-my %moreOptions = (
- 'qt' => {
- 'cxxflags' => '-pipe -march=i386',
- 'configure-flags' => '-fast',
- 'repository' => 'kde:qt',
- },
-
- 'kdelibs' => {
- 'cmake-options' => '-DTEST=TRUE',
- 'unused' => 0,
- },
-
- 'kdesdk' => { },
-
- 'kdesupport' => { },
-
- 'phonon' => { },
-
- 'playground/libs' => { },
-
- 'KDE/kdelibs' => {
- 'cmake-options' => '-DTEST=TRUE',
- },
-
- 'test' => {
- 'source-dir' => '~/testsrc',
- 'module-base-path' => 'KDE/KDE/test',
- 'set-env' => { 'MOIN'=>'2' },
- },
-);
-
-for my $key (keys %moreOptions) {
- ${$ctx->{build_options}}{$key} = $moreOptions{$key};
-}
-
-eval {
-
-ksb::Util->import();
-
-# If using set-env, it is handled by the Module::processSetEnvOption, so the
-# value should be the space separated VAR and VALUE.
-$ctx->setOption('set-env', 'TESTY_MCTEST yes');
-$ctx->setOption('cxxflags', '-g -O0');
-$ctx->setOption('cmake-options', '-DCMAKE_BUILD_TYPE=RelWithDebInfo');
-$ctx->setOption('svn-server', 'svn+ssh://svn@svn.kde.org/home/kde');
-$ctx->setOption('configure-flags', '-fast -dbus');
-$ctx->setOption('#configure-flags', '-fast -dbus');
-$ctx->setOption('source-dir', '~/' . "kdesrc-build-unused");
-$ctx->setOption('#unused', '1');
-$ctx->setOption('branch', '4.3');
-
-# Commence testing proper
-p_chdir ($testSourceDirName);
-
-SKIP: {
- skip 'git not installed', 1 unless defined absPathToExecutable('git');
-
- if (!is(system('git', 'init', 'test-git-dir'), 0, 'Create new git directory')) {
- skip 'git does not work', 1;
- }
-
- p_chdir('test-git-dir');
-
- my @gitStatusOutput = filter_program_output(sub { /On branch/ }, qw/git status/);
- is(@gitStatusOutput, 1, 'Correct number of items from filter_program_output');
- is(`git status`, join('', filter_program_output(undef, qw/git status/)), 'Ensure filter_program_output works w/ no filter');
- is($ctx->getSourceDir(), $ENV{HOME} . "/kdesrc-build-unused", 'Correct tilde-expansion for source-dir');
-
- p_chdir($testSourceDirName);
-}
-
-# We know tilde-expansion works for source-dir, reset to our temp dir.
-$ctx->setOption('source-dir', $testSourceDirName);
-
-SKIP: {
- skip 'No XML testing', 1 unless $fullRun;
-
- my $fh = $ctx->getKDEProjectMetadataFilehandle();
- isa_ok($fh, 'IO::File');
-
- my $moduleSet = ksb::ModuleSet::KDEProjects->new($ctx, '<autotest :)>');
- $moduleSet->setModulesToFind('kdesrc-build');
-
- my ($metadataModule, @modules) = expandModuleSets($ctx, $moduleSet);
- isa_ok($metadataModule, 'ksb::Module');
- isnt ($metadataModule->moduleSet(), $moduleSet, 'kde-build-metadata has autogenerated module-set');
- isa_ok($metadataModule->moduleSet(), 'ksb::ModuleSet::KDEProjects');
- is ($modules[0]->name(), 'kdesrc-build', 'Found module had right name');
- is ($modules[0]->moduleSet(), $moduleSet, 'Found module inherited correct module set');
- is ($modules[0]->getOption('#xml-full-path', 'module'), 'extragear/utils/kdesrc-build', 'XML Reader found right full path');
-
- is($metadataModule->scmType(), 'metadata', 'expandModuleSet adds kde-build-metadata');
- $metadataModule->scm()->updateInternal();
-}
-
-my ($qtModule, $kdelibsModule, $testModule, $kdesupportModule, $phononModule)
- = map {
- ksb::Module->new($ctx, $_);
- } (qw/qt kdelibs test kdesupport phonon/);
-
-like($kdelibsModule->getLogDir(), qr{^$testSourceDirName/log}, 'correct log dir for test run');
-is($qtModule->getOption('cxxflags'), '-pipe -march=i386', 'qt cxxflags handling');
-is($qtModule->getOption('configure-flags'), '-fast', 'qt configure-flags handling');
-is($kdelibsModule->getOption('unused'), 1, 'Test normal sticky option');
-like($kdelibsModule->getOption('cmake-options'), qr/^-DCMAKE_BUILD_TYPE=RelWithDebInfo/, 'kdelibs cmake-options appending');
-like($kdelibsModule->getOption('cmake-options'), qr/-DTEST=TRUE$/, 'kdelibs options appending');
-is($testModule->getOption('branch', 'module'), undef, 'get_option limit to module level');
-
-$kdelibsModule->setOption('branch', 'trunk');
-is($kdelibsModule->scm()->svn_module_url(), 'svn+ssh://svn@svn.kde.org/home/kde/trunk/KDE/kdelibs', 'KDE module trunk');
-
-$kdelibsModule->setOption('tag', '4.1.3');
-$kdelibsModule->setOption('branch', '4.2');
-like(ksb::Updater::Svn::_handle_branch_tag_option($kdelibsModule, 'tags'), qr(/tags/KDE/4\.1\.3/kdelibs$), 'KDE module tag preferred to branch');
-
-$kdelibsModule->setOption('tag', '');
-like(ksb::Updater::Svn::_handle_branch_tag_option($kdelibsModule, 'branches'), qr(/branches/KDE/4.2/kdelibs$), 'KDE module branch');
-
-$kdesupportModule->setOption('branch', 'trunk');
-$kdesupportModule->setOption('svn-server', 'svn://anonsvn.kde.org/home/kde');
-
-# Ensure svn info exists in our source dir. This requires actually accessing
-# anonsvn, so use --depth empty and --ignore-externals to minimize load on
-# server.
-my @svnArgs = (
- qw{svn co
- --depth empty
- --ignore-externals
- svn://anonsvn.kde.org/home/kde/trunk/kdesupport},
- "$testSourceDirName/kdesupport");
-
-my $svnAvail = defined absPathToExecutable('svn') && $fullRun;
-
-SKIP: {
- skip 'svn not installed', 1 unless $svnAvail;
- $svnAvail = is(system(@svnArgs), 0, "Make empty subversion checkout.");
-}
-
-$ENV{HOME} = $testSourceDirName;
-
-is($kdesupportModule->scm()->svn_module_url(), 'svn://anonsvn.kde.org/home/kde/trunk/kdesupport', 'non-KDE module trunk');
-
-# Issue reported by dfaure 2011-02-06, where the kdesupport-branch was not being
-# obeyed when global-branch was set to 4.6, so somehow kdesrc-build wanted a
-# mystical kdesupport-from-4.6 branch
-$kdesupportModule->setOption('branch', 'master');
-$kdesupportModule->setOption('prefix', '/d/kde/inst/kdesupport-for-4.6');
-$ctx->setOption('branch', '4.6');
-is($kdesupportModule->scm()->svn_module_url(), 'svn://anonsvn.kde.org/home/kde/branches/kdesupport/master', 'kdesupport-for-$foo with local branch override');
-
-$kdesupportModule->setOption('tag', 'kdesupport-for-4.2');
-like(ksb::Updater::Svn::_handle_branch_tag_option($kdesupportModule, 'tags'), qr(/tags/kdesupport-for-4.2$), 'non-KDE module tag (no name appended)');
-is($kdesupportModule->scm()->svn_module_url(), 'svn://anonsvn.kde.org/home/kde/tags/kdesupport-for-4.2', 'non-KDE module tag (no name; entire URL)');
-
-$phononModule->setOption('branch', '4.2');
-is($phononModule->scm()->svn_module_url(), 'svn+ssh://svn@svn.kde.org/home/kde/branches/phonon/4.2', 'non-KDE module branch (no name appended)');
-
-$phononModule->setOption('branch', '');
-$phononModule->setOption('module-base-path', 'tags/phonon/4.2');
-is($phononModule->scm()->svn_module_url(), 'svn+ssh://svn@svn.kde.org/home/kde/tags/phonon/4.2', 'module-base-path');
-
-my @result1 = qw/a=b g f/;
-my @quoted_result = ('a=b g f', 'e', 'c=d', 'bless');
-is_deeply([ split_quoted_on_whitespace('"a=b g f" "e" c=d bless') ], \@quoted_result, "split_quoted_on_whitespace quotes and spaces");
-is_deeply([ split_quoted_on_whitespace('a=b g f') ], \@result1, 'split_quoted_on_whitespace space, no quotes');
-is_deeply([ split_quoted_on_whitespace(' a=b g f') ], \@result1, 'split_quoted_on_whitespace space no quotes, leading whitespace');
-is_deeply([ split_quoted_on_whitespace('a=b g f ') ], \@result1, 'split_quoted_on_whitespace space no quotes, trailing whitespace');
-is_deeply([ split_quoted_on_whitespace(' a=b g f ') ], \@result1, 'split_quoted_on_whitespace space no quotes, leading and trailing whitespace');
-is_deeply([ split_quoted_on_whitespace('-DFOO="${MODULE}" BAR') ],
- ['-DFOO=${MODULE}', 'BAR'], 'split_quoted_on_whitespace with braces/quotes');
-
-SKIP: {
- skip "svn not available or network was down", 2 unless $svnAvail;
-
- is($kdesupportModule->scmType(), 'svn', 'svn requirement detection');
- like($kdesupportModule->scm()->svnInfo('URL'), qr/anonsvn\.kde\.org/, 'svn-info output (url)');
- like($kdesupportModule->scm()->svnInfo('Revision'), qr/^\d+$/, 'svn-info output (revision)');
-}
-
-# Test get_subdir_path
-is($kdelibsModule->getSubdirPath('build-dir'),
- "$testSourceDirName/build",
- 'build-dir subdir path rel');
-is($kdelibsModule->getSubdirPath('log-dir'),
- "$testSourceDirName/log",
- 'log-dir subdir path rel');
-$kdelibsModule->setOption('build-dir', '/tmp');
-is($kdelibsModule->getSubdirPath('build-dir'), "/tmp", 'build-dir subdir path abs');
-$kdelibsModule->setOption('build-dir', '~/tmp/build');
-is($kdelibsModule->getSubdirPath('build-dir'), "$ENV{HOME}/tmp/build", 'build-dir subdir path abs and tilde expansion');
-
-# correct log dir for modules with a / in the name
-my $playLibsModule = ksb::Module->new($ctx, 'playground/libs');
-my $logdir = $playLibsModule->getLogDir();
-
-ok(log_command($playLibsModule, 'touch', ['touch', "$testSourceDirName/touched"]) == 0, 'creating temp file');
-ok(-e "$testSourceDirName/log/latest/playground/libs/touch.log", 'correct playground/libs log path');
-
-#$kdelibsModule->setOption('log-dir', '~/kdesrc-build-log');
-#my $isoDate = strftime("%F", localtime); # ISO 8601 date per setup_logging_subsystem
-#is($kdelibsModule->getLogDir(), "$ENV{HOME}/kdesrc-build-log/$isoDate-01/kdelibs", 'getLogDir tilde expansion');
-
-is($testModule->getSourceDir(), "$ENV{HOME}/testsrc", 'separate source-dir for modules');
-$testModule->setupEnvironment();
-is($ctx->{env}->{'TESTY_MCTEST'}, 'yes', 'setting global set-env for modules');
-is($ctx->{env}->{'MOIN'}, '2', 'setting module set-env for modules');
-
-my $unlikelyEnvVar = 'KDESRC_BUILD_TEST_PATH';
-$ENV{$unlikelyEnvVar} = 'FAILED';
-$ctx->prependEnvironmentValue($unlikelyEnvVar, 'TEST_PATH');
-
-# Ensure that an empty {env} variable is not used.
-ok(defined $ctx->{env}->{$unlikelyEnvVar}, 'prependEnvironmentValue queues value');
-is($ctx->{env}->{$unlikelyEnvVar}, 'TEST_PATH:FAILED', 'prependEnvironmentValue queues in right order');
-
-$unlikelyEnvVar .= '1';
-$ctx->{env}->{$unlikelyEnvVar} = '/path/1:/path/2';
-$ctx->prependEnvironmentValue($unlikelyEnvVar, '/path/0');
-
-is($ctx->{env}->{$unlikelyEnvVar}, '/path/0:/path/1:/path/2', 'prependEnvironmentValue queues multiple times');
-
-# Finally, see what happens when no env var or pre-existing queued var is set
-
-$unlikelyEnvVar .= '1';
-$ctx->prependEnvironmentValue($unlikelyEnvVar, '/path/10');
-
-is($ctx->{env}->{$unlikelyEnvVar}, '/path/10', 'prependEnvironmentValue initial value');
-
-# Ensure svn URL hierarchy is correct
-like($testModule->scm()->svn_module_url(), qr{/home/kde/KDE/KDE/test$}, 'svn_module_url prefer module specific to global');
-$testModule->setOption('override-url', 'svn://annono');
-is($testModule->scm()->svn_module_url(), 'svn://annono', 'testing override-url');
-
-my $pendingOptions = { };
-my @modules = process_arguments($ctx, $pendingOptions, '--test,override-url=svn://ann');
-is($pendingOptions->{test}{'override-url'}, 'svn://ann', 'testing process_arguments module options');
-is(scalar @modules, 0, 'testing process_arguments return value for no passed module names');
-
- at modules = qw/qt kdelibs kdebase/;
-my $kdebaseModule;
-$ctx = ksb::BuildContext->new();
-my @Modules = map { ksb::Module->new($ctx, $_) } (@modules);
-my $backupCtx = dclone($ctx);
-
-# Ensure functions like updateModulePhases doesn't change the objects we pass
-# in.
-my $resetContext = sub {
- $ctx = dclone($backupCtx);
- # We must re-create modules to have the same context as ctx.
- @Modules = map { ksb::Module->new($ctx, $_) } (@modules);
- ($qtModule, $kdelibsModule, $kdebaseModule) = @Modules;
-};
-
-# Should be no change if there are no manual-update, no-src, etc. in the rc
-# file so force one of those on that way we know updateModulePhases did
-# something.
-$kdelibsModule->setOption('no-build', 1);
-my $backupModuleCopy = dclone(\@Modules);
-updateModulePhases(@Modules);
-$kdelibsModule->deleteOption('no-build');
-
-# Now test --no-src/--no-build/etc.
-is_deeply(
- [map { $_->name() } process_arguments($ctx, {}, @modules)],
- \@modules,
- 'testing process_arguments return value for passed module names');
-
-$_->phases()->filterOutPhase('update') foreach @Modules;
-my @args = process_arguments($ctx, {}, @modules, '--no-src');
-is_deeply(
- [map { $_->phases()->phases() } @args ],
- [map { $_->phases()->phases() } @Modules],
- 'testing --no-src phase updating');
-
-ok(!list_has([$ctx->phases()->phases()], 'update'), 'Build context also not updating');
-
-&$resetContext();
-
-# Reported by Kurt Hindenburg (IIRC). Passing --no-src would also disable the
-# build (in updateModulesPhases) because of the global '#no-src' being set in
-# process_arguments.
-my @temp_modules = process_arguments($ctx, {}, @modules, '--no-src');
-
-# There should be no module-specific no-src/no-build/manual-update/etc. set.
-is($ctx->getOption('no-src'), '', 'Ensure --no-src does not also set #no-src flag');
-
-&$resetContext();
-
-$kdelibsModule->setOption('run-tests', 1);
-my $newModules = dclone(\@Modules);
-
-$newModules->[1]->phases()->addPhase('test'); # kdelibs
-updateModulePhases($Modules[1]);
-ok(list_has([$Modules[1]->phases()->phases()], 'test'), 'Make sure run-tests is recognized for a module');
-
-ok(!$kdebaseModule->getOption('run-tests'), 'run-tests not set for kdebase');
-updateModulePhases($Modules[2]);
-ok(!list_has([$Modules[2]->phases()->phases()], 'test'), 'Make sure run-tests is recognized only for its module');
-
-&$resetContext();
-
-# Test only --no-build
- at temp_modules = process_arguments($ctx, {}, @modules, '--no-build');
-ok(none(map { $_->phases()->has('build') } @temp_modules), 'testing --no-build phase updating');
-ok(!$ctx->phases()->has('build'), 'Build context also not building');
-
-# Add on --no-src
- at temp_modules = process_arguments($ctx, {}, @modules, '--no-build', '--no-src');
-ok(none( map {
- $_->phases()->has('build') || $_->phases()->has('update')
- } @temp_modules),
- 'testing --no-src and --no-build phase updating');
-
-ok(!$ctx->phases()->has('build') && !$ctx->phases()->has('update'),
- 'Build context also not building or updating');
-
-my $conf = <<EOF;
-global
- git-repository-base test kde:
-end global
-
-module-set
- use-modules kdelibs
- repository test
-end module-set
-
-module-set set1
- use-modules kdesrc-build kde-runtime
- repository kde-projects
-end module-set
-
-module qt
- configure-flags -fast
- repository kde:qt
-end module
-
-# This shouldn't actually show up as a module, but
-# should override the prev. decl. in set1.
-module kde-runtime
- manual-build true
-end module
-EOF
-open my $fh, '<', \$conf;
-
-&$resetContext();
-
-# Read in new options
-my @conf_modules = read_options($ctx, $fh);
-
-ok($conf_modules[0]->isa('ksb::ModuleSet'), 'First read module-set IS-A module set');
-ok($conf_modules[1]->isa('ksb::ModuleSet::KDEProjects'), 'First read kde-projects module-set IS-A kde-projects module-set');
-ok($conf_modules[2]->isa('ksb::Module'), 'First read module IS-A module');
-
-$ctx->setOption('resume-from', 'set1');
-my @filtered_modules = applyModuleFilters($ctx, @conf_modules);
-is_deeply(
- [map { $_->name() } @filtered_modules[0..1]],
- [qw/set1 qt/],
- 'resume-from a module-set');
-
-is_deeply(
- [map { $_->name() } @filtered_modules],
- [qw/set1 qt/],
- 'resume-from a module-set, w/ option overrides');
-
-$ctx->setOption('resume-after', 'set1');
-# Setting both resume-from and resume-after should raise an exception.
-$@ = '';
-eval {
- @filtered_modules = applyModuleFilters($ctx, @conf_modules);
-};
-isa_ok($@, 'ksb::BuildException', 'resume-{from,after} combine for exception');
-
-$ctx->deleteOption('resume-from');
- at filtered_modules = applyModuleFilters($ctx, @conf_modules);
-is_deeply(
- [map { $_->name() } @filtered_modules[0..0]],
- [qw/qt/],
- 'resume-after a module-set');
-
-is_deeply(
- [map { $_->name() } @filtered_modules],
- [qw/qt/],
- 'resume-after a module-set, w/ option overrides');
-
-$ctx->deleteOption('resume-after');
-
-# We re-bless conf_modules[1] to ensure it doesn't actually try to download
-# the XML.
-bless $conf_modules[1], 'ksb::ModuleSet';
-$conf_modules[1]->{options}->{repository} = 'test';
-my $metadataModule;
-($metadataModule, @conf_modules) = expandModuleSets($ctx, @conf_modules);
-
-is($metadataModule, undef, 'No metadata module return without kde-projects module sets');
-
-# qt
-is($conf_modules[3]->getOption('configure-flags'), '-fast', 'read_options/parse_module');
-
-# kdelibs
-is($conf_modules[0]->getOption('repository'), 'kde:kdelibs', 'git-repository-base');
-is($conf_modules[0]->scmType(), 'git', 'Ensure repository gives git scm (part 1)');
-
-is($conf_modules[2]->getOption('manual-build'), 'true', 'manual-build for kde-projects submodule (Bug 288611)');
-
-# This test must be performed to get the test after to pass, due to differences in each
-# code path leading to one having build_obj still undef.
-is($conf_modules[3]->buildSystemType(), 'Qt', 'Qt build systems load right.');
-
-# Test resume-from options
-$ctx->setOption('resume-from', 'kdesrc-build');
- at filtered_modules = applyModuleFilters($ctx, @conf_modules);
-is_deeply(
- [map { "$_" } @filtered_modules[0..2]],
- [qw/kdesrc-build kde-runtime qt/],
- 'resume-from under module-set');
-
-is_deeply(
- [map { "$_" } @filtered_modules],
- [qw/kdesrc-build kde-runtime qt/],
- 'resume-from under module-set w/ option override');
-
-$ctx->setOption('resume-from', 'kde-runtime');
- at filtered_modules = applyModuleFilters($ctx, @conf_modules);
-is_deeply(
- [map { "$_" } @filtered_modules[0..1]],
- [qw/kde-runtime qt/],
- 'resume-from under module-set, not first module in set');
-
-is_deeply(
- [map { "$_" } @filtered_modules],
- [qw/kde-runtime qt/],
- 'resume-from under module-set, not first module in set, w/ override');
-
-# Test sub directory creation.
-ok(! -d "$testSourceDirName/build", 'Ensure build dir does not exist');
-isnt(super_mkdir("$testSourceDirName/build"), 0, 'Make temp build directory');
-ok(-d "$testSourceDirName/build", 'Double-check temp build dir created');
-
-# Test log_command callback.
-my $flagged = 0;
-my $callback = sub {
- $flagged = 1;
- $flagged = 2 if !defined($_[0]);
-};
-
-is (log_command($ctx, 'test-callback', ['ls', '-1'], { callback => $callback }), 0, 'Successful return of log_command');
-cmp_ok ($flagged, '>', 0, 'log_command actually calls callback');
-is ($flagged, 2, 'Test undef was passed at end of execution');
-
-$flagged = 0;
-my $lc_all_found = 0;
-
-$callback = sub {
- return if !defined $_[0];
- $flagged ||= !!/^LC_MESSAGES=C/;
- $lc_all_found ||= !!/^LC_ALL=/;
-};
-
-$ENV{'LC_ALL'} = 'en_US.UTF-8';
-
-log_command($ctx, 'test-no_translate-messages', ['/usr/bin/env'], { callback => $callback, no_translate => 1 });
-ok ($flagged, 'Verify LC_MESSAGES set if no_translate used');
-ok (!$lc_all_found, 'Verify LC_ALL stripped if no_translate used');
-
-# Test isSubdirBuildable
-my $tokenModule = ksb::Module->new($ctx, 'test-module');
-my $buildSystem = ksb::BuildSystem->new($tokenModule);
-ok ($buildSystem->isSubdirBuildable('meh'), 'generic-build isSubdirBuildable');
-ok ($buildSystem->createBuildSystem(), 'Ensure createBuildSystem can be called');
-ok ($buildSystem->cleanBuildSystem(), 'Ensure cleanBuildSystem can be called');
-
-$buildSystem = ksb::l10nSystem->new($ctx);
-ok (!$buildSystem->isSubdirBuildable('scripts'), 'l10n-build isSubdirBuildable-scripts');
-ok ($buildSystem->isSubdirBuildable(''), 'l10n-build isSubdirBuildable-other');
-
-# Note to packagers: This assumes qmake or qmake-qt4 are already installed on
-# the system.
-my @qmakePossibilities = ksb::BuildSystem::QMake::absPathToQMake();
-SKIP: {
- is (scalar @qmakePossibilities, 1, 'Ensure exactly one qmake is returned from possibilities.')
- or skip "Need a qmake candidate for next test", 1; # Skip next tests if no qmake
- like ($qmakePossibilities[0], qr/^qmake/, 'qmake candidate looks like a qmake executable.');
-
- # Duplicate test in scalar context the whole time.
- my $newQMakePossibility = ksb::BuildSystem::QMake::absPathToQMake();
- like ($newQMakePossibility, qr/^qmake/, 'qmake looks like an executable even in scalar context.');
-}
-
-do {
- local $ENV{HOME} = "$testSourceDirName"; # Search right spot for kde-env-master.sh
- local $ENV{XDG_CONFIG_HOME} = $testSourceDirName;
-
- # This test set must be run first as xsession depends on this env-master.
- is(system('/bin/sh', '-n', "$RealBin/sample-kde-env-master.sh"), 0,
- 'env-master pre-install syntax check');
-
- local $ENV{KDESRC_BUILD_TESTING} = 1; # Tell sample-xsession.sh not to run.
-
- is(system('/bin/sh', '-u', "$RealBin/sample-kde-env-master.sh"), 0,
- 'env-master unset variable check');
-
- # Ensure this function can run without throwing exception.
- ok(installTemplatedFile("$RealBin/sample-kde-env-master.sh", "$testSourceDirName/kde-env-master.sh", $ctx) || 1,
- 'env-master template installation');
-
- is(system('/bin/sh', '-n', "$RealBin/sample-xsession.sh"), 0,
- 'xsession pre-install syntax check');
-
- ok(File::Copy::copy("$RealBin/sample-xsession.sh", "$testSourceDirName/xsession.sh"),
- 'xsession installation');
-
- is(system('/bin/sh', '-u', "$RealBin/sample-xsession.sh"), 0,
- 'xsession unset variable check');
-
- is(system('/bin/sh', '-n', "$testSourceDirName/xsession.sh"), 0,
- 'xsession post-install syntax check');
-};
-
-open my $testFile, '>', "$testSourceDirName/md5-sample";
-print $testFile "sample-vector";
-close $testFile;
-
-is(fileDigestMD5("$testSourceDirName/md5-sample"),
- 'fe840f4320cfd6e7ce9070756400e42e', 'MD5 file digests');
-
-done_testing();
-### TESTS GO ABOVE THIS LINE
-}; # eval
-
-if (my $err = $@) {
- if (blessed ($err) && $err->isa('ksb::BuildException')) {
- say "Test suite failed after kdesrc-build threw the following exception:";
- say "$@->{message}";
- fail();
- }
- else {
- die; # Re-throw
- }
-}
-
-# svn cd'ed on us, switch to a known directory to avoid errors unlinking the
-# temporary directory. In an "END" block so this should occur even if we
-# exit testing due to failure/exception.
-END {
- chdir('/');
- if (!$fullRun) {
- print "The full test suite was not run. To do so, " .
- "pass --full-run when running the tests\n";
- }
-}
diff --git a/kdesrc-buildrc-sample b/kdesrc-buildrc-sample
index 85444f5..21a7517 100644
--- a/kdesrc-buildrc-sample
+++ b/kdesrc-buildrc-sample
@@ -66,16 +66,6 @@ global
# should experiment with setting this value higher for best performance.
# make-options -j2
-# KDE has one of the most extensive translation packages in the world. They
-# are stored in the l10n module. kdesrc-build can automatically try to build
-# and install languages for you, using this parameter. It should be a list
-# of languages to build and install. This option requires the language code
-# as present in l10n. You can look these codes up at
-# http://l10n.kde.org/teams-list.php
-# kde-languages de # German
-# kde-languages fr # French
-# kde-languages en_GB cs # British English and Czech
-
# If you would like install KDE to the system (DO NOT INSTALL *over* a prior
# installation!), then you'll probably need to use sudo to install everything.
#
diff --git a/modules/ksb/Application.pm b/modules/ksb/Application.pm
index 3e386c4..380ae9a 100644
--- a/modules/ksb/Application.pm
+++ b/modules/ksb/Application.pm
@@ -477,10 +477,6 @@ sub modulesFromSelectors
my @rcfileModules = @{$moduleResolver->{inputModulesAndOptions}};
@modules = $moduleResolver->expandModuleSets(@rcfileModules);
- if ($ctx->getOption('kde-languages')) {
- @modules = _expandl10nModules($ctx, @modules);
- }
-
ksb::Module->setModuleSource('config');
}
@@ -1691,52 +1687,6 @@ EOF
return @moduleList[$startIndex .. $stopIndex];
}
-# This function converts any 'l10n' references on the command line to return a l10n
-# module with the proper build system, scm type, etc.
-#
-# The languages are selected using global/kde-languages (which should be used
-# exclusively from the configuration file).
-sub _expandl10nModules
-{
- my ($ctx, @modules) = @_;
- my $l10n = 'l10n-kde4';
-
- assert_isa($ctx, 'ksb::BuildContext');
-
- # Only filter if 'l10n' is actually present in list.
- my @matches = grep {$_->name() =~ /^(?:$l10n|l10n)$/} @modules;
- my @langs = split(' ', $ctx->getOption('kde-languages'));
-
- return @modules if (!@matches || !@langs);
-
- my $l10nModule;
- for my $match (@matches)
- {
- # Remove all instances of l10n.
- @modules = grep {$_->name() ne $match->name()} @modules;
-
- # Save l10n module if user had it in config. We only save the first
- # one encountered though.
- $l10nModule //= $match;
- }
-
- # No l10n module? Just create one.
- $l10nModule //= ksb::Module->new($ctx, $l10n);
-
- whisper ("\tAdding languages ", join(';', @langs), " to build.");
-
- $l10nModule->setScmType('l10n');
- my $scm = $l10nModule->scm();
-
- # Add all required directories to the l10n module. Its buildsystem should
- # know to skip scripts and templates.
- $scm->setLanguageDirs(qw/scripts templates/, @langs);
- $l10nModule->setBuildSystem($scm);
-
- push @modules, $l10nModule;
- return @modules;
-}
-
# Updates the built-in phase list for all Modules passed into this function in
# accordance with the options set by the user.
sub _updateModulePhases
diff --git a/modules/ksb/BuildContext.pm b/modules/ksb/BuildContext.pm
index a9a1415..fb3b487 100644
--- a/modules/ksb/BuildContext.pm
+++ b/modules/ksb/BuildContext.pm
@@ -51,7 +51,6 @@ my %internalGlobalOptions = (
"async" => 1,
"build-system-only" => "",
"build-when-unchanged" => 1, # Safe default
- "checkout-only" => "",
"colorful-output" => 1, # Use color by default.
"debug-level" => ksb::Debug::INFO,
"filter-out-phases" => '',
@@ -106,7 +105,6 @@ our %defaultGlobalOptions = (
"do-not-compile" => "",
"http-proxy" => '', # Proxy server to use for HTTP.
"kdedir" => "$ENV{HOME}/kde",
- "kde-languages" => "",
"libpath" => "",
"log-dir" => "log",
"make-install-prefix" => "", # Some people need sudo
diff --git a/modules/ksb/BuildSystem.pm b/modules/ksb/BuildSystem.pm
index 7c0486c..8b01c09 100644
--- a/modules/ksb/BuildSystem.pm
+++ b/modules/ksb/BuildSystem.pm
@@ -85,13 +85,6 @@ sub needsRefreshed
return "";
}
-# Returns true if the given subdirectory (reference from the module's root source directory)
-# can be built or not. Should be reimplemented by subclasses as appropriate.
-sub isSubdirBuildable
-{
- return 1;
-}
-
# Called by the module being built before it runs its build/install process. Should
# setup any needed environment variables, build context settings, etc., in preparation
# for the build and install phases.
@@ -141,9 +134,6 @@ sub buildInternal
split(' ', $self->module()->getOption('make-options')),
],
logbase => 'build',
- subdirs => [
- split(' ', $self->module()->getOption("checkout-only"))
- ],
})->{was_successful};
}
@@ -190,7 +180,6 @@ sub installInternal
target => 'install',
message => 'Installing..',
'prefix-options' => [@cmdPrefix],
- subdirs => [ split(' ', $module->getOption("checkout-only")) ],
})->{was_successful};
}
@@ -207,7 +196,6 @@ sub uninstallInternal
target => 'uninstall',
message => "Uninstalling g[$module]",
'prefix-options' => [@cmdPrefix],
- subdirs => [ split(' ', $module->getOption("checkout-only")) ],
})->{was_successful};
}
@@ -286,11 +274,8 @@ sub createBuildSystem
# Subroutine to run the build command with the arguments given by the
# passed hash.
#
-# In addition to finding the proper executable, this function handles the
-# step of running the build command for individual subdirectories (as
-# specified by the checkout-only option to the module). Due to the various
-# ways the build command is called by this script, it is required to pass
-# customization options in a hash:
+# Due to the various ways the build command is called by this script, it is
+# required to pass customization options in a hash:
# {
# target => undef, or a valid build target e.g. 'install',
# message => 'Compiling.../Installing.../etc.'
@@ -300,8 +285,6 @@ sub createBuildSystem
# make command, used for make-install-prefix support for
# e.g. sudo ],
# logbase => 'base-log-filename',
-# subdirs => [ list of subdirectories of the module to build,
-# relative to the module's own build directory. ]
# }
#
# target and message are required. logbase is required if target is left
@@ -356,7 +339,6 @@ sub safe_make (@)
# Simplify code by forcing lists to exist.
$optsRef->{'prefix-options'} //= [ ];
$optsRef->{'make-options'} //= [ ];
- $optsRef->{'subdirs'} //= [ ];
my @prefixOpts = @{$optsRef->{'prefix-options'}};
@@ -374,46 +356,10 @@ sub safe_make (@)
# Will be output by _runBuildCommand
my $buildMessage = $optsRef->{message};
+ my $logname = $optsRef->{logbase} // $optsRef->{logfile} // $optsRef->{target};
+ p_chdir ($module->fullpath('build'));
-# TODO: Remove all this nonsense about per-subdir builds. The last time this really helped was when
-# this script was called kdecvs-build...
-
- # Here we're attempting to ensure that we either run the build command
- # in each subdirectory, *or* for the whole module, but not both.
- my @dirs = @{$optsRef->{subdirs}};
- push (@dirs, "") if scalar @dirs == 0;
-
- for my $subdir (@dirs)
- {
- # Some subdirectories shouldn't have the build command run within
- # them.
- next unless $self->isSubdirBuildable($subdir);
-
- my $logname = $optsRef->{logbase} // $optsRef->{logfile} // $optsRef->{target};
-
- if ($subdir ne '')
- {
- $logname = $logname . "-$subdir";
-
- # Remove slashes in favor of something else.
- $logname =~ tr{/}{-};
-
- # Mention subdirectory that we're working on, move ellipsis
- # if present.
- if ($buildMessage =~ /\.\.\.$/) {
- $buildMessage =~ s/(\.\.\.)?$/ subdirectory g[$subdir]$1/;
- }
- }
-
- my $builddir = $module->fullpath('build') . "/$subdir";
- $builddir =~ s/\/*$//; # Remove trailing /
-
- p_chdir ($builddir);
-
- return $self->_runBuildCommand($buildMessage, $logname, \@args);
- };
-
- return { was_successful => 1 };
+ return $self->_runBuildCommand($buildMessage, $logname, \@args);
}
# Subroutine to run make and process the build process output in order to
diff --git a/modules/ksb/BuildSystem/KDE4.pm b/modules/ksb/BuildSystem/KDE4.pm
index cac9ce0..e2609d4 100644
--- a/modules/ksb/BuildSystem/KDE4.pm
+++ b/modules/ksb/BuildSystem/KDE4.pm
@@ -120,7 +120,6 @@ sub installInternal
logfile => 'install',
message => 'Installing..',
'prefix-options' => [@cmdPrefix],
- subdirs => [ split(' ', $module->getOption("checkout-only")) ],
})->{was_successful};
}
diff --git a/modules/ksb/Module.pm b/modules/ksb/Module.pm
index 1b33faa..29319bf 100644
--- a/modules/ksb/Module.pm
+++ b/modules/ksb/Module.pm
@@ -15,8 +15,6 @@ use parent qw(ksb::OptionsBase);
use ksb::Debug;
use ksb::Util;
-use ksb::l10nSystem;
-
use ksb::Updater::Svn;
use ksb::Updater::Git;
use ksb::Updater::Bzr;
@@ -275,7 +273,7 @@ sub setScmType
when('git') { $newType = ksb::Updater::Git->new($self); }
when('proj') { $newType = ksb::Updater::KDEProject->new($self); }
when('metadata') { $newType = ksb::Updater::KDEProjectMetadata->new($self); }
- when('l10n') { $newType = ksb::l10nSystem->new($self); }
+# when('l10n') { $newType = ksb::l10nSystem->new($self); }
when('svn') { $newType = ksb::Updater::Svn->new($self); }
when('bzr') { $newType = ksb::Updater::Bzr->new($self); }
default { $newType = undef; }
diff --git a/modules/ksb/Updater/Svn.pm b/modules/ksb/Updater/Svn.pm
index 29230a5..129c802 100644
--- a/modules/ksb/Updater/Svn.pm
+++ b/modules/ksb/Updater/Svn.pm
@@ -1,4 +1,4 @@
-package ksb::Updater::Svn 0.10;
+package ksb::Updater::Svn 0.20;
# Module responsible for source code updates on Subversion modules. Used as a
# superclass for our l10n update/build system as well.
@@ -14,101 +14,6 @@ use ksb::Util;
use IPC::Open3 qw(open3);
-# Returns true if a module has a base component to their name (e.g. KDE/,
-# extragear/, or playground). Note that modules that aren't in trunk/KDE
-# don't necessary meet this criteria (e.g. kdereview is a module itself).
-sub _has_base_module
-{
- my $moduleName = shift;
-
- return $moduleName =~ /^(extragear|playground|KDE)(\/[^\/]+)?$/;
-}
-
-# Subroutine to return the branch prefix. i.e. the part before the branch
-# name and module name.
-#
-# The first parameter is the module name in question.
-# The second parameter should be 'branches' if we're dealing with a branch
-# or 'tags' if we're dealing with a tag.
-#
-# Ex: 'kdelibs' => 'branches/KDE'
-# 'kdevelop' => 'branches/kdevelop'
-sub _branch_prefix
-{
- my $moduleName = shift;
- my $type = shift;
-
- # These modules seem to have their own subdir in /tags.
- my @tag_components = qw/arts koffice amarok kst qt taglib/;
-
- # The map call adds the kde prefix to the module names because I don't feel
- # like typing them all in.
- my @kde_module_list = ((map {'kde' . $_} qw/-base-artwork -wallpapers accessibility
- addons admin artwork base bindings edu games graphics libs
- network pim pimlibs plasma-addons sdk toys utils webdev/));
-
- # If the user already has the module in the form KDE/foo, it's already
- # done.
- return "$type/KDE" if $moduleName =~ /^KDE\//;
-
- # KDE proper modules seem to use this pattern.
- return "$type/KDE" if list_has(\@kde_module_list, $moduleName);
-
- # KDE extragear / playground modules use this pattern
- return "$type" if _has_base_module($moduleName);
-
- # If we doing a tag just return 'tags' because the next part is the actual
- # tag name, which is added by the caller, unless the module has its own
- # subdirectory in /tags.
- return "$type" if $type eq 'tags' and not list_has(\@tag_components, $moduleName);
-
- # Everything else.
- return "$type/$moduleName";
-}
-
-# This subroutine is responsible for stripping the KDE/ part from the
-# beginning of modules that were entered by the user like "KDE/kdelibs"
-# instead of the normal "kdelibs". That way you can search for kdelibs
-# without having to strip KDE/ everywhere.
-sub _moduleBaseName
-{
- my $moduleName = shift;
- $moduleName =~ s/^KDE\///;
-
- return $moduleName;
-}
-
-# Subroutine to return a module URL for a module using the 'branch' option.
-# First parameter is the module in question.
-# Second parameter is the type ('tags' or 'branches')
-sub _handle_branch_tag_option
-{
- my $module = assert_isa(shift, 'ksb::Module');
- my $type = shift;
- my $branch = _branch_prefix($module->name(), $type);
- my $svn_server = $module->getOption('svn-server');
- my $branchname = $module->getOption($type eq 'branches' ? 'branch' : 'tag');
-
- # Remove trailing slashes.
- $svn_server =~ s/\/*$//;
-
- # Remove KDE/ prefix for module name.
- my $moduleName = _moduleBaseName($module->name());
-
- # KDE modules have a different module naming scheme than the rest it seems.
- return "$svn_server/$branch/$branchname/$moduleName" if $branch =~ /\/KDE\/?$/;
-
- # Non-trunk translations happen in a single branch. Assume all non-trunk
- # global branches are intended for the stable translations.
- if ($moduleName =~ /^l10n-kde4\/?/ && $branch ne 'trunk') {
- return "$svn_server/branches/stable/$moduleName";
- }
-
- # Otherwise don't append the module name by default since it makes more
- # sense to branch this way in many situations (i.e. kdesupport tags, phonon)
- return "$svn_server/$branch/$branchname";
-}
-
# Subroutine to return the appropriate SVN URL for a given module, based on
# the user settings. For example, 'kdelibs' ->
# https://svn.kde.org/home/kde/trunk/KDE/kdelibs
@@ -123,46 +28,23 @@ sub svn_module_url
my $module = $self->module();
my $svn_server = $module->getOption('svn-server');
my $modulePath;
+ my $url;
foreach my $levelLimit ('module', 'allow-inherit') {
- $modulePath = $module->getOption('module-base-path', $levelLimit);
-
# Allow user to override normal processing of the module in a few ways,
# to make it easier to still be able to use kdesrc-build even when I
# can't be there to manually update every little special case.
- if($module->getOption('override-url', $levelLimit))
- {
- return $module->getOption('override-url', $levelLimit);
- }
-
- if($module->getOption('tag', $levelLimit))
- {
- return _handle_branch_tag_option($module, 'tags');
- }
-
- my $branch = $module->getOption('branch', $levelLimit);
- if($branch and $branch ne 'trunk')
- {
- return _handle_branch_tag_option($module, 'branches');
- }
-
- my $moduleName = _moduleBaseName($module->name());
-
- # The following modules are in /trunk, not /trunk/KDE. There are others,
- # but these are the important ones.
- my @non_trunk_modules = qw(extragear kdesupport koffice icecream kde-common
- playground KDE kdereview www l10n-kde4);
-
- my $module_root = $moduleName;
- $module_root =~ s/\/.*//; # Remove everything after the first slash
-
- if (not $modulePath and $levelLimit eq 'allow-inherit')
- {
- $modulePath = "trunk/KDE/$moduleName";
- $modulePath = "trunk/$moduleName" if list_has(\@non_trunk_modules, $module_root);
- $modulePath =~ s/^\/*//; # Eliminate / at beginning of string.
- $modulePath =~ s/\/*$//; # Likewise at the end.
- }
+ return $url if $url = $module->getOption('override-url', $levelLimit);
+
+ croak_runtime ("$module: 'tag' option is no longer supported for svn-based modules")
+ if $module->getOption('tag', $levelLimit);
+
+ croak_runtime ("$module: 'branch' option is no longer supported for svn-based modules")
+ if ($module->getOption('branch', $levelLimit) // '') ne 'trunk';
+
+ $modulePath = $module->getOption('module-base-path', $levelLimit);
+ $modulePath = "trunk/$module"
+ if (not $modulePath and $levelLimit eq 'allow-inherit');
last if $modulePath;
}
@@ -170,8 +52,6 @@ sub svn_module_url
# Remove trailing slashes.
$svn_server =~ s/\/*$//;
- # Note that the module name is no longer appended if module-base-path is used (i.e.
- # $branch variable was set. This is a change as of version 1.8.
return "$svn_server/$modulePath";
}
@@ -198,248 +78,66 @@ sub _verifyCorrectServerURL
{
# Check if the --src-only flag was passed.
my $module = $self->module();
- if ($module->buildContext()->getOption('#allow-auto-repo-move'))
- {
- note ("g[$module] is checked out from a different location than expected.");
- note ("Attempting to correct to $module_expected_url");
-
- my ($expected_host, $expected_path) =
- ($module_expected_url =~ m{://([^/]+)/(.*)$});
- my ($actual_host, $actual_path) =
- ($module_actual_url =~ m{://([^/]+)/(.*)$});
-
- # If the path didn't change but the host info did try --relocate
- # otherwise try regular svn switch.
- if (($expected_path eq $actual_path) && ($expected_host ne $actual_host)) {
- log_command($module, 'svn-switch', [
- 'svn', 'switch', '--relocate',
- $module_actual_url, $module_expected_url]);
- }
- else {
- log_command($module, 'svn-switch', [
- 'svn', 'switch', $module_expected_url]);
- }
- return;
- }
warning (<<EOF);
y[!!]
-y[!!] g[$module] seems to be checked out from somewhere other than expected.
+y[!!] g[$module] is checked out from the wrong location
y[!!]
kdesrc-build expects: y[$module_expected_url]
The module is actually from: y[$module_actual_url]
-If the module location is incorrect, you can fix it by either deleting the
-g[b[source] directory, or by changing to the source directory and running
+If the module is actually checked out from the wrong location, you can fix it
+by either deleting the g[b[source] directory, or by changing to the source
+directory and running:
svn switch $module_expected_url
-If the module is fine, please update your configuration file.
-
-If you use kdesrc-build with --src-only it will try switching for you (might not work
-correctly).
-EOF
- }
- else { # The two URLs match, but are they *right*? Things changed June 2013
- my ($uid, $url);
- # uid might be empty, we use $url to see if the match succeeds.
- ($uid, $url) = $module_actual_url =~ m{^svn\+ssh://(?:([a-z]+)\@)?(svn\.kde\.org)};
-
- if ($url && (!$uid || $uid ne 'svn')) {
- error ("SVN login scheme has changed for y[b[$module] as of 2013-06-21");
- error ("\tPlease see https://mail.kde.org/pipermail/kde-cvs-announce/2013/000112.html");
- error ("\tPlease update your b[svn-server] option to be:");
- error ("\tb[g[svn+ssh://svn\@svn.kde.org/home/kde");
- error ("\n\tThen, re-run kdesrc-build with the b[--src-only] option to complete the repair.");
-
- if (!$uid) {
- error (" r[b[* * *]: Note that your SVN URL has *no* username");
- error (" r[b[* * *]: You should probably also double-check ~/.ssh/config");
- error (" r[b[* * *]: for b[svn.kde.org] to ensure the correct default user (svn)");
- }
-
- croak_runtime ("SVN server has changed login scheme, see error message");
- }
- }
-}
-
-# This procedure should be run before any usage of a local working copy to
-# ensure it is valid. This should only be run if there's actually a local
-# copy.
-#
-# Any errors will be fatal, so a 'Runtime' exception would be raised.
-sub check_module_validity
-{
- my $self = assert_isa(shift, 'ksb::Updater::Svn');
- my $module = $self->module();
-
- # svn 1.7 has a different working copy format that must be manually
- # converted. This will mess up everything else so make this our first
- # check.
- p_chdir($module->fullpath('source'));
-
- # gensym makes a symbol that can be made a filehandle by open3
- use Symbol qw(gensym);
+If the module is fine, please update your configuration file to reflect the
+existing location.
- # Can't use filter_program_output as that doesn't capture STDERR on
- # purpose. We, on the other hand, just want STDERR.
- my $stderrReader = gensym();
- my $pid = open3(undef, undef, $stderrReader,
- 'svn', '--non-interactive', 'status');
-
- my @errorLines = grep { /:\s*E155036:/ } (<$stderrReader>);
- waitpid ($pid, 0);
-
- if (@errorLines) {
- warning (<<EOF);
-y[*] A new version of svn has been installed which requires a b[one-time] update
-y[*] Currently running b[svn upgrade], this may take some time but should only
-y[*] be needed once.
+Once done you can run kdesrc-build again.
EOF
-
- if (0 != log_command($module, 'svn-upgrade', ['svn', '--non-interactive', 'upgrade'])) {
- error (<<EOF);
-r[*] Unable to run b[svn upgrade] for b[r[$module]!
-r[*] If you have no local changes you should try deleting the $module
-r[*] source directory, and re-run b[kdesrc-build], which will re-download.
-r[*]
-r[*] There is no way for kdesrc-build to safely make this check for you as
-r[*] the old version of b[svn] is required to read the current repository!
-EOF
- croak_runtime("Unable to run svn upgrade for $module");
- }
-
- # By this point svn-upgrade should have run successfully, unless
- # we're in pretend mode.
- if (pretending()) {
- croak_runtime("Unable to use --pretend for svn module $module until svn-upgrade is run");
- }
}
-
- # Ensure the URLs are correct.
- $self->_verifyCorrectServerURL();
}
-# Subroutine used to handle the checkout-only option. It handles updating
-# subdirectories of an already-checked-out module.
-#
-# This function can throw an exception in the event of a update failure.
-#
-# First parameter is the module.
-# All remaining parameters are subdirectories to check out.
-#
-# Returns the number of files changed by the update, or undef if unable to
-# be determined.
-sub update_module_subdirectories
-{
- my $self = assert_isa(shift, 'ksb::Updater::Svn');
- my $module = $self->module();
- my $numChanged = 0;
-
- # If we have elements in @path, download them now
- for my $dir (@_)
- {
- info ("\tUpdating g[$dir]");
-
- my $logname = $dir;
- $logname =~ tr{/}{-};
-
- my $count = $self->run_svn("svn-up-$logname", [ 'svn', 'up', $dir ]);
- $numChanged = undef unless defined $count;
- $numChanged += $count if defined $numChanged;
- }
-
- return $numChanged;
-}
-
-# Checkout a module that has not been checked out before, along with any
-# subdirectories the user desires.
+# Checkout a module that is not already checked out.
#
# This function will throw an exception in the event of a failure to update.
#
-# The first parameter is the module to checkout (including extragear and
-# playground modules).
-# All remaining parameters are subdirectories of the module to checkout.
+# The first parameter is the module to checkout.
#
-# Returns number of files affected, or undef.
+# Returns number of files affected
sub checkout_module_path
{
my $self = assert_isa(shift, 'ksb::Updater::Svn');
my $module = $self->module();
- my @path = @_;
my %pathinfo = $module->getInstallPathComponents('source');
- my @args;
- if (not -e $pathinfo{'path'} and not super_mkdir($pathinfo{'path'}))
- {
- croak_runtime ("Unable to create path r[$pathinfo{path}]!");
- }
+ croak_runtime ("Unable to create path r[$pathinfo{path}]!")
+ if (not -e $pathinfo{'path'} and not super_mkdir($pathinfo{'path'}));
p_chdir ($pathinfo{'path'});
my $svn_url = $self->svn_module_url();
my $modulename = $pathinfo{'module'}; # i.e. kdelibs for KDE/kdelibs as $module
- push @args, ('svn', 'co', '--non-interactive');
- push @args, '-N' if scalar @path; # Tells svn to only update the base dir
- push @args, $svn_url;
- push @args, $modulename;
-
- note ("Checking out g[$module]");
-
- my $count = $self->run_svn('svn-co', \@args);
-
- p_chdir ($pathinfo{'module'}) if scalar @path;
-
- my $count2 = $self->update_module_subdirectories(@path);
-
- return $count + $count2 if defined $count and defined $count2;
- return undef;
+ return $self->run_svn('svn-co', [qw(svn co --non-interactive), $svn_url, $modulename]);
}
-# Update a module that has already been checked out, along with any
-# subdirectories the user desires.
+# Update a module that has already been checked out.
#
# This function will throw an exception in the event of an update failure.
#
-# The first parameter is the module to checkout (including extragear and
-# playground modules).
-# All remaining parameters are subdirectories of the module to checkout.
+# The first parameter is the module to checkout.
sub update_module_path
{
- my ($self, @path) = @_;
+ my ($self) = @_;
assert_isa($self, 'ksb::Updater::Svn');
my $module = $self->module();
- my $fullpath = $module->fullpath('source');
- my @args;
-
- p_chdir ($fullpath);
-
- push @args, ('svn', 'up', '--non-interactive');
- push @args, '-N' if scalar @path;
-
- note ("Updating g[$module]");
-
- my $count = eval { $self->run_svn('svn-up', \@args); };
-
- # Update failed, try svn cleanup.
- if (had_an_exception() && $@->{exception_type} ne 'ConflictPresent')
- {
- info ("\tUpdate failed, trying a cleanup.");
- my $result = safe_system('svn', 'cleanup');
- $result == 0 or croak_runtime ("Unable to update $module, " .
- "svn cleanup failed with exit code $result");
- info ("\tCleanup complete.");
+ p_chdir ($module->fullpath('source'));
- # Now try again (allow exception to bubble up this time).
- $count = $self->run_svn('svn-up-2', \@args);
- }
-
- my $count2 = $self->update_module_subdirectories(@path);
-
- return $count + $count2 if defined $count and defined $count2;
- return undef;
+ return $self->run_svn('svn-up', [qw(svn up --non-interactive)]);
}
# Run the svn command. This is a special subroutine so that we can munge
@@ -459,16 +157,9 @@ sub run_svn
assert_isa($self, 'ksb::Updater::Svn');
my $module = $self->module();
- my $revision = $module->getOption('revision');
- if ($revision && $revision ne '0')
- {
- my @tmp = @{$arg_ref};
-
- # Insert after first two entries, deleting 0 entries from the
- # list.
- splice @tmp, 2, 0, '-r', $revision;
- $arg_ref = \@tmp;
- }
+ my $revision = $module->getOption('revision') || 0;
+ splice (@{$arg_ref}, 2, 0, '-r', $revision)
+ if $revision ne '0';
my $count = 0;
my $conflict = 0;
@@ -479,7 +170,7 @@ sub run_svn
# The check for capitalized letters in the second column is because
# svn can use the first six columns for updates (the characters will
# all be uppercase), which makes it hard to tell apart from normal
- # sentences (like "At Revision foo"
+ # sentences (like "At Revision foo")
$count++ if /^[UPDARGMC][ A-Z]/;
$conflict = 1 if /^C[ A-Z]/;
};
@@ -502,77 +193,6 @@ sub run_svn
return $count;
}
-# Subroutine to check for subversion conflicts in a module. Basically just
-# runs svn st and looks for "^C".
-#
-# First parameter is the module to check for conflicts on.
-# Returns 0 if a conflict exists, non-zero otherwise.
-sub module_has_conflict
-{
- my $module = assert_isa(shift, 'ksb::Module');
- my $srcdir = $module->fullpath('source');
-
- if ($module->getOption('no-svn'))
- {
- whisper ("\tSource code conflict check skipped.");
- return 1;
- }
- else
- {
- info ("\tChecking for source conflicts... ");
- }
-
- my $pid = open my $svnProcess, "-|";
- if (!$pid)
- {
- error ("\tUnable to open check source conflict status: b[r[$!]");
- return 0; # false allows the build to proceed anyways.
- };
-
- if (0 == $pid)
- {
- close STDERR; # No broken pipe warnings
-
- disable_locale_message_translation();
- exec {'svn'} (qw/svn --non-interactive st/, $srcdir) or
- croak_runtime("Cannot execute 'svn' program: $!");
- # Not reached
- }
-
- while (<$svnProcess>)
- {
- if (/^C/)
- {
- error (<<EOF);
-The $module module has source code conflicts present. This can occur
-when you have made changes to the source code in the local copy
-at $srcdir
-that interfere with a change introduced in the source repository.
-EOF
-
- error (<<EOF);
-To fix this, y[if you have made no source changes that you haven't committed],
-run y[svn revert -R $srcdir]
-to bring the source directory back to a pristine state and trying building the
-module again.
-
-NOTE: Again, if you have uncommitted source code changes, running this command
-will delete your changes in favor of the version in the source repository.
-EOF
-
- kill "TERM", $pid; # Kill svn
- waitpid ($pid, 0);
- close $svnProcess;
- return 0;
- }
- }
-
- # conflicts cleared apparently.
- waitpid ($pid, 0);
- close $svnProcess;
- return 1;
-}
-
# scm-specific update procedure.
# May change the current directory as necessary.
# Assumes called as part of a ksb::Module (i.e. $self->isa('ksb::Module') should be true.
@@ -581,33 +201,13 @@ sub updateInternal
my $self = assert_isa(shift, 'ksb::Updater::Svn');
my $module = $self->module();
my $fullpath = $module->fullpath('source');
- my @options = split(' ', $module->getOption('checkout-only'));
if (-e "$fullpath/.svn") {
- $self->check_module_validity();
- my $updateCount = $self->update_module_path(@options);
-
- my $log_filter = sub {
- return unless defined $_;
- print $_ if /^C/;
- print $_ if /Checking for/;
- return;
- };
-
- # Use log_command as the check so that an error file gets created.
- if (0 != log_command($module, 'conflict-check',
- ['kdesrc-build', 'ksb::Updater::Svn::module_has_conflict',
- $module],
- { callback => $log_filter, no_translate => 1 })
- )
- {
- croak_runtime (" * Conflicts present in module $module");
- }
-
- return $updateCount;
+ $self->_verifyCorrectServerURL();
+ return $self->update_module_path();
}
else {
- return $self->checkout_module_path(@options);
+ return $self->checkout_module_path();
}
}
@@ -641,30 +241,21 @@ sub svnInfo
}
# Search each line of output, ignore stderr.
- # eval since filter_program_output uses exceptions.
- eval
- {
- # Need to chdir into the srcdir, in case srcdir is a symlink.
- # svn info /path/to/symlink barfs otherwise.
- p_chdir ($srcdir);
-
- my @lines = filter_program_output(
- sub { /^$param:/ },
- 'svn', 'info', '--non-interactive', '.'
- );
-
- croak_runtime ("No svn info output!") unless @lines;
- chomp ($result = $lines[0]);
- $result =~ s/^$param:\s*//;
- };
+ # Need to chdir into the srcdir, in case srcdir is a symlink.
+ # svn info /path/to/symlink barfs otherwise.
+ p_chdir ($srcdir);
- if($@)
- {
- error ("Unable to run r[b[svn], is the Subversion program installed?");
- error (" -- Error was: r[$@]");
- return undef;
- }
+ # filter_program_output can itself throw exceptions
+ my @lines = filter_program_output(
+ sub { /^$param:/ },
+ 'svn', 'info', '--non-interactive', '.'
+ );
+
+ croak_runtime ("No svn info output!")
+ unless @lines;
+ chomp ($result = $lines[0]);
+ $result =~ s/^$param:\s*//;
return $result;
}
diff --git a/modules/ksb/l10nSystem.pm b/modules/ksb/l10nSystem.pm
deleted file mode 100644
index f2a0ea1..0000000
--- a/modules/ksb/l10nSystem.pm
+++ /dev/null
@@ -1,221 +0,0 @@
-package ksb::l10nSystem 0.10;
-
-# This class is an implementation of both the source and build interfaces needed to
-# support building KDE l10n modules.
-
-use strict;
-use warnings;
-use 5.014;
-
-use parent qw(ksb::Updater::Svn ksb::BuildSystem);
-
-use ksb::Debug;
-use ksb::Util;
-
-sub new
-{
- my ($class, $module) = @_;
-
- # Ensure associated module updates from the proper svn path.
- # TODO: Support different localization branches?
-
- $module->setOption('module-base-path', 'trunk/l10n-kde4');
- my $refreshMessage = "an update happened";
- return bless { module => $module, needsRefreshed => $refreshMessage }, $class;
-}
-
-sub module
-{
- my $self = shift;
- return $self->{module};
-}
-
-sub configuredModuleFileName
-{
- # Not quite correct (we should be looking at each individual language
- # but it at least keeps the process going.
- return 'teamnames';
-}
-
-# Sets the directories that are to be checked out/built/etc.
-# There should be one l10nSystem for the entire l10n build (i.e. add
-# all required support dirs and languages).
-sub setLanguageDirs
-{
- my ($self, @languageDirs) = @_;
- $self->{l10n_dirs} = \@languageDirs;
-}
-
-# Returns true if the given subdirectory (reference from the module's root source directory)
-# can be built or not. Should be reimplemented by subclasses as appropriate.
-sub isSubdirBuildable
-{
- my ($self, $subdir) = @_;
- return ($subdir ne 'scripts' && $subdir ne 'templates');
-}
-
-sub prepareModuleBuildEnvironment
-{
- my ($ctx, $module, $prefix) = @_;
-
- $ctx->prependEnvironmentValue('CMAKE_PREFIX_PATH', $prefix);
-}
-
-# scm-specific update procedure.
-# May change the current directory as necessary.
-sub updateInternal
-{
- my $self = assert_isa(shift, 'ksb::Updater');
- my $module = $self->module();
- my $fullpath = $module->fullpath('source');
- my @dirs = @{$self->{l10n_dirs}};
-
- if (-e "$fullpath/.svn") {
- $self->check_module_validity();
- my $count = $self->update_module_path(@dirs);
-
- $self->{needsRefreshed} = '' if $count == 0;
- return $count;
- }
- else {
- return $self->checkout_module_path(@dirs);
- }
-}
-
-sub name
-{
- return 'l10n';
-}
-
-# Returns a list of just the languages to install.
-sub languages
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
- my @langs = @{$self->{l10n_dirs}};
-
- return grep { $self->isSubdirBuildable($_); } (@langs);
-}
-
-# Buildsystem support section
-
-sub needsRefreshed
-{
- my $self = shift;
-
- # Should be a 'reason' string except if no update happened.
- return $self->{needsRefreshed};
-}
-
-sub buildInternal
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
- my $builddir = $self->module()->fullpath('build');
- my @langs = $self->languages();
- my $result = ($self->safe_make({
- target => undef,
- message => "Building localization for language...",
- logbase => "build",
- subdirs => \@langs,
- }))->{was_successful};
-
- return $result;
-}
-
-sub configureInternal
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
-
- my $builddir = $self->module()->fullpath('build');
- my @langs = $self->languages();
- my $result = 0;
-
- for my $lang (@langs) {
- my $prefix = $self->module()->installationPath();
- p_chdir("$builddir/$lang");
-
- info ("\tConfiguring to build language $lang");
- $result = (log_command($self->module(), "cmake-$lang",
- ['cmake', '-DCMAKE_INSTALL_PREFIX=' . $prefix]) == 0) || $result;
- }
-
- return $result;
-}
-
-sub installInternal
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
- my $builddir = $self->module()->fullpath('build');
- my @langs = $self->languages();
-
- return ($self->safe_make({
- target => 'install',
- message => "Installing language...",
- logbase => "install",
- subdirs => \@langs,
- }) == 0);
-}
-
-# Subroutine to link a source directory into an alternate directory in
-# order to fake srcdir != builddir for modules that don't natively support
-# it. The first parameter is the module to prepare.
-#
-# The return value is true (non-zero) if it succeeded, and 0 (false) if it
-# failed.
-#
-# On return from the subroutine the current directory will be in the build
-# directory, since that's the only directory you should touch from then on.
-sub prepareFakeBuilddir
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
- my $module = $self->module();
- my $builddir = $module->fullpath('build');
- my $srcdir = $module->fullpath('source');
-
- # List reference, not a real list. The initial kdesrc-build does *NOT*
- # fork another kdesrc-build using exec, see sub log_command() for more
- # info.
- my $args = [ 'kdesrc-build', 'main::safe_lndir', $srcdir, $builddir ];
-
- info ("\tSetting up alternate build directory for l10n");
- return (0 == log_command ($module, 'create-builddir', $args));
-}
-
-# Subroutine to create the build system for a module. This involves making
-# sure the directory exists and then running any preparatory steps (like
-# for l10n modules). This subroutine assumes that the module is already
-# downloaded.
-#
-# Return convention: boolean (inherited)
-sub createBuildSystem
-{
- my $self = assert_isa(shift, 'ksb::l10nSystem');
- my $module = $self->module();
- my $builddir = $module->fullpath('build');
-
- # l10n doesn't support srcdir != builddir, fake it.
- whisper ("\tFaking builddir for g[$module]");
- if (!$self->prepareFakeBuilddir())
- {
- error ("Error creating r[$module] build system!");
- return 0;
- }
-
- p_chdir ($builddir);
-
- my @langs = @{$self->{l10n_dirs}};
- @langs = grep { $self->isSubdirBuildable($_) } (@langs);
-
- foreach my $lang (@langs) {
- my $cmd_ref = [ './scripts/autogen.sh', $lang ];
- if (log_command ($module, "build-system-$lang", $cmd_ref))
- {
- error ("\tUnable to create build system for r[$module]");
- }
- }
-
- $module->setOption('#reconfigure', 1); # Force reconfigure of the module
-
- return 1;
-}
-
-1;
diff --git a/vim/syntax/kdesrc-buildrc.vim b/vim/syntax/kdesrc-buildrc.vim
index 0c415d8..7528528 100644
--- a/vim/syntax/kdesrc-buildrc.vim
+++ b/vim/syntax/kdesrc-buildrc.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: kdesrc-build configuration file
" Maintainer: Michael Pyne <mpyne at kde.org>
-" Latest Revision: 23 September 2018
+" Latest Revision: 8 October 2018
" Copyright (c) 2014-2018 Michael Pyne <mpyne at kde.org>
" Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@ setlocal iskeyword+=-
" Keywords
syn keyword ksbrcOption contained skipwhite nextgroup=ksbrcStringValue
- \ binpath branch build-dir checkout-only cmake-options configure-flags
+ \ binpath branch build-dir cmake-options configure-flags
\ custom-build-command cxxflags dest-dir do-not-compile kdedir
\ libpath log-dir make-install-prefix make-options module-base-path
\ override-build-system override-url prefix qtdir repository
@@ -45,7 +45,7 @@ syn keyword ksbrcOption contained skipwhite nextgroup=ksbrcStringValue
syn keyword ksbrcGlobalOption contained skipwhite nextgroup=ksbrcStringValue
\ branch-group git-desired-protocol git-repository-base http-proxy
- \ kde-languages niceness debug-level persistent-data-file set-env
+ \ niceness debug-level persistent-data-file set-env
" MUST BE CONSISTENT WITH ABOVE. Used when a module-set option is used in the
" wrong spot to highlight the error.
More information about the kde-doc-english
mailing list