[Bioperl-guts-l]
bioperl-live/maintenance symlink_scripts.PLS, NONE, 1.1
Ben faga
faga at pub.open-bio.org
Mon Mar 21 13:36:37 EST 2005
Update of /home/repository/bioperl/bioperl-live/maintenance
In directory pub.open-bio.org:/tmp/cvs-serv7388/maintenance
Added Files:
symlink_scripts.PLS
Log Message:
Since the bp_bulk_load_gff.pl has been replaced with a script that takes the place of both itself (mysql version) and bp_pg_bulk_load_gff.pl (postgresversion), we want to create a symbolic link from postgresversion to bp_bulk_load_gff.pl on install. This will make the change transparent to people who have been using the postgres version.
On make, an external script maintenence/symlink_scripts.pl gets created with all the necessary path info. In the postamble of Makefile.PL, a line was inserted to call the symlink_scripts.pl file. Then on install, symlink_scripts.pl is run and creates the symbolic link.
The Perl symlink function was used to create the link, so that on systems where symlink doesn't work, it catches the error and prints a note tothe user. That is untested though.
--- NEW FILE: symlink_scripts.PLS ---
#!perl
use Config;
use File::Basename qw(&basename &dirname);
use Cwd;
$origdir = cwd;
chdir dirname($0);
$file = basename( $0, '.PL', '.PLS' );
$file .= $^O eq 'VMS' ? '.com' : '.pl';
open OUT, ">$file" or die "Can't create $file: $!";
print "Extracting $file (with variable substitutions)\n";
print OUT "$Config{startperl}\n";
print OUT <<'!NO!SUBS!';
use strict;
my %symlink_scripts = ('bp_bulk_load_gff.pl' => 'bp_pg_bulk_load_gff.pl');
!NO!SUBS!
print OUT 'my $dir = "' . $Config{'installscript'} . '";';
print OUT <<'!NO!SUBS!';
foreach my $target ( keys ( %symlink_scripts ) ) {
unlink "$dir/".$symlink_scripts{$target} if -e "$dir/".$symlink_scripts{$target};
eval { symlink( "$dir/$target", "$dir/".$symlink_scripts{$target} ); 1}
or print STDERR "Cannot create symbolic link named $dir/"
. $symlink_scripts{$target}
. " on you system for $dir/$target\n";
}
!NO!SUBS!
close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
chdir $origdir;
More information about the Bioperl-guts-l
mailing list