mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
maintain: add version update script
This commit is contained in:
42
upgrade_version.pl
Executable file
42
upgrade_version.pl
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#! /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",
|
||||||
|
);
|
||||||
|
|
||||||
|
for $file (@files) {
|
||||||
|
replace_file ($file);
|
||||||
|
}
|
Reference in New Issue
Block a user