mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 06:52:43 +02:00
add update script
Origin commit data
------------------
Branch: master
Commit: 0380de3225
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-11-02 (Thu, 02 Nov 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
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