repository for casatablebrowser
Source
open my $fileHandle, ">>", "$app_path/Contents/Resources/qt.conf" or die "Can't open '$app_path/Contents/Resources/qt.conf'\n";
#!/usr/bin/perl
use :: ;
use :: ;
use :: ;
use qw(strftime);
%subst = ( );
@subst_files = ( "private/casatablebrowser.py" );
sub {
my $root = shift(@_);
for $f ( @subst_files ) {
my $path = "$root/$f";
open( , "< $path");
@dest = <>;
close( );
open( , "> $path");
foreach ( @dest ) {
foreach $k ( keys %subst ) {
$k|$subst{$k}|; |
print $_;
}
}
close( );
}
}
sub {
my ($from, $to) = @_;
my $cmd;
if ( - $from || (- $from && $from =~ |/$|) ) {
$cmd = "rsync -aq $from $to";
} else {
$cmd = "rsync -aq $from/ $to";
}
print("\t$cmd\n");
open( , "$cmd 2>&1 |" );
for ( <> ) { print "\t>\t$_" }
close( );
}
sub {
my $path = shift(@_);
my $name = ($path);
my $dir = ($path);
if ( ! - $path ) { die "protobuf spec, '$name', is not a file" }
return ( $dir, $name );
}
$prefix = "";
$app_path = "";
$build_number = "";
foreach ( @ARGV ) {
^ =$| && ( next ); |
^=(.*)| && ( $prefix = $1, next ); |
^=(.*)| && ( $app_path = $1, next ); |
^=(\ +.\ +.\+)$| && ( $build_number = $1, next ); |
if ( |^=(.*)| ) {
print STDERR "build number should be a number (not '$1')\n";
print STDERR " setting build_number to 0.0.1\n";
$build_number = '0.0.1';
next;
}