File: textchk.ver

package info (click to toggle)
textchk 2002.01.10
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 284 kB
  • ctags: 22
  • sloc: perl: 590; makefile: 134
file content (35 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

system ("cp EDITION doc/EDITION");

local ($version) = `cat EDITION`;
chomp ($version);

local ($line) = "";
local ($file) = "";

for $file ("./bin/textchk")
  {
    system ("mv -f $file ${file}.orig");
    print STDOUT ("Changing ${file}.orig to ${file}\n");
    open (INPUT_FILE, "< ${file}.orig");
    open (OUTPUT_FILE, "> $file");

    $line = "";
    while ($line = <INPUT_FILE>)
      {
	if ($line =~ m/^\s*\$VERSION\s+=\s+\"[0-9.]+\";.*$/)
	  {
	    $line = "\$VERSION = \"$version\";\n";
	    print STDOUT ("$file: $line");
	  }
        print OUTPUT_FILE ("$line");
      }
    close (OUTPUT_FILE);
    close (INPUT_FILE);
    system ("chmod a+x $file");

  }

#======================================================================