summaryrefslogtreecommitdiffstats
path: root/boot-env/OpenSLX/BootEnvironment/Base.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-08-31 17:41:30 +0200
committerOliver Tappe2008-08-31 17:41:30 +0200
commit6c0f5af254eca9e3b093052e1cae898e3b1a7c38 (patch)
treefb7079c189360f412327c8a02a19d07d9e080196 /boot-env/OpenSLX/BootEnvironment/Base.pm
parent* made bastians script compatible with stage1 chroot (diff)
downloadcore-6c0f5af254eca9e3b093052e1cae898e3b1a7c38.tar.gz
core-6c0f5af254eca9e3b093052e1cae898e3b1a7c38.tar.xz
core-6c0f5af254eca9e3b093052e1cae898e3b1a7c38.zip
* refactored slxconfig-demuxer and boot environment implementations such that
demuxing to more than a single boot environment is supported now * renamed boot environment CD to PREBOOT_CD git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2160 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'boot-env/OpenSLX/BootEnvironment/Base.pm')
-rw-r--r--boot-env/OpenSLX/BootEnvironment/Base.pm32
1 files changed, 30 insertions, 2 deletions
diff --git a/boot-env/OpenSLX/BootEnvironment/Base.pm b/boot-env/OpenSLX/BootEnvironment/Base.pm
index bd8bef55..af47f859 100644
--- a/boot-env/OpenSLX/BootEnvironment/Base.pm
+++ b/boot-env/OpenSLX/BootEnvironment/Base.pm
@@ -18,6 +18,8 @@ use warnings;
our $VERSION = 1.01; # API-version . implementation-version
+use File::Path;
+
use OpenSLX::Basics;
use OpenSLX::ConfigDB;
@@ -35,12 +37,38 @@ sub initialize
my $self = shift;
my $params = shift;
- $self->{'target-path'} = $params->{'target-path'};
- $self->{'dry-run'} = $params->{'dry-run'};
+ $self->{'dry-run'} = $params->{'dry-run'};
return 1;
}
+sub finalize
+{
+ my $self = shift;
+ my $delete = shift;
+
+ return 1 if $self->{'dry-run'};
+
+ my $rsyncDeleteClause = $delete ? '--delete' : '';
+ my $rsyncCmd
+ = "rsync -a $rsyncDeleteClause --delay-updates $self->{'target-path'}/ $self->{'original-path'}/";
+ slxsystem($rsyncCmd) == 0
+ or die _tr(
+ "unable to rsync files from '%s' to '%s'! (%s)",
+ $self->{'target-path'}, $self->{'original-path'}, $!
+ );
+ rmtree([$self->{'target-path'}]);
+
+ return 1;
+}
+
+sub targetPath
+{
+ my $self = shift;
+
+ return $self->{'target-path'};
+}
+
sub writeBootloaderMenuFor
{
my $self = shift;