repository for casafeather app
Source
xxxxxxxxxx
#!/usr/bin/perl
use qw(abs_path getcwd);
use ;
use :: ;
use :: ;
use :: ;
use :: qw(make_path remove_tree);
use ;
#Fetch failed! HTTP response: 500 Internal Server Error [500 Can't verify SSL peers without knowing which Certificate Authorities to trust] at scripts/create-app line 62.
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$exe = ($0);
$path = ( ($exe));
$java = '/usr/bin/java';
$jarfile_name = "create-app-assembly-1.13.jar";
$app_path_root = '';
foreach ( @ARGV ) {
if ( |=(.*)| && - $1 ) {
$app_path_root = ($1);
last;
}
}
### install path
$distro_jarfile = $jarfile = "$path/java/$jarfile_name";
if ( ! - $jarfile ) {
### development path
$jarfile = "$path/../target/scala-2.12/$jarfile_name";
if ( ! - $jarfile ) {
$jarfile = $distro_jarfile;
### pull from download url
my $jardir = ($jarfile);
$jardir); (
my $ff = ::->new( => 'http://casa.nrao.edu/download/devel/xml-casa/java/' . $jarfile_name);
my $where = $ff-> ( => $jardir );
}
}
die "configuration error, cannot find jar file ($jarfile_name)" unless - $jarfile;
@args = ( ($java), '-jar', $jarfile );
push(@args,@ARGV);
#exec { $java } @args;
$appdir = "";
die "cannot fork: $!" unless defined($pid = open( , "-|"));
if ($pid) { # parent
while (my $line = <>) {
print "$line";
if ( $line =~ |^ \+(.*)$| ) {
$appdir = $1;
}
}
close( ) or warn "kid exited $?";
} else {
# reconfigure, then
exec { $java } @args or die "can't exec program: $!";
}
if ( $appdir ) {
if ( $Config{osname} eq "darwin" ) {
## MacOS doesn't have --verbose, --strip-unneeded options
$strip_command = "strip";
$strip_command_arg = "$appdir/Contents/MacOS";
}
else {
$strip_command = "strip --verbose --strip-unneeded";
$strip_command_arg = "$appdir/usr/bin";
}
=> sub { ( {
print("Checking if $strip_command_arg/$_ is an executable file.\n");
if ( - "$strip_command_arg/$_" && -x "$strip_command_arg/$_" ) {
print ("Stripping: $strip_command" . " $strip_command_arg/$_\n");
system("$strip_command $strip_command_arg/$_") ;
}
}
}, $strip_command_arg);
if ( - $app_path_root ) {
my $set_perm = sub {
if ( - $_ || - $_ ) {
## sometimes perl is a pain
my $mode = (stat($_))[2];
my $user_mode = $mode & 0700;
my $user_minus_write = $user_mode & ~0222;