Kaydet (Commit) 0ab561bf authored tarafından Tim Retout's avatar Tim Retout

installer: Move two copies of make_systemcall into systemactions.pm

Change-Id: I526fae59d28e75d27259867e3fc7e7c99be0d437
üst b45263ad
...@@ -2227,7 +2227,7 @@ sub create_packages_without_epm ...@@ -2227,7 +2227,7 @@ sub create_packages_without_epm
my $pkginfoorig = "$destinationdir/$packagename/pkginfo"; my $pkginfoorig = "$destinationdir/$packagename/pkginfo";
my $pkginfotmp = "$destinationdir/$packagename" . ".pkginfo.tmp"; my $pkginfotmp = "$destinationdir/$packagename" . ".pkginfo.tmp";
$systemcall = "cp -p $pkginfoorig $pkginfotmp"; $systemcall = "cp -p $pkginfoorig $pkginfotmp";
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
$faspac = $$compressorref; $faspac = $$compressorref;
$infoline = "Found compressor: $faspac\n"; $infoline = "Found compressor: $faspac\n";
...@@ -2236,13 +2236,14 @@ sub create_packages_without_epm ...@@ -2236,13 +2236,14 @@ sub create_packages_without_epm
installer::logger::print_message( "... $faspac ...\n" ); installer::logger::print_message( "... $faspac ...\n" );
installer::logger::include_timestamp_into_logfile("Starting $faspac"); installer::logger::include_timestamp_into_logfile("Starting $faspac");
$systemcall = "/bin/sh $faspac -a -q -d $destinationdir $packagename"; # $faspac has to be the absolute path! $systemcall = "/bin/sh $faspac -a -q -d $destinationdir $packagename"; # $faspac has to be the absolute path!
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
# Setting time stamp for pkginfo, because faspac-so.sh changed the pkginfo file, # Setting time stamp for pkginfo, because faspac-so.sh
# updated the size and checksum, but not the time stamp. # changed the pkginfo file, updated the size and
$systemcall = "touch -r $pkginfotmp $pkginfoorig"; # checksum, but not the time stamp.
make_systemcall($systemcall); $systemcall = "touch -r $pkginfotmp $pkginfoorig";
installer::systemactions::make_systemcall($systemcall);
if ( -f $pkginfotmp ) { unlink($pkginfotmp); } if ( -f $pkginfotmp ) { unlink($pkginfotmp); }
installer::logger::include_timestamp_into_logfile("End of $faspac"); installer::logger::include_timestamp_into_logfile("End of $faspac");
...@@ -2530,31 +2531,6 @@ sub remove_temporary_epm_files ...@@ -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. # Creating a better directory structure in the solver.
########################################################### ###########################################################
...@@ -2683,11 +2659,11 @@ sub unpack_tar_gz_file ...@@ -2683,11 +2659,11 @@ sub unpack_tar_gz_file
# unpacking gunzip # unpacking gunzip
my $systemcall = "cd $destdir; cat $packagename | gunzip | tar -xf -"; my $systemcall = "cd $destdir; cat $packagename | gunzip | tar -xf -";
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
# deleting the tar.gz files # deleting the tar.gz files
$systemcall = "cd $destdir; rm -f $packagename"; $systemcall = "cd $destdir; rm -f $packagename";
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
# Finding new content -> that is the package name # Finding new content -> that is the package name
my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent); my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent);
...@@ -2709,7 +2685,7 @@ sub copy_and_unpack_tar_gz_files ...@@ -2709,7 +2685,7 @@ sub copy_and_unpack_tar_gz_files
my ($sourcefile, $destdir) = @_; my ($sourcefile, $destdir) = @_;
my $systemcall = "cd $destdir; cat $sourcefile | gunzip | tar -xf -"; my $systemcall = "cd $destdir; cat $sourcefile | gunzip | tar -xf -";
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
} }
###################################################### ######################################################
......
...@@ -1358,4 +1358,29 @@ sub remove_empty_dirs_in_folder ...@@ -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; 1;
...@@ -871,31 +871,6 @@ sub replace_variables_in_string ...@@ -871,31 +871,6 @@ sub replace_variables_in_string
return $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 # Copying the files defined as ScpActions into the
# installation set. # installation set.
...@@ -1419,7 +1394,7 @@ sub collectpackagemaps ...@@ -1419,7 +1394,7 @@ sub collectpackagemaps
my $tarfilename = $subdirname . ".tar"; my $tarfilename = $subdirname . ".tar";
my $targzname = $tarfilename . ".gz"; my $targzname = $tarfilename . ".gz";
$systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname"; $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname";
make_systemcall($systemcall); installer::systemactions::make_systemcall($systemcall);
installer::systemactions::remove_complete_directory($pkgmapsubdir, 1); installer::systemactions::remove_complete_directory($pkgmapsubdir, 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment