File: touch-version

package info (click to toggle)
gplanarity 17906-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 732 kB
  • sloc: ansic: 8,776; makefile: 131; perl: 17; sed: 2
file content (21 lines) | stat: -rwxr-xr-x 378 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

if(open F,"version.h"){
	$line=<F>;
	close F;

	if(open F,">version.h"){
	
	    print F "$line";
	    chomp($line=`date`);
	    print F "/* DO NOT EDIT: Automated versioning hack [$line] */\n";
	    close F;
	    0;
	}else{
	    print "touch-version: Failed to write new version.h\n";
	    1;
	}
}else{
	print "touch-version: Failed to open version.h\n";
	1;
}