summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-11-02 18:14:53 +0000
committerOlivier Blin <oblin@mandriva.com>2007-11-02 18:14:53 +0000
commit7fb9052ca741c2e51c1db56d62b28ec796d13dea (patch)
treecc03ff7750f34bba86090bd19d271f0d7304b2ec
parented819bfa786beeb9b22db7649ca43ad9f368b592 (diff)
downloaddraklive-7fb9052ca741c2e51c1db56d62b28ec796d13dea.tar
draklive-7fb9052ca741c2e51c1db56d62b28ec796d13dea.tar.gz
draklive-7fb9052ca741c2e51c1db56d62b28ec796d13dea.tar.bz2
draklive-7fb9052ca741c2e51c1db56d62b28ec796d13dea.tar.xz
draklive-7fb9052ca741c2e51c1db56d62b28ec796d13dea.zip
allow to remove files on live media from live->{media}{remove_files}
-rwxr-xr-xdraklive12
1 files changed, 12 insertions, 0 deletions
diff --git a/draklive b/draklive
index e373f24..e647149 100755
--- a/draklive
+++ b/draklive
@@ -714,6 +714,17 @@ sub copy_files_to {
}
}
+sub join_lists {
+ my ($separator, $head, @lists) = @_;
+ @{$head || []}, map { $separator, @$_ } @lists;
+}
+
+sub remove_files_from {
+ my ($files, $root) = @_;
+ run_('find', $root, '(', join_lists('-o', map { [ '-name', $_ ] } @$files), ')', '-exec', 'rm', '-r', '{}', ';')
+ if $files && @$files;
+}
+
sub post_install_system {
my ($live) = @_;
@@ -798,6 +809,7 @@ sub post_install_system {
if ($live->{media}{files}) {
copy_files_to($live, $live->{media}{files}, get_builddir($live) . $live->{prefix}{build}{files});
}
+ remove_files_from($live->{media}{remove_files}, get_builddir($live) . $live->{prefix}{build}{files});
run_({ setarch => $live->{settings}{arch} },
"chroot", get_system_root($live), "bash", "-c", $live->{system}{postInstall}) if $live->{system}{postInstall};