Commit 6c10817e authored by Michael Pyne's avatar Michael Pyne

dep-resolv: Introduce --no-include-dependencies cmdline opt.

Does what it says on the tin, to permit disabling dependency inclusion
on a one-time basis without editing config file. This just involved
moving changing this option internally to be a 'global flag' which
already are automagically able to be negated by precedining with --no-.

When adding documentation for it I noticed I had not documented it in
the Docbook docs so I've added docs for that and --include-dependencies
also and updated copyright.

This should also support updating other documentation for the issue
being tracked at #31
parent 77f274db
Pipeline #7216 passed with stage
in 1 minute and 22 seconds
......@@ -2,7 +2,7 @@
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!--
Documentation for kdesrc-build.
Copyright (c) 2005-2008, 2010-2018 Michael Pyne <mpyne@kde.org>
Copyright (c) 2005-2008, 2010-2019 Michael Pyne <mpyne@kde.org>
Copyright (c) 2005 Carlos Leonhard Woelz <carloswoelz@imap-mail.com>
Copyright (c) 2009 Burkhard Lück <lueck@hube-lueck.de>
......@@ -99,6 +99,7 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Michael Pyne</holder>
</copyright>
......@@ -2294,9 +2295,9 @@ modules</link>, and requires that the metadata maintained by the &kde;
developers is accurate for your selected <link
linkend="conf-branch-group">branch-group</link>.</para></note>
<para>This option is disabled by default, to avoid inadvertently selecting a
bunch of modules that were not desired. It was added with &kdesrc-build;
1.16 in 2015.</para>
<para>This option is enabled by default, to support building applications
that need versions of &Qt; or &plasma; more recent than supported on
common operating systems.</para>
</entry>
</row>
......@@ -3207,6 +3208,26 @@ work.</para></note>
</listitem>
</varlistentry>
<varlistentry id="cmdline-include-dependencies">
<term><parameter>--include-dependencies</parameter></term>
<term><parameter>--no-include-dependencies</parameter></term>
<listitem><para>
This option causes &kdesrc-build; to automatically include other &kde; and &Qt;
modules in the build, if required for the modules you have requested to build
on the command line or in your
<link linkend="configure-data">configuration file</link>.</para>
<para>The modules that are added are as recorded within the &kde; source code
management system. See <xref linkend="kde-projects-module-sets"/>.</para>
<para>The corresponding configure file option is
<link linkend="conf-include-dependencies">include-dependencies</link>.</para>
<para>You can also use <parameter>--no-include-dependencies</parameter>, which turns off
automatic inclusion of additional dependency modules.</para>
</listitem>
</varlistentry>
<varlistentry id="cmdline-ignore-modules">
<term><parameter>--ignore-modules</parameter></term>
<listitem><para>
......
......@@ -6,7 +6,7 @@
<!--
Man page for kdesrc-build.
Copyright (c) 2011, 2014-2016 Michael Pyne <mpyne@kde.org>
Copyright (c) 2011, 2014-2019 Michael Pyne <mpyne@kde.org>
Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation License, Version 1.2 or any later
......@@ -23,14 +23,14 @@
<email>mpyne@kde.org</email>
<personblurb><para>Authored man page</para></personblurb>
</author>
<date>2016-05-02</date>
<releaseinfo>kdesrc-build 16.05</releaseinfo>
<date>2019-08-31</date>
<releaseinfo>kdesrc-build 19.08</releaseinfo>
</refentryinfo>
<refmeta>
<refentrytitle><command>kdesrc-build</command></refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="version">16.05</refmiscinfo>
<refmiscinfo class="version">19.08</refmiscinfo>
</refmeta>
<refnamediv>
......@@ -452,6 +452,7 @@ combining short options into one at this point. (E.g. running
<varlistentry>
<term>
<option>--include-dependencies</option>
<option>--no-include-dependencies</option>
</term>
<listitem>
......@@ -460,6 +461,8 @@ combining short options into one at this point. (E.g. running
it would normally build (either because they were specified on the command
line, or mentioned in the configuration file), but also to include
<emphasis>known dependencies</emphasis> of those modules in the build.
This is normally the default; you can use <option>--no-include-dependencies</option>
to disable this effect.
</para>
<para>
......@@ -1307,7 +1310,7 @@ url="https://docs.kde.org/index.php?application=kdesrc-build">https://docs.kde.o
<refsect1>
<title>COPYING</title>
<para>Copyright (C) 2003-2015 Michael Pyne.</para>
<para>Copyright (C) 2003-2019 Michael Pyne.</para>
<para>This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
......
......@@ -7,7 +7,7 @@
# Please also see the documentation that should be included with this program,
# in the doc/ directory.
#
# Copyright © 2003 - 2018 Michael Pyne. <mpyne@kde.org>
# Copyright © 2003 - 2019 Michael Pyne. <mpyne@kde.org>
# Home page: https://kdesrc-build.kde.org/
#
# Copyright © 2005, 2006, 2008 - 2011 David Faure <faure@kde.org>
......
......@@ -302,8 +302,7 @@ DONE
'revision=i', 'resume-from=s', 'resume-after=s',
'rebuild-failures', 'resume',
'stop-after=s', 'stop-before=s', 'set-module-option-value=s',
'metadata-only', 'include-dependencies', 'list-build',
'dependency-tree',
'metadata-only', 'list-build', 'dependency-tree',
# Special sub used (see above), but have to tell Getopt::Long to look
# for negatable boolean flags
......@@ -2707,7 +2706,7 @@ sub _showHelpMessage
my $scriptVersion = scriptVersion();
say <<DONE;
kdesrc-build $scriptVersion
Copyright (c) 2003 - 2018 Michael Pyne <mpyne\@kde.org> and others, and is
Copyright (c) 2003 - 2019 Michael Pyne <mpyne\@kde.org> and others, and is
distributed under the terms of the GNU GPL v2.
This script automates the download, build, and install process for KDE software
......@@ -2742,6 +2741,7 @@ Important Options:
--stop-after=<pkg> reached.
--include-dependencies Also builds KDE-based dependencies of given modules.
(This is enabled by default; use --no-include-dependencies to disable)
--stop-on-failure Stops the build as soon as a package fails to build.
More docs at https://docs.kde.org/trunk5/en/extragear-utils/kdesrc-build/
......
......@@ -82,6 +82,7 @@ our %defaultGlobalFlags = (
"disable-agent-check" => 0, # If true we don't check on ssh-agent
"disable-snapshots" => 1, # 2016-07-31 Temp. disabled until kde.org fixed to supply snapshots
"ignore-kde-structure" => 0, # Whether to use kde dir structure like extragear/network
"include-dependencies" => 1, # 2019-08-31 Made negatable from cmdline
"install-after-build" => 1,
"install-environment-driver" => 1, # Setup ~/.config/kde-env-*.sh for login scripts
"install-session-driver" => 0, # Above, + ~/.xsession
......
# Sample rc file just for testing purposes
# This should be the same as kdesrc-build-with-deps except for
# include-dependencies
global
source-dir /tmp
make-options -j4
git-repository-base fake git://localhost/git-set/
cmake-options "-DCMAKE_BUILD_TYPE=a b" bar=c baz
cxxflags # empty
# Make sure the cmdline switch in corresponding test is picked up
include-dependencies false
end global
module-set set1
......
# Sample rc file just for testing purposes
# This should be same as kdesrc-buildrc except for include-dependencies
global
source-dir /tmp
make-options -j4
git-repository-base fake git://localhost/git-set/
cmake-options "-DCMAKE_BUILD_TYPE=a b" bar=c baz
cxxflags # empty
# Make sure the cmdline switch in corresponding test is picked up
include-dependencies true
end global
module-set set1
repository fake
use-modules setmod1 setmod2 setmod3
branch fake-branch2
end module-set
module module2
repository git://localhost/git/module2.git
make-options -j2
tag fake-tag5
end module
options setmod2
tag tag-setmod2
end options
use 5.014;
use strict;
use warnings;
# Verify that --no-include-dependencies is recognized and results
# in right value.
use Test::More;
use ksb::Application;
use ksb::Module;
# Redefine ksb::Application::_resolveModuleDependencies to avoid requiring metadata
# module.
package ksb::Application {
no warnings 'redefine';
sub _resolveModuleDependencyGraph {
my $self = shift;
my @modules = @_;
my $newModule = $self->{module_factory}->('setmod2');
my $graph = {
'setmod1' => {
votes => {
'setmod2' => 1,
'setmod3' => 1
},
build => 1,
module => $modules[0]
},
'setmod2' => {
votes => {
'setmod3' => 1
},
build => !!$self->context()->getOption('include-dependencies'),
module => $newModule
},
'setmod3' => {
votes => {},
build => 1,
module => $modules[1]
}
};
my $result = {
graph => $graph
};
return $result;
}
};
my @args = qw(--pretend --rc-file t/data/sample-rc/kdesrc-buildrc-with-deps --no-include-dependencies setmod1 setmod3);
{
my $app = ksb::Application->new(@args);
my @moduleList = @{$app->{modules}};
is (scalar @moduleList, 2, 'Right number of modules (include-dependencies)');
is ($moduleList[0]->name(), 'setmod1', 'mod list[0] == setmod1');
is ($moduleList[1]->name(), 'setmod3', 'mod list[2] == setmod3');
}
{
push @args, '--ignore-modules', 'setmod2';
my $app = ksb::Application->new(@args);
my @moduleList = @{$app->{modules}};
is (scalar @moduleList, 2, 'Right number of modules (include-dependencies+ignore-modules)');
is ($moduleList[0]->name(), 'setmod1', 'mod list[0] == setmod1');
is ($moduleList[1]->name(), 'setmod3', 'mod list[1] == setmod3');
}
done_testing();
  • Quick feedback: with this I can't do anymore for example kdesrc-build kwin to only build kwin.

  • kdesrc-build kwin --resume-from kwin should do it.

  • Oh, that's probably because the "include-dependencies is on by default" was effective in the default config file, but now it's part of the default option values. I'll update that.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment