diff options
author | Martin Mokrejs <mmokrejs@fold.natur.cuni.cz> | 2011-07-30 16:45:25 +0200 |
---|---|---|
committer | Martin Mokrejs <mmokrejs@fold.natur.cuni.cz> | 2011-07-30 16:45:25 +0200 |
commit | fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28 (patch) | |
tree | a9d819bfb013ddabcaa5835ab25065dd6bcc2fe9 /sci-biology/gbrowse/files | |
parent | sci-biology/go-db-perl to dev-perl/go-db-perl move (diff) | |
download | sci-fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28.tar.gz sci-fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28.tar.bz2 sci-fa7a65b1a985d0cd4c830b8cac8e63ce2e576c28.zip |
sci-biology/gbrowse: added support for --destdir, patch sent to upstream
(Portage version: 2.1.10.7/git/Linux i686, unsigned Manifest commit)
Diffstat (limited to 'sci-biology/gbrowse/files')
-rw-r--r-- | sci-biology/gbrowse/files/destdir.patch | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/sci-biology/gbrowse/files/destdir.patch b/sci-biology/gbrowse/files/destdir.patch new file mode 100644 index 000000000..655158c04 --- /dev/null +++ b/sci-biology/gbrowse/files/destdir.patch @@ -0,0 +1,92 @@ +--- install_util/GBrowseInstall.pm.ori 2011-07-30 16:06:18.000000000 +0200 ++++ install_util/GBrowseInstall.pm 2011-07-30 16:06:28.000000000 +0200 +@@ -419,6 +419,7 @@ + sub ACTION_install { + my $self = shift; + my $prefix = $self->install_base || $self->prefix || ''; ++ my $destdir = $self->destdir || ''; + GBrowseGuessDirectories->prefix($prefix); + + $self->depends_on('config_data'); +@@ -445,7 +446,7 @@ + + # fix some directories so that www user can write into them + my $tmp = $self->config_data('tmp') || GBrowseGuessDirectories->tmp; +- mkpath($tmp); ++ mkpath($destdir.$tmp); + my ($uid,$gid) = (getpwnam($user))[2,3]; + + # taint check issues +@@ -454,29 +455,29 @@ + $gid =~ /^(\d+)$/; + $gid = $1; + +- unless (chown $uid,$gid,$tmp) { ++ unless (chown $uid,$gid,$destdir.$tmp) { + $self->ownership_warning($tmp,$user); + } + + my $htdocs_i = File::Spec->catfile($self->install_path->{htdocs},'i'); + my $images = File::Spec->catfile($tmp,'images'); + my $htdocs = $self->install_path->{htdocs}; +- chown $uid,-1,$htdocs; ++ chown $uid,-1,$destdir.$htdocs; + { + local $> = $uid; + symlink($images,$htdocs_i); # so symlinkifowner match works! + } +- chown $>,-1,$self->install_path->{htdocs}; ++ chown $>,-1,$destdir.$self->install_path->{htdocs}; + + my $persistent = $self->install_path->{'persistent'}; + my $sessions = File::Spec->catfile($persistent,'sessions'); + my $userdata = File::Spec->catfile($persistent,'userdata'); +- mkpath([$sessions,$userdata],0711); ++ mkpath([$destdir.$sessions,$destdir.$userdata],0711); + + my $databases = $self->install_path->{'databases'}; + +- unless (chown $uid,$gid,glob(File::Spec->catfile($databases,'').'*')) { +- $self->ownership_warning($databases,$user); ++ unless (chown $uid,$gid,glob($destdir.File::Spec->catfile($databases,'').'*')) { ++ $self->ownership_warning($destdir.$databases,$user); + } + + # chmod 0755,File::Spec->catfile($self->install_path->{'etc'},'init.d','gbrowse-slave'); +@@ -490,7 +491,7 @@ + my $perl = $self->perl; + my @inc = map{"-I$_"} split ':',$self->added_to_INC; + system $perl,@inc,$metadb_script; +- system 'sudo','chown','-R',"$uid.$gid",$sessions,$userdata; ++ system 'sudo','chown','-R',"$uid.$gid",$destdir.$sessions,$destdir.$userdata; + + # if (Module::Build->y_n( + # "It is recommended that you restart Apache. Shall I try this for you?",'y' +@@ -600,6 +601,7 @@ + my $self = shift; + + my $prefix = $self->install_base || $self->prefix || ''; ++ my $destdir = $self->destdir || ''; + GBrowseGuessDirectories->prefix($prefix); + my $install_path = GBrowseGuessDirectories->etc; + +@@ -647,7 +649,7 @@ + if ($self->config_data('installconf') =~ /^[yY]/ && !-e "${includes}/$file") { + warn "Creating include file for Apache config: $target\n"; + my $dir = dirname($target); +- mkpath([$dir]); ++ mkpath([$destdir.$dir]); + if (my $f = IO::File->new("blib${includes}/$file",'>')) { + $f->print($self->apache_conf); + $f->close; +@@ -935,8 +937,9 @@ + sub ownership_warning { + my $self = shift; + my ($path,$owner) = @_; ++ my $destdir = $self->destdir || ''; + warn "*** WARNING: Using sudo to change ownership of $path to '$owner'. You may be prompted for your login password ***\n"; +- system "sudo chown -R $owner $path"; ++ system "sudo chown -R $owner $destdir.$path"; + } + + sub cgiurl { |