Bin unused subs

This commit is contained in:
Tor Lillqvist 2011-12-13 09:53:08 +02:00
parent 5b4bcc81e1
commit 5317a92f57

View file

@ -2213,26 +2213,6 @@ sub get_modes {
$build_modes{$option}++;
};
sub get_list_of_modules {
my $option = '';
my $hash_ref = shift;
while ($option = shift @ARGV) {
if ($option =~ /^-+/) {
unshift(@ARGV, $option);
return;
} else {
if ($option =~ /,/) {
foreach (split /,/, $option) {
next if (!$_);
$$hash_ref{$_}++;
};
} else {
$$hash_ref{$option}++;
};
};
};
};
sub get_modules_passed {
my $hash_ref = shift;
my $option = '';
@ -2251,121 +2231,6 @@ sub get_modules_passed {
};
};
sub get_platforms {
my $platforms_ref = shift;
if ($only_platform) {
foreach (split(',', $only_platform)) {
$$platforms_ref{$_}++;
}
$platforms_ref = \%platforms_to_copy;
};
if (!scalar keys %platforms) {
# An Auses wish - fallback to INPATH for new platforms
if (defined $ENV{INPATH}) {
$$platforms_ref{$ENV{INPATH}}++;
} else {
print_error("There is no platform found!!") ;
};
};
};
#
# This procedure clears solver from delivered
# by the modules to be build
#
sub clear_delivered {
my $message = 'Clearing up delivered';
my %backup_vars;
my $deliver_delete_switches = '-delete';
if (scalar keys %platforms < scalar keys %platforms_to_copy) {
$message .= ' without common trees';
$deliver_delete_switches .= ' -dontdeletecommon';
$only_common = '';
};
print "$message\n";
foreach my $platform (keys %platforms) {
print "\nRemoving files delivered for $platform\n";
my %solar_vars = ();
read_ssolar_vars($platform, \%solar_vars);
if (scalar keys %solar_vars) {
foreach (keys %solar_vars) {
if (!defined $backup_vars{$_}) {
$backup_vars{$_} = $ENV{$_};
};
$ENV{$_} = $solar_vars{$_};
};
};
my $undeliver = "$deliver_command $deliver_delete_switches $nul";
foreach my $module (sort @modules_built) {
if (chdir($module_paths{$module})) {
print "Removing delivered from module $module\n";
next if ($show);
if (system($undeliver)) {
$ENV{$_} = $backup_vars{$_} foreach (keys %backup_vars);
print_error("Cannot run: $undeliver");
}
} else {
push(@warnings, "Could not remove delivered files from the module $module. Your build can become inconsistent.\n");
};
};
};
$ENV{$_} = $backup_vars{$_} foreach (keys %backup_vars);
};
#
# Run setsolar for given platform and
# write all variables needed in %solar_vars hash
#
sub read_ssolar_vars {
my ($setsolar, $tmp_file);
$setsolar = $ENV{ENV_ROOT} . '/etools/setsolar.pl';
my ($platform, $solar_vars) = @_;
$setsolar = '/net/jumbo2.germany/buildenv/r/etools/setsolar.pl' if ! -e $setsolar;
$tmp_file = $ENV{HOME} . "/.solar.env.$$.tmp";
if (!-e $setsolar) {
print STDERR "There is no setsolar found. Falling back to current platform settings\n";
return;
}
my $pro = "";
if ($platform =~ /\.pro$/) {
$pro = "-pro";
$platform = $`;
};
my ($source_root, $cwsname);
$source_root = '-sourceroot' if (defined $ENV{SOURCE_ROOT_USED});
my $param = "-$ENV{WORK_STAMP} $source_root $pro $platform";
my $ss_command = "$perl $setsolar -file $tmp_file $param $nul";
if (system($ss_command)) {
unlink $tmp_file;
print_error("Cannot run command:\n$ss_command");
};
get_solar_vars($solar_vars, $tmp_file);
};
#
# read variables to hash
#
sub get_solar_vars {
my ($solar_vars, $file) = @_;
my ($var, $value);
open SOLARTABLE, "<$file" or die "can't open solarfile $file";
while(<SOLARTABLE>) {
s/\r\n//o;
next if(!/^\w+\s+(\w+)/o);
next if (!defined $deliver_env{$1});
$var = $1;
/\'(\S+)\'$/o;
$value = $1;
$$solar_vars{$var} = $value;
};
close SOLARTABLE;
unlink $file;
}
#
# Store all available build modi in %build_modes
#