summaryrefslogtreecommitdiff
path: root/insert-version.pl
diff options
context:
space:
mode:
Diffstat (limited to 'insert-version.pl')
-rwxr-xr-xinsert-version.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/insert-version.pl b/insert-version.pl
new file mode 100755
index 000000000..4b1451d9b
--- /dev/null
+++ b/insert-version.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/perl --
+chop($v=`pwd`);
+$v =~ s,^.*/dpkg-,, || die;
+$v =~ s,/\w+$,,;
+$v =~ m,^[-0-9.]+$, || die;
+while (<STDIN>) {
+ $_= $1.$v.$2."\n" if
+ m|^(#define DPKG_VERSION ")[-0-9.]+(" /\* This line modified by Makefile \*/)$|;
+ $_= $1.$v.$2."\n" if
+ m/^(\$version= ')[-0-9.]+('; # This line modified by Makefile)$/;
+ $_= $1.$v.$2."\n" if
+ m/^(version=")[-0-9.]+("; # This line modified by Makefile)$/;
+ print || die;
+}