[sdk/kdesrc-build] /: Revert "doc: List --run in commonly used options"

Sune Vuorela null at kde.org
Wed Mar 6 15:53:02 GMT 2024


Git commit 3825bdcf91f369b8df1aca822d2943042147ba6c by Sune Vuorela.
Committed on 06/03/2024 at 09:09.
Pushed by sune into branch 'master'.

Revert "doc: List --run in commonly used options"

This reverts commit 19044150a44a2f7a18d89a1e74dbcc0b5f696c6e.

M  +42   -54   doc/cmdline.docbook
M  +69   -6    modules/ksb/Cmdline.pm

https://invent.kde.org/sdk/kdesrc-build/-/commit/3825bdcf91f369b8df1aca822d2943042147ba6c

diff --git a/doc/cmdline.docbook b/doc/cmdline.docbook
index 0ad480d0..a3380279 100644
--- a/doc/cmdline.docbook
+++ b/doc/cmdline.docbook
@@ -17,6 +17,48 @@ kdesrc-build will build all modules defined in its configuration file, in the
 order listed in that file (although this can be modified by various
 configuration file options).</para>
 
+<sect2 id="cmdline-usage-options">
+<title>Commonly used command line options</title>
+
+<para>The full list of command line options is given in <xref
+linkend="supported-cmdline-params"/>. The most-commonly used options
+include:</para>
+
+<variablelist>
+  <varlistentry>
+    <term><option>--pretend</option> (or <option>-p</option>)</term>
+    <listitem><para>This option causes &kdesrc-build; to indicate what actions
+    it would take, without actually really implementing them. This can be
+    useful to make sure that the modules you think you are building will
+    actually get built.</para></listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--refresh-build</option></term>
+    <listitem><para>This option forces &kdesrc-build; to build the given
+    modules from an absolutely fresh start point. Any existing build directory
+    for that module is removed and it is rebuilt. This option is useful if you
+    have errors building a module, and sometimes is required when &Qt; or &kde;
+    libraries change.</para></listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--no-src</option></term>
+    <listitem><para>This option skips the source update process. You might use
+    it if you have very recently updated the source code (perhaps you did it
+    manually or recently ran &kdesrc-build;) but still want to rebuild some
+    modules.</para></listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--no-build</option></term>
+    <listitem><para>This option is similar to <option>--no-src</option> above,
+    but this time the build process is skipped.</para></listitem>
+  </varlistentry>
+</variablelist>
+
+</sect2>
+
 <sect2 id="cmdline-usage-modules">
 <title>Specifying modules to build</title>
 
@@ -54,60 +96,6 @@ option before building a new module set to ensure it is only building the
 modules you want.</para>
 
 </sect2>
-
-<sect2 id="cmdline-commonly-used-options">
-    <title>Commonly used command line options</title>
-    
-    <variablelist>
-      <varlistentry>
-        <term><option>--pretend</option> (or <option>-p</option>)</term>
-        <listitem><para>This option causes &kdesrc-build; to indicate what actions
-          it would take, without actually really implementing them. This can be
-          useful to make sure that the modules you think you are building will
-          actually get built.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>--no-src</option></term>
-        <listitem><para>This option skips the source update process. You might use
-          it if you have very recently updated the source code (perhaps you did it
-          manually or recently ran &kdesrc-build;) but still want to rebuild some
-          modules.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>--no-include-dependencies</option> (or <option>-D</option>)</term>
-        <listitem><para>Only process the selected modules, skipping their dependencies.
-          Useful when you have changed only selected modules, and you are sure you
-          do not need to rebuild the others.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>--refresh-build</option> (or <option>-r</option>)</term>
-        <listitem><para>This option forces &kdesrc-build; to build the given
-          modules from an absolutely fresh start point. Any existing build directory
-          for that module is removed and it is rebuilt. This option is useful if you
-          have errors building a module, and sometimes is required when &Qt; or &kde;
-          libraries change.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>--resume-from</option> module</term>
-        <listitem><para>Skips modules until just before the given module, then operates as normal.
-          Useful when the previous build failed on specific module, you fixed it, and then you
-          want to continue the with building the rest of initial set of modules.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
-        <term><option>--run</option> module</term>
-        <listitem><para>Launch the built application.</para></listitem>
-      </varlistentry>
-    </variablelist>
-  
-  <para>The full list of command line options is given in <xref
-  linkend="supported-cmdline-params"/>.</para>
-  
-  </sect2>
 </sect1>
 
 &supported-envvars;
