diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-10-05 15:14:24 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-10-05 15:14:24 +0000 |
commit | ef0777633f49ac643c7184cb2c26dcb798eaf1c6 (patch) | |
tree | ad8146df952a19ef79a8f4a6ddd92b406dae7ff1 /infrastructure/BoxPlatform.pm.in | |
parent | 31c892532d5be4ebb92d26f35f726c1fbbfd6fba (diff) |
Move parcel_* functions into BoxPlatform package to share them with
other scripts.
Add a script to print the path to the current parcel directory, for
use in configure.ac to allow this to be placed in substitutions
(contrib/windows/installer/boxbackup.mpi in particular).
Diffstat (limited to 'infrastructure/BoxPlatform.pm.in')
-rw-r--r-- | infrastructure/BoxPlatform.pm.in | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/infrastructure/BoxPlatform.pm.in b/infrastructure/BoxPlatform.pm.in index f5c55f25..8657134e 100644 --- a/infrastructure/BoxPlatform.pm.in +++ b/infrastructure/BoxPlatform.pm.in @@ -5,7 +5,6 @@ use Exporter; BEGIN { - # which OS are we building under? $target_os = '@target_os@'; $target_windows = 0; @@ -38,20 +37,17 @@ BEGIN $platform_exe_ext = '@EXEEXT@'; # get version - if (! -r "VERSION.txt" and -r "../../VERSION.txt") - { - open VERSION,"../../VERSION.txt" or die "../../VERSION.txt: $!"; - } - else - { - open VERSION,"VERSION.txt" or die "VERSION.txt: $!"; - } + my $version_file = "VERSION.txt"; + if (not -r $version_file) { $version_file = "../../$version_file" } + die "missing version file: $version_file" unless $version_file; + open VERSION, $version_file or die "$version_file: $!"; $product_version = <VERSION>; chomp $product_version; $product_name = <VERSION>; chomp $product_name; close VERSION; + if($product_version =~ /USE_SVN_VERSION/) { # for developers, use SVN version @@ -116,5 +112,21 @@ sub make_flag return $_[0].'=1'; } +sub parcel_root +{ + my $tos = $_[1] || $target_os; + return $product_name.'-'.$product_version.'-'.$_[0].'-'.$tos; +} + +sub parcel_dir +{ + 'parcels/'.parcel_root($_[0], $_[1]) +} + +sub parcel_target +{ + parcel_dir($_[0]).'.tgz' +} + 1; |