#!/usr/interp/perl # These are platforms that we build separate trees for. If the platform is # just a symlink in /dept/acm/arch, don't add it here. @platforms=qw(rs_aix41 rs_aix42 sun4x_55 sun4x_56 sgi_62); # Especially with new platforms, often there is binary compatability with # older ones. For this reason, this script is able to handle "also try" # platforms. What this means, for example, is that if an AIX 4.1 platform # directory does not exist for a given package, we will automatically link # in the AIX 3.2.5 platform directory on that package. In that way, if we # find a given package doesnt work on the new platform, we can just add # a specific build of that package for that platform, but otherwise just # use the old ones. # No, these are not recursive. %also_try = ( sun4x_56 => ['sun4x_55','sun4m_412'], sun4x_55 => ['sun4m_412'], rs_aix41 => ['rs_aix32'], rs_aix42 => ['rs_aix41','rs_aix32'], sgi_62 => ['sgi_53','sgi_52'] ); $|=1; print <; if ($foo =~ /n/i) { exit(0); } foreach $platform (@platforms) { system("/dept/acm/packages/run_slink $platform"); } print "\n\nUpdate web pages? "; $foo=; if ($foo =~ /n/i) { exit(0); } system("cd /dept/acm/www/bin; ./slink2html"); #### sub print_badpkgs { undef %tmp; foreach (@pkgs) { if ($good{$_}) { next; } if (/(DIRINFO|ADMININFO)/) { next; } $bad{$_}=1; } if (keys %bad) { print "The following packages were not matched for any platform:\n"; foreach (sort keys %bad) { print " $pkgname{$_}\n"; } } } sub build_infofile { ($platform)=@_; undef @pkgs2; my $pkgs=0; my $goodpkgs=0; open (I,"/tmp/InfoFile.$platform") || die "Can't read InfoFile: $!\n"; my $line=0; while (!eof(I)) { $_=; $line++; if (/^\s*$/) { next; } if (/^\#/) {next; } # read packages. die "Parse Error at line $line\ (no package name)\n$_\n" unless (/^\s*(.+)\s*\{/); $pkg=$1; $pkg=~s/\s*$//g; $pkgname{$pkg}=$pkg; push @pkgs,$pkg; push @pkgs2,$pkg; # print "package name \"$pkg\"\n"; $pkgs++; undef @tmp; while (!eof(I)) { $_=; $line++; if (/NAME\s*=\s*(\S+)/) { $pkgname{$pkg}=$1; } if (/HOME\s*=\s*(\S+)/) { $home=$1; if ($pkg eq "DIRINFO") { $dirhome=$home; # push @tmp,$_; # } elsif ($pkg eq "ADMININFO") { # push @tmp,$_; } } last if /\}/; push @tmp,$_; } @plats=(); push @plats,$platform; push @plats,@{$also_try{$platform}}; foreach $plat (@plats) { if ($home =~ /^\//) { $d="$home/$plat"; } else { $d="$dirhome/$home/$plat"; } if ( $pkg eq "DIRINFO" || $pkg eq "ADMININFO" || ( -e $d) || ($pkg =~ /common/)) { # print "found $dirhome/$home/$plat\n"; print O "$pkg {\n"; foreach (@tmp) { s/\@sys/$plat/g; s@/afs/rpi.edu/dept/acm/arch/tmp@/afs/rpi.edu/dept/acm/arch/new@g; print O; } print O "}\n"; $good{$pkg}=1; $goodpkgs++; last; } } } undef @dups; undef %tmp; foreach (@pkgs2) { if ($tmp{$pkgname{$_}}) { push @dups,$pkgname{$_}; } $tmp{$pkgname{$_}}=1; } if (@dups) { print "The following packages have duplicate definitions:\n"; foreach (@dups) { print " $_\n"; } } print "$platform: $pkgs total, $goodpkgs matched for this platform\n"; } exit(0);