diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-11-02 18:14:53 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-11-02 18:14:53 +0000 |
commit | 7fb9052ca741c2e51c1db56d62b28ec796d13dea (patch) | |
tree | cc03ff7750f34bba86090bd19d271f0d7304b2ec | |
parent | ed819bfa786beeb9b22db7649ca43ad9f368b592 (diff) | |
download | draklive-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-x | draklive | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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}; |