From 911783c2b61b1abe455456c2fd0d2d0d8384ca1a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 30 Nov 2009 17:14:55 +0000 Subject: extract clean_system_conf_file --- draklive | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'draklive') diff --git a/draklive b/draklive index 32e1544..335e7ba 100755 --- a/draklive +++ b/draklive @@ -227,6 +227,11 @@ sub remove_files_from { if $files && @$files; } +sub clean_system_conf_file { + my ($file) = @_; + substInFile { undef $_ if /^[^#]/ } $live->get_system_root . $file; +} + sub post_install_system { my ($live) = @_; @@ -277,7 +282,7 @@ sub post_install_system { 'perl', '-MStorable', '-e', qq(Storable::store({ UNKNOWN => {} }, '/etc/sysconfig/harddrake2/previous_hw'))); #- remove some build-machine specific configuration - substInFile { undef $_ if /^[^#]/ } $live->get_system_root . $_ + clean_system_conf_file($_) foreach qw(/etc/mtab /etc/modprobe.conf /etc/modprobe.preload /etc/iftab /etc/shorewall/interfaces /etc/mdadm.conf /etc/resolv.conf), if_(!$live->{system}{skip_fstab}, '/etc/fstab'); unlink($_) foreach map { glob($live->get_system_root . $_) } @{$live->{system}{remove_files} || []}; -- cgit v1.2.1