aboutsummaryrefslogtreecommitdiffstats
path: root/version.pl
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-05 01:01:29 +0000
committerhpa <hpa>2005-01-05 01:01:29 +0000
commit80717f76b561e490cf862c87be2e3ef1e5596b37 (patch)
treed5b7b3359e765ea6c2647962c5270034df29f65b /version.pl
parent76508a9bc942a693dc8ac773fc471501580d7bbf (diff)
downloadsyslinux.git-80717f76b561e490cf862c87be2e3ef1e5596b37.tar.gz
syslinux.git-80717f76b561e490cf862c87be2e3ef1e5596b37.tar.xz
syslinux.git-80717f76b561e490cf862c87be2e3ef1e5596b37.zip
Allow the user to override the extlinux detected geometry; add online help
Diffstat (limited to 'version.pl')
-rwxr-xr-xversion.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/version.pl b/version.pl
index fa09e40d..39d42a03 100755
--- a/version.pl
+++ b/version.pl
@@ -5,7 +5,7 @@
use Fcntl;
-$vfile = $ARGV[0];
+($vfile, $vout, $def) = $ARGV[0];
sysopen(VERSION, $vfile, O_RDONLY) or die "$0: Cannot open $vfile\n";
$version = <VERSION>;
chomp $version;
@@ -16,10 +16,11 @@ unless ( $version =~ /^([0-9]+)\.([0-9]+)$/ ) {
}
$vma = $1+0; $vmi = $2+0;
-open(VI, "> version.gen") or die "$0: Cannot create version.gen\n";
-print VI "%define VERSION \"$version\"\n";
-print VI "%define VER_MAJOR $vma\n";
-print VI "%define VER_MINOR $vmi\n";
+sysopen(VI, $vout, O_WRONLY|O_CREAT|O_TRUNC)
+ or die "$0: Cannot create $vout: $!\n";
+print VI "$def VERSION \"$version\"\n";
+print VI "$def VER_MAJOR $vma\n";
+print VI "$def VER_MINOR $vmi\n";
close(VI);