forked from streamripper/streamripper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade_version.pl
executable file
·48 lines (41 loc) · 1009 Bytes
/
upgrade_version.pl
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
#! /usr/bin/perl
$old_version = "";
$new_version = "";
sub replace_file {
($file) = @_;
$tmp_fn = "uv.tmp";
open TMP, ">$tmp_fn";
open INF, "<$file";
while (<INF>) {
s/$old_version/$new_version/g;
print TMP;
}
close INF;
close TMP;
# `mv $tmp_fn $file`;
rename ($tmp_fn, $file);
}
###############################################################
## main
###############################################################
$old_version = shift;
$new_version = shift;
if (!$new_version) {
$_ = `grep AC_INIT configure.ac`;
chomp;
$_ =~ s/^.*,//;
$_ =~ s/\).*$//;
die "Usage: upgrade_version.pl old_version new_version\nold_verion=$_\n";
}
@files = (
"configure.ac",
"lib/rip_manager.h",
"winamp_plugin/sr163.nsi",
"makedist_win.bat",
"streamripper.1.asc",
);
for $file (@files) {
replace_file ($file);
}
print "Don't forget to check the date in streamripper.1.asc\n";
print "Don't forget to recompile streamripper.1.asc\n";