Ignore:
Timestamp:
05/10/2008 16:14:24 (4 years ago)
Author:
chris
Message:

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).

Location:
box/trunk/infrastructure
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • box/trunk/infrastructure/BoxPlatform.pm.in

    r2242 r2328  
    66BEGIN 
    77{ 
    8  
    98        # which OS are we building under? 
    109        $target_os = '@target_os@'; 
     
    3938 
    4039        # get version 
    41         if (! -r "VERSION.txt" and -r "../../VERSION.txt") 
    42         { 
    43                 open VERSION,"../../VERSION.txt" or die "../../VERSION.txt: $!"; 
    44         } 
    45         else 
    46         { 
    47                 open VERSION,"VERSION.txt" or die "VERSION.txt: $!"; 
    48         } 
     40        my $version_file = "VERSION.txt"; 
     41        if (not -r $version_file) { $version_file = "../../$version_file" } 
     42        die "missing version file: $version_file" unless $version_file; 
    4943 
     44        open VERSION, $version_file or die "$version_file: $!"; 
    5045        $product_version = <VERSION>; 
    5146        chomp $product_version; 
     
    5348        chomp $product_name; 
    5449        close VERSION; 
     50 
    5551        if($product_version =~ /USE_SVN_VERSION/) 
    5652        { 
     
    117113} 
    118114 
     115sub parcel_root 
     116{ 
     117        my $tos = $_[1] || $target_os; 
     118        return $product_name.'-'.$product_version.'-'.$_[0].'-'.$tos; 
     119} 
     120 
     121sub parcel_dir 
     122{ 
     123        'parcels/'.parcel_root($_[0], $_[1]) 
     124} 
     125 
     126sub parcel_target 
     127{ 
     128        parcel_dir($_[0]).'.tgz' 
     129} 
     130 
    1191311; 
    120132 
  • box/trunk/infrastructure/makeparcels.pl.in

    r2323 r2328  
    9999for my $parcel (@parcels) 
    100100{ 
    101         print MAKE "\trm -rf ",parcel_dir($parcel),"\n"; 
    102         print MAKE "\trm -f ",parcel_target($parcel),"\n"; 
     101        print MAKE "\trm -rf ", BoxPlatform::parcel_dir($parcel),    "\n"; 
     102        print MAKE "\trm -f ",  BoxPlatform::parcel_target($parcel), "\n"; 
    103103} 
    104104print MAKE "\tif [ `uname -o` = 'Cygwin' ]; then find release debug -type f | xargs -r rm -f; else find release debug -type f -exec rm -f {} \\;; fi\n"; 
     
    111111for my $parcel (@parcels) 
    112112{ 
    113         my $target = parcel_target($parcel); 
    114         my $dir = parcel_dir($parcel); 
     113        my $target = BoxPlatform::parcel_target($parcel); 
     114        my $dir    = BoxPlatform::parcel_dir($parcel); 
    115115        my @parcel_deps; 
    116116 
     
    216216        } 
    217217         
    218         my $root = parcel_root($parcel); 
     218        my $root = BoxPlatform::parcel_root($parcel); 
    219219 
    220220        unless ($target_windows) 
     
    257257close INSTALLMSG; 
    258258 
    259 sub parcel_root 
    260 { 
    261         $product_name.'-'.$product_version.'-'.$_[0].'-'.$target_os 
    262 } 
    263  
    264 sub parcel_dir 
    265 { 
    266         'parcels/'.parcel_root($_[0]) 
    267 } 
    268  
    269 sub parcel_target 
    270 { 
    271         parcel_dir($_[0]).'.tgz' 
    272 } 
  • box/trunk/infrastructure/parcelpath.pl

    r1078 r2328  
    11#!perl 
    22 
     3unless (@ARGV == 2) 
     4{ 
     5        die "Usage: $0 <parcel-name> <target-os>\n"; 
     6} 
     7 
    38$basedir = $0; 
    4 $basedir =~ s/\\[^\\]*$//; 
    5 $basedir =~ s/\\[^\\]*$//; 
    6 $basedir =~ s/\\[^\\]*$//; 
    7 $basedir =~ s/\\[^\\]*$//; 
    8 $basedir =~ s/\\[^\\]*$//; 
     9$basedir =~ s|/.*||; 
     10$basedir .= "/.."; 
    911-d $basedir or die "$basedir: $!"; 
    1012chdir $basedir or die "$basedir: $!"; 
     13require "infrastructure/BoxPlatform.pm.in"; 
    1114 
    12 require "$basedir\\infrastructure\\BoxPlatform.pm.in"; 
    13  
    14 open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h"  
    15         or die "BoxVersion.h: $!"; 
    16 print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n"; 
    17 close VERSIONFILE; 
     15print BoxPlatform::parcel_dir(@ARGV) . "\n"; 
    1816 
    1917exit 0; 
Note: See TracChangeset for help on using the changeset viewer.