Bio-Genex
view release on metacpan or search on metacpan
scripts/configure.pl.in view on Meta::CPAN
use Getopt::Long;
use File::Basename;
use File::stat;
my $CONFIG_FILE_NAME = 'Config.pm';
my $st_config;
# first we check if we are being run as part of a complete GeneX
# install, or only as an update to Genex.pm
if (cwd() ne 'scripts' && -e "Bio/Genex/$CONFIG_FILE_NAME") {
$st_config = stat("Bio/Genex/$CONFIG_FILE_NAME");
# nice trick. we wrote the hash out as a perl module using Data:Dumper,
# so to recreate it we just 'require' it ;-)
eval {
use lib '.';
require Bio::Genex::Config;
};
die "$0: Couldn't load local Config.pm: $@\n"
if $@;
} elsif (-e "../Bio/Genex/$CONFIG_FILE_NAME") {
$st_config = stat("../Bio/Genex/$CONFIG_FILE_NAME");
# nice trick. we wrote the hash out as a perl module using Data:Dumper,
# so to recreate it we just 'require' it ;-)
eval {
use lib '..';
require Bio::Genex::Config;
};
die "$0: Couldn't load local Config.pm: $@\n"
if $@;
} else {
scripts/configure.pl.in view on Meta::CPAN
# we don't want to substitute the configure.pl.in
return if /^configure\.pl\.in$/;
my ($outfile) = $File::Find::name =~ m/^(.*)\.in$/;
# we only want to substitute if the infile has been modified
# since we last ran the substitution, or if the config file
# has been modified
if (-f $outfile) {
my $st_out = stat($outfile);
my $st_in = stat($File::Find::name);
# First, if the config file is local, check if the config more
# recent, otherwise check if infile is more recent
if (!defined $st_config || $st_config->mtime < $st_out->mtime) {
# has the infile been modified?
return unless $st_in->mtime > $st_out->mtime;
}
}
open(IN,$File::Find::name) or die "Couldn't open $File::Find::name for reading";
scripts/make_classes.pl view on Meta::CPAN
next TARGET if $CONTROL_ONLY && ! exists $args{controlled};
next TARGET if $LINKING_ONLY && ! exists $args{linking};
my $base = $args{target};
my $dir = "$ROOT/$base";
my $file = "$dir/$base.pm";
die "Couldn't find $file" unless -d $dir;
if (-e $file) {
# if the create script is newer than the .pm file redo the class
my $st_out = stat("$file");
my $st_in = stat("$CREATE");
# otherwise check each class's files
if ($st_in->mtime < $st_out->mtime) {
my @files;
# check the master column2name file
if (exists $args{controlled}) {
push(@files,"$ROOT/ControlledVocab/column2name");
} else {
push(@files,"$ROOT/$base/column2name");
}
# check any supporting column2name files
if (exists $args{support}) {
foreach (@{$args{support}}) {
push(@files,"$ROOT/$_/column2name");
}
}
# go through the files and see if any are more recent
foreach (@files) {
die "Couldn't find $_" unless -e $_;
$st_in = stat($_);
last if $st_in->mtime > $st_out->mtime;
}
# skip this target if none of the files are more recent
if ($st_in->mtime < $st_out->mtime) {
print STDERR "Skipping $file (no change)\n" if $DEBUG;
next TARGET;
}
}
}
scripts/make_classes.pl view on Meta::CPAN
$file = "$ROOT/$args{target}" if $args{target} =~ /\.pl$/;
die "Couldn't find $file" unless -e $file;
my $base = $args{target};
$base =~ s|samples/||;
$base =~ s|scripts/||;
my $pod = $base . '.pod';
# we only want to make a new pod file if the infile has been modified
# since we last ran created the pod file
if (-f "$PODROOT/$pod") {
my $st_out = stat("$PODROOT/$pod");
my $st_in = stat("$file");
if ($st_in->mtime < $st_out->mtime) {
print STDERR "Skipping $file (no change)\n" if $DEBUG;
next;
}
}
my $cmd = "podselect $file > $pod";
print STDERR "$cmd\n";
system("$cmd");
scripts/make_classes.pl view on Meta::CPAN
$file = "$ROOT/$args{target}" if $args{target} =~ /^samples/;
my $base = $args{target};
$base =~ s|samples/||;
$base =~ s|scripts/||;
my $pod = $base . '.pod';
my $html = $base . '.html';
# we only want to make a new html file if the pod file has been changed
# since we last ran created the html file
if (-f "$HTMLROOT/$html") {
my $st_out = stat("$HTMLROOT/$html");
my $st_in = stat("$PODROOT/$pod");
if ($st_in->mtime < $st_out->mtime) {
print STDERR "Skipping $HTMLROOT/$html (no change)\n" if $DEBUG;
next;
}
}
my $cmd = "pod2html $p2h_args --infile=$pod --outfile=$HTMLROOT/$html";
print STDERR "$cmd\n";
system("$cmd");
( run in 0.877 second using v1.01-cache-2.11-cpan-49f99fa48dc )