summaryrefslogtreecommitdiff
path: root/solenv/bin
diff options
context:
space:
mode:
authorTim Retout <tim@retout.co.uk>2012-09-27 19:22:32 +0100
committerTim Retout <tim@retout.co.uk>2012-09-27 19:24:53 +0100
commit0ab561bffadad1eab9eb98c05106f4c0132ccb36 (patch)
treef4c64a3abadc2b792f11cd96fc3b292f6b496d91 /solenv/bin
parentb45263ad292801fd4b32a2f5183508cf4ad7f885 (diff)
installer: Move two copies of make_systemcall into systemactions.pm
Change-Id: I526fae59d28e75d27259867e3fc7e7c99be0d437
Diffstat (limited to 'solenv/bin')
-rw-r--r--solenv/bin/modules/installer/epmfile.pm46
-rw-r--r--solenv/bin/modules/installer/systemactions.pm25
-rw-r--r--solenv/bin/modules/installer/worker.pm27
3 files changed, 37 insertions, 61 deletions
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index 58bca0bb8cb5..157e83d262fa 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -2227,7 +2227,7 @@ sub create_packages_without_epm
my $pkginfoorig = "$destinationdir/$packagename/pkginfo";
my $pkginfotmp = "$destinationdir/$packagename" . ".pkginfo.tmp";
$systemcall = "cp -p $pkginfoorig $pkginfotmp";
- make_systemcall($systemcall);
+ installer::systemactions::make_systemcall($systemcall);
$faspac = $$compressorref;
$infoline = "Found compressor: $faspac\n";
@@ -2236,13 +2236,14 @@ sub create_packages_without_epm
installer::logger::print_message( "... $faspac ...\n" );
installer::logger::include_timestamp_into_logfile("Starting $faspac");
- $systemcall = "/bin/sh $faspac -a -q -d $destinationdir $packagename"; # $faspac has to be the absolute path!
- make_systemcall($systemcall);
+ $systemcall = "/bin/sh $faspac -a -q -d $destinationdir $packagename"; # $faspac has to be the absolute path!
+ installer::systemactions::make_systemcall($systemcall);
- # Setting time stamp for pkginfo, because faspac-so.sh changed the pkginfo file,
- # updated the size and checksum, but not the time stamp.
- $systemcall = "touch -r $pkginfotmp $pkginfoorig";
- make_systemcall($systemcall);
+ # Setting time stamp for pkginfo, because faspac-so.sh
+ # changed the pkginfo file, updated the size and
+ # checksum, but not the time stamp.
+ $systemcall = "touch -r $pkginfotmp $pkginfoorig";
+ installer::systemactions::make_systemcall($systemcall);
if ( -f $pkginfotmp ) { unlink($pkginfotmp); }
installer::logger::include_timestamp_into_logfile("End of $faspac");
@@ -2530,31 +2531,6 @@ sub remove_temporary_epm_files
}
}
-######################################################
-# Making the systemcall
-######################################################
-
-sub make_systemcall
-{
- my ($systemcall) = @_;
-
- my $returnvalue = system($systemcall);
-
- my $infoline = "Systemcall: $systemcall\n";
- push( @installer::globals::logfileinfo, $infoline);
-
- if ($returnvalue)
- {
- $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
- push( @installer::globals::logfileinfo, $infoline);
- }
- else
- {
- $infoline = "Success: Executed \"$systemcall\" successfully!\n";
- push( @installer::globals::logfileinfo, $infoline);
- }
-}
-
###########################################################
# Creating a better directory structure in the solver.
###########################################################
@@ -2683,11 +2659,11 @@ sub unpack_tar_gz_file
# unpacking gunzip
my $systemcall = "cd $destdir; cat $packagename | gunzip | tar -xf -";
- make_systemcall($systemcall);
+ installer::systemactions::make_systemcall($systemcall);
# deleting the tar.gz files
$systemcall = "cd $destdir; rm -f $packagename";
- make_systemcall($systemcall);
+ installer::systemactions::make_systemcall($systemcall);
# Finding new content -> that is the package name
my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent);
@@ -2709,7 +2685,7 @@ sub copy_and_unpack_tar_gz_files
my ($sourcefile, $destdir) = @_;
my $systemcall = "cd $destdir; cat $sourcefile | gunzip | tar -xf -";
- make_systemcall($systemcall);
+ installer::systemactions::make_systemcall($systemcall);
}
######################################################
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index 702b6fedacb0..22d83fb6058b 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -1358,4 +1358,29 @@ sub remove_empty_dirs_in_folder
}
+######################################################
+# Making systemcall
+######################################################
+
+sub make_systemcall
+{
+ my ($systemcall) = @_;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
1;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index b6a19593e002..f860f632df76 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -871,31 +871,6 @@ sub replace_variables_in_string
return $string;
}
-######################################################
-# Making systemcall
-######################################################
-
-sub make_systemcall
-{
- my ($systemcall) = @_;
-
- my $returnvalue = system($systemcall);
-
- my $infoline = "Systemcall: $systemcall\n";
- push( @installer::globals::logfileinfo, $infoline);
-
- if ($returnvalue)
- {
- $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
- push( @installer::globals::logfileinfo, $infoline);
- }
- else
- {
- $infoline = "Success: Executed \"$systemcall\" successfully!\n";
- push( @installer::globals::logfileinfo, $infoline);
- }
-}
-
#################################################################
# Copying the files defined as ScpActions into the
# installation set.
@@ -1419,7 +1394,7 @@ sub collectpackagemaps
my $tarfilename = $subdirname . ".tar";
my $targzname = $tarfilename . ".gz";
$systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname";
- make_systemcall($systemcall);
+ installer::systemactions::make_systemcall($systemcall);
installer::systemactions::remove_complete_directory($pkgmapsubdir, 1);
}