Skip to content

Commit

Permalink
made install platform independent (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Cain committed Jan 17, 2003
1 parent a62c259 commit 94fa5a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
13 changes: 4 additions & 9 deletions conf_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
mkdir($plugindir,0777) or die "unable to mkdir $plugindir\n";
}

# need to remove read-only flag from files to allow File::Copy to work
fixreadonly($plugindir) if $^O =~ /win32/i;

opendir PLUGINS, "conf/plugins" or die "unable to opendir ./conf/plugins\n";
while (my $pluginfile = readdir(PLUGINS) ) {
my $localfile = Bio::Root::IO->catfile('conf/plugins',$pluginfile);
if (-f $localfile) {
my $installfile = Bio::Root::IO->catfile($plugindir, $pluginfile);
chmod (0666, $installfile);
copy($localfile, $installfile)
or die "$localfile unable to copy to $installfile : $!\n";
chmod (0644, $installfile);
}
}
closedir PLUGINS;
Expand All @@ -62,22 +62,17 @@
mkdir($langdir,0777) or die "unable to mkdir $langdir\n";
}

fixreadonly($langdir) if $^O =~ /win32/i;

opendir LANGS, "conf/languages" or die "unable to opendir ./conf/languages\n";
while (my $langfile = readdir(LANGS)) {
my $localfile = Bio::Root::IO->catfile("conf/languages", $langfile);
if (-f $localfile) {
my $installfile = Bio::Root::IO->catfile($langdir, $langfile);
chmod (0666, $installfile);
copy($localfile, $installfile)
or die "unable to copy to $installfile\n";
chmod (0644, $installfile);
}
}
closedir LANGS;

sub fixreadonly {
my $dir = shift;
my $unsetreadonly = Bio::Root::IO->catfile( $dir, "*.*");
system("attrib -r /s $unsetreadonly");
}

17 changes: 6 additions & 11 deletions htdocs_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
mkdir($ht_target,0777) or die "unable to make $ht_target directory\n";
}

fixreadonly($ht_target) if $^O =~ /win32/i;

opendir HTDOCS, "htdocs" or die "unable to opendir htdocs\n";
while (my $file = readdir(HTDOCS) ) {
my $localfile = Bio::Root::IO->catfile('htdocs', $file);
if (-f $localfile) {
my $installfile = Bio::Root::IO->catfile($ht_target, $file);
chmod (0666, $installfile);
copy($localfile, $installfile)
or die "unable to copy to $installfile\n";
chmod (0644, $installfile);
}
}
closedir HTDOCS;
Expand All @@ -44,15 +44,15 @@
mkdir($buttondir,0777) or die "unable to make $buttondir\n";
}

fixreadonly($buttondir) if $^O =~ /win32/i;

opendir BUTTONS, "htdocs/images/buttons" or die "unable to open ./htdocs/images/buttons\n";
while (my $file = readdir(BUTTONS) ) {
my $localfile = Bio::Root::IO->catfile('htdocs/images/buttons',$file);
if (-f $localfile) {
my $installfile = Bio::Root::IO->catfile($buttondir, $file);
chmod (0666, $installfile);
copy($localfile, $installfile)
or die "unable to copy to $installfile\n";
chmod (0644, $installfile);
}
}
closedir BUTTONS;
Expand All @@ -63,15 +63,15 @@
mkdir($helpdir,0777) or die "unable to make $helpdir\n";
}

fixreadonly($helpdir) if $^O =~ /win32/i;

opendir HELP, "htdocs/images/help" or die "unable to open htdocs/images/help\n";
while (my $file = readdir(HELP) ) {
my $localfile = Bio::Root::IO->catfile('htdocs/images/help', $file);
if (-f "./htdocs/images/help/$file") {
my $installfile = Bio::Root::IO->catfile($helpdir, $file);
chmod (0666, $installfile);
copy($localfile, $installfile)
or die "unable to copy to $installfile\n";
chmod (0644, $installfile);
}
}
closedir HELP;
Expand All @@ -85,8 +85,3 @@
# chmod $mode, $tmpdir or die "unable to make $tmpdir world writable\n";
}

sub fixreadonly {
my $dir = shift;
my $unsetreadonly = Bio::Root::IO->catfile( $dir, "*.*");
system("attrib -r /s $unsetreadonly");
}

0 comments on commit 94fa5a6

Please sign in to comment.