-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.pl
More file actions
executable file
·70 lines (66 loc) · 1.18 KB
/
Copy pathversion.pl
File metadata and controls
executable file
·70 lines (66 loc) · 1.18 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/perl -w
use strict;
use warnings;
#
# declare local variables
#
my $n;
my @infile;
my $ver;
my $i;
# get version number from version.h
#
$n = "version.h";
open FILE,$n or die "can't open ".$n;
@infile = <FILE>;
foreach(@infile)
{
if($_ =~ /#define\sVER.*/) { ($ver) = $_ =~ /.*(\d\.\d\d).*/; }
}
close FILE;
print "version is $ver\n";
# update version in sysres.spec
#
$n = "sysres.spec";
open FILE,$n or die "can't open ".$n;
@infile = <FILE>;
$i = 0;
foreach(@infile)
{
if($_ =~ /Version.*\d\.\d\d/) { $infile[$i] =~ s/\d.\d\d/$ver/; }
$i ++;
}
close FILE;
open FILE, ">".$n;
print FILE @infile;
close FILE;
# update version in sysres.iss
#
$n = "sysres.iss";
open FILE,$n or die "can't open ".$n;
@infile = <FILE>;
$i = 0;
foreach(@infile)
{
if($_ =~ /AppVer.*\d\.\d\d/) { $infile[$i] =~ s/\d.\d\d/$ver/; }
$i ++;
}
close FILE;
open FILE, ">".$n;
print FILE @infile;
close FILE;
# update version in VS16/readme.txt
#
$n = "VS16/readme.txt";
open FILE,$n or die "can't open ".$n;
@infile = <FILE>;
$i = 0;
foreach(@infile)
{
if($_ =~ /version.*\d\.\d\d/) { $infile[$i] =~ s/\d.\d\d/$ver/; }
$i ++;
}
close FILE;
open FILE,">".$n;
print FILE @infile;
close FILE;