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

Add remove-after-install option to add wish 109044. This can be used to remove

the builddir and/or source dir after a successful module install, for people
with limited disk space.

Supports the following values:
none     - Don't delete anything.  Obviously this is the default.
builddir - Delete the build directory after install.

This isn't a command line option though, it needs to be set in your
~/.kdesvn-buildrc (it is possible to set it via the command line though by
doing --remove-after-install=builddir).


svn path=/trunk/KDE/kdesdk/doc/scripts/kdesvn-build/; revision=434684
parent a1b3fbcb
......@@ -907,6 +907,28 @@ You may use a tilde (~) to represent your home directory.
<row id="conf-remove-after-install">
<entry>Overrides global</entry>
<entry><para>If you are low on hard disk space, you may want to use this option
in order to automatically delete the build directory (or both the source and
build directories for one-time installs) after the module is successfully
<para>Possible values for this option are:
<listitem><para>none - Do not delete anything (This is the default).</para></listitem>
<listitem><para>builddir - Delete the build directory, but not the source.</para></listitem>
<listitem><para>all - Delete both the source code and build directory.</para></listitem>
<para>Note that using this option can have a significant detrimental impact on
both your bandwidth usage (if you use 'all') and the time taken to compile KDE,
since kdesvn-build will be unable to perform incremental builds.</para>
<row id="conf-set-env">
<entry>Overrides global</entry>
......@@ -289,6 +289,7 @@ my %package_opts = (
"reconfigure" => "",
"recreate-configure" => "",
"refresh-build" => "",
"remove-after-install"=> "none", # { none, builddir, all }
"revision" => 0,
"set-env" => { }, # Hash of environment vars to set
"source-dir" => "$ENV{HOME}/kdesvn",
......@@ -3529,6 +3530,27 @@ sub handle_install
return 1; # Error
next if $result != 0; # Don't delete anything if the build failed.
my $remove_setting = get_option($module, 'remove-after-install');
# Possibly remove the srcdir and builddir after install for users with
# a little bit of HD space.
if($remove_setting eq 'all')
# Remove srcdir
my $srcdir = get_fullpath($module, 'source');
print clr "\tRemoving b[r[$module source].\n";
system ('rm', '-rf', $srcdir);
if($remove_setting eq 'builddir' or $remove_setting eq 'all')
# Remove builddir
print clr "\tRemoving b[r[$module build directory].\n";
system ('rm', '-rf', $builddir);
return $result;
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