Commits

Ville Suoranta authored 26bc29e6af1 Merge
Merge pull request #58 in CASA/casa-pkg from add-osx-update-pipeline-release510 to release/5.1.0

* commit '5c5100cab1cd2abfa6e6a359bcfc1fd1244508ad': Add script to update pipeline on OSX
No tags

packaging/template/osx/CASA.app/Contents/MacOS/update-pipeline

Added+x
1 +#!/usr/bin/perl
2 +use File::Basename;
3 +use Cwd 'abs_path';
4 +use File::Path;
5 +use File::Copy;
6 +
7 +abs_path($0) =~ m|^(.*/Contents).*|;
8 +unless( $1 ) { die "could not find application contents" }
9 +$prefix = $1;
10 +
11 +chdir( "$prefix/Resources/" ) or die "data resources missing";
12 +
13 +if ( -e "pipeline" or -l "pipeline" ) {
14 + chomp($date_string = `date "+%Y%m%d-%H%M%S"`);
15 + move("pipeline","pipeline.$date_string");
16 +}
17 +
18 +open( RSYNC, "rsync -avz --copy-links rsync://casa-rsync.nrao.edu/casa-pipeline/current/ pipeline 2>&1 |" ) or die $!;
19 +
20 +@output = ( );
21 +$limit = 3;
22 +$msg = '...';
23 +foreach ( <RSYNC> ) {
24 + if ( scalar(@output) < $limit ) {
25 + if ( $verbose ) { print "\t$_" }
26 + }
27 + push( @output, $_ );
28 + if ( scalar(@output) > $limit ) {
29 + shift(@output);
30 + }
31 +}
32 +close(RSYNC);
33 +if ( scalar(@output) > 0 ) { print "\t$msg\n" }
34 +foreach ( @output ) {
35 + print "\t$_";
36 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut