Files
recycled-ni-neutrino/upgrade_version.pl
Thilo Graf 56ec7b2dbf maintain: add version update script
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7dba5bc73c
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-10-16 (Mon, 16 Oct 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
2017-10-17 20:02:02 +02:00

43 lines
786 B
Perl
Executable File

#! /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);
}