head	1.1;
branch	1.1.1;
access;
symbols
	john2:1.1.1.1.0.6
	john1:1.1.1.1
	lapyu-work:1.1.1.1.0.4
	john-work:1.1.1.1.0.2
	SIXALPHA:1.1.1.1
	TEXLIVE:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2000.10.03.04.02.04;	author plaice;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.10.03.04.02.04;	author plaice;	state Exp;
branches;
next	;


desc
@@



1.1
log
@Initial revision
@
text
@eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@@"}'
   & eval 'exec perl -S $0 $argv:q'
   if 0;

# maketext: perl filter to substitute names in scripts and man pages.

%change = ();			# names -> substitutions

# get release and patchlevel for all scripts
open(H, "patchlev.h") || die "can't open patchlev.h";
while(<H>) {
   $change{$1} = $2 if /^\#define\s*(\S*)\s*(\S*)/;
}
close(H);

$os = "" ;

%perlstart = ("UNIX", "\#!PERL\neval 'exec perl -S \$0 \"\$\@@\"'\n\tif \$running_under_some_shell;\n",
	      "DOS", "\@@rem = '-*- Perl -*-\n\@@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n",
	      "WINNT", "\@@rem = '-*- Perl -*-\n\@@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n",
	      "OS2", "extproc PERL -x\n\#! PERL\n",
	      "", "PSUTILS MAKEFILE CONFIGURATION ERROR") ;
%perlend = ("UNIX", "",
	    "DOS", "__END__\n:endofperl\n",
	    "WINNT", "__END__\n:endofperl\n",
	    "OS2", "\# End of Script",
	    "", "PSUTILS MAKEFILE CONFIGURATION ERROR");

foreach (@@ARGV) {
   if (/MAN=(.*)/) {		# name.ext name.ext -> name(ext), name(ext)
      local(@@man) = split(' ', $1);
      $change{"MAN"} = join(", ", grep(s/\.(.)/($1)/, @@man));
   } elsif (/OS=(.*)/) {	# set operating system name
      $os = $1 ;
   } elsif (/PERL=(.*)/) {	# substitute name for value
      local($perl) = $1 ;
      $change{"PERL"} = $perlstart{$os} ;
      $change{"END"} = $perlend{$os} ;
      $change{"PERL"} =~ s/PERL/$perl/g ;
      $change{"END"} =~ s/PERL/$perl/g ;
   } elsif (/(.*)=(.*)/) {	# substitute name for value
      $change{$1} = $2;
   } else {			# open file and substitute
      local(@@change) = keys %change;
      open(FILE, $_) || die "can't open $_";
      while ($line = <FILE>) {
	 grep($line =~ s/\@@$_\@@/$change{$_}/g, @@change);
	 print $line;
      }
      close(FILE);
   }
}
@


1.1.1.1
log
@sun2.dante.de download 2/10/2000 of TeXLive (Omega 1.11)
@
text
@@