diff --git a/modules/ksb/Cmdline.pm b/modules/ksb/Cmdline.pm
index 21cd1125..10ab597a 100644
--- a/modules/ksb/Cmdline.pm
+++ b/modules/ksb/Cmdline.pm
@@ -323,14 +323,77 @@ sub _showVersionAndExit
 
 sub _showHelpAndExit
 {
-    say <<~DONE;
-        This script automates the download, build, and install process for KDE software using the latest available source code.
+    # According to XDG spec, if $XDG_CONFIG_HOME is not set, then we should
+    # default to ~/.config
+    my $xdgConfigHome = $ENV{XDG_CONFIG_HOME} // "$ENV{HOME}/.config";
+    my $xdgConfigHomeShort = $xdgConfigHome =~ s/^$ENV{HOME}/~/r; # Replace $HOME with ~
+
+    my $pwd = $ENV{PWD};
+    my $pwdShort = $pwd =~ s/^$ENV{HOME}/~/r; # Replace $HOME with ~
 
-        Documentation at https://docs.kde.org/?application=kdesrc-build
-            Commonly used command line options:             https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/cmdline.html#cmdline-commonly-used-options
-            Supported command-line parameters:              https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/supported-cmdline-params.html
-            Table of available configuration options:       https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html
+    my $scriptVersion = scriptVersion();
+
+    say <<~DONE;
+        kdesrc-build $scriptVersion
+        Copyright (c) 2003 - 2023 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
+        using the latest available source code.
+
+        Configuration is controlled from "$pwdShort/kdesrc-buildrc" or
+        "$xdgConfigHomeShort/kdesrc-buildrc".
+        See kdesrc-buildrc-sample for an example.
+
+        Usage: \$ $0 [--options] [module names]
+            All configured modules are built if none are listed.
+
+        Important Options:
+            --pretend (or -p)      Don't actually take major actions, instead describe
+                                   what would be done.
+            --dependency-tree      Print out dependency information on the modules that
+                                   would be built, using a `tree` format. Very useful
+                                   for learning how modules relate to each other. May
+                                   generate a lot of output.
+            --no-src   (or -S)     Don't update source code, just build/install.
+            --src-only (or -s)     Only update the source code
+            --metadata-only        Only update dependency info and KDE project database
+            --refresh-build        Start the build from scratch.
+              (or -r)
+            --rc-file=<filename>   Read configuration from filename instead of default.
+            --initial-setup        Installs required system pkgs, and a base kdesrc-buildrc.
+
+            --resume-from=<pkg>    Skips modules until just before or after the given
+            --resume-after=<pkg>       package, then operates as normal.
+            --stop-before=<pkg>    Stops just before or after the given package is
+            --stop-after=<pkg>         reached.
+
+            --include-dependencies
+             -d                    Also builds KDE-based dependencies of given modules.
+              (This is enabled by default; use --no-include-dependencies or -D to disable)
+
+        More docs at https://docs.kde.org/?application=kdesrc-build
+            Supported configuration options: https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html
+            Supported cmdline options:       https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/cmdline.html
         DONE
+
+    # Look for indications that this is the first run
+    my @possibleConfigPaths = ("./kdesrc-buildrc",
+                               "$xdgConfigHome/kdesrc-buildrc",
+                               "$ENV{HOME}/.kdesrc-buildrc");
+
+    if (!grep { -e $_ } (@possibleConfigPaths)) {
+        say <<~DONE;
+              **  **  **  **  **
+            It looks like kdesrc-build has not yet been setup. For easy setup, run:
+                $0 --initial-setup
+
+            This will run your system's
+            package manager to install required dependencies, and setup a kdesrc-buildrc
+            that can be edited from there.
+            DONE
+    }
+
     exit;
 }
 



More information about the kde-doc-english mailing list