Commit f821c713 authored by Michael Pyne's avatar Michael Pyne
Browse files

xsession: Add option to allow overwriting existing login mgr config.

This implements the command line option mentioned in the last commit, to
allow for overwriting .xsession (and possibly .kde-env-master.sh, if it
exists).

Probably would still be a good idea to make a backup though.
parent a1471899
......@@ -2845,6 +2845,32 @@ aid.</para></note>
</listitem>
</varlistentry>
<varlistentry id="cmdline-delete-my-patches">
<term><parameter>--delete-my-patches</parameter></term>
<listitem><para>
This option is used to let &kdesrc-build; delete source directories that may
contain user data, so that the module can be re-downloaded. This would normally
only be useful for &kde; developers (who might have local changes that would be
deleted).</para>
<para>This is currently only used to checkout modules that have been converted
from &subversion; to &git;. You should not use this option normally,
&kdesrc-build; will prompt to be re-run with it if it is needed.</para>
</listitem>
</varlistentry>
<varlistentry id="cmdline-delete-my-settings">
<term><parameter>--delete-my-settings</parameter></term>
<listitem><para>
This option is used to let &kdesrc-build; overwrite existing files which may contain
user data.</para>
<para>This is currently only used for xsession setup for the login manager. You
should not use this option normally, &kdesrc-build; will prompt to be re-run
with it if it is needed.</para>
</listitem>
</varlistentry>
<varlistentry id="cmdline-global-option">
<term><parameter>--&lt;option-name&gt;=</parameter></term>
<listitem><para>
......
......@@ -1617,6 +1617,7 @@ EOF
"debug" => "",
"debug-level" => ksb::Debug::INFO,
"delete-my-patches" => 0, # Should only be set from cmdline
"delete-my-settings" => 0, # Should only be set from cmdline
"dest-dir" => '${MODULE}', # single quotes used on purpose!
"disable-agent-check" => 0, # If true we don't check on ssh-agent
"do-not-compile" => "",
......@@ -6618,7 +6619,9 @@ sub installCustomFile
if (-e $destFilePath) {
my $existingMD5 = $ctx->getPersistentOption('/digests', $md5KeyName);
if (!$existingMD5 || fileDigestMD5($destFilePath) ne $existingMD5) {
if ((!$existingMD5 || fileDigestMD5($destFilePath) ne $existingMD5) &&
!$ctx->getOption('#delete-my-settings'))
{
error ("\tr[*] Installing \"b[$baseName]\" would overwrite an existing file:");
error ("\tr[*] y[b[$destFilePath]");
error ("\tr[*] If this is acceptable, please delete the existing file and re-run,");
......@@ -7721,6 +7724,11 @@ DONE
last SWITCH;
};
/^--delete-my-settings$/ && do {
$ctx->setOption('#delete-my-settings', 1);
last SWITCH;
};
/^(--revision|-r)=?/ && do {
my $revision = extract_option_value_required($_, @options);
$ctx->setOption('#revision', $revision);
......
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