[Lxr-commits] CVS: lxr/lib/LXR/Files BK.pm, 1.12, 1.13 GIT.pm, 1.16, 1.17 Mercurial.pm, 1.4, 1.5 Su
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2013-12-03 13:38:27
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15286/lib/LXR/Files Modified Files: BK.pm GIT.pm Mercurial.pm Subversion.pm Log Message: Files/*.pm, templates/global.conf.part: new 'xxxpath' parameters (similar to 'cvspath') These parameters allow to use privately installed source code management utilities if not system provided (changes to BK [valid?], git, mercurial and subversion modules). Index: BK.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/BK.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- BK.pm 7 Nov 2013 17:58:48 -0000 1.12 +++ BK.pm 3 Dec 2013 13:38:23 -0000 1.13 @@ -68,6 +68,7 @@ $self = bless({}, $self); $self->{'rootpath'} = substr($config->{'sourceroot'}, 3); $self->{'rootpath'} =~ s!/*$!!; + $self->{'path'} = $config->{'cvspath'}; die 'Must specify a cache directory when using BitKeeper' if !(ref($params) eq 'HASH'); $self->{'cache'} = $config->{'sourceparams'}{'cachepath'}; return $self; @@ -200,6 +201,7 @@ my $dir = getcwd(); chdir($self->{'rootpath'}); my $fileh = IO::File->new(); + $ENV{'PATH'} = $self->{'path'}; $fileh->open($command) or die "Can't execute $command"; chdir($dir); return $fileh; Index: GIT.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/GIT.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- GIT.pm 8 Nov 2013 14:22:25 -0000 1.16 +++ GIT.pm 3 Dec 2013 13:38:23 -0000 1.17 @@ -71,6 +71,7 @@ || $config->{'sourceparams'}{'git_blame'}; # Blame support will only work when commit IDs are available, # called annotations here... + $self->{'path'} = $config->{'gitpath'}; return $self; } @@ -367,6 +368,7 @@ } my $git; $! = ''; + $ENV{'PATH'} = $self->{'path'}; open ( $git , '-|' , 'git' Index: Mercurial.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/Mercurial.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Mercurial.pm 8 Nov 2013 14:22:25 -0000 1.4 +++ Mercurial.pm 3 Dec 2013 13:38:23 -0000 1.5 @@ -60,6 +60,7 @@ . ';HGRCPATH=' . $rootpath . '/hg.rc hg '; $cmd =~ m/(.*)/; $self->{'hg-cmd'} = $1; # Untaint string + $self->{'path'} = $config->{'hgpath'}; return $self; } @@ -73,6 +74,7 @@ # Paths on the hg command lines must not start with a slash # to be relative to 'rootpath'. Changes LXR convention. $hgpath =~ s,^/+,,; + $ENV{'PATH'} = $self->{'path'}; open(DIR, $$self{'hg-cmd'} . "ls-onelevel -r \"$releaseid\" \"$hgpath\" |") or die ("hg subprocess died unexpectedly: $!"); @@ -120,6 +122,7 @@ my ($self, $filename, $releaseid) = @_; my ($rev, $outrev); + $ENV{'PATH'} = $self->{'path'}; $filename =~ s,^/+,,; $self->parsehg($filename); if ($releaseid !~ m/^\d+$/) { @@ -168,8 +171,9 @@ # checked out content can be read. sub getfilehandle { my ($self, $filename, $releaseid, $withannot) = @_; - my ($fileh); + my $fileh; + $ENV{'PATH'} = $self->{'path'}; $filename =~ s,^/+,,; $filename =~ m/(.*)/; $filename = $1; @@ -241,6 +245,7 @@ my $rev = $self->filerev($filename, $releaseid); $rev =~ m/(.*)/; $rev = $1; + $ENV{'PATH'} = $self->{'path'}; my $fsize = `$$self{'hg-cmd'} fsize -r $rev $filename`; return $fsize; } @@ -302,6 +307,7 @@ my ($self, $filename) = @_; my @tags; + $ENV{'PATH'} = $self->{'path'}; open(TAGS, $$self{'hg-cmd'} . 'tags |') or die("hg subprocess died unexpextedly: $!"); @@ -334,6 +340,7 @@ my ($self, $filename) = @_; my @brch; + $ENV{'PATH'} = $self->{'path'}; open(BRANCH, $$self{'hg-cmd'} . 'branches |') or die("hg subprocess died unexpextedly: $!"); @@ -380,6 +387,7 @@ $filename =~ m/(.*)/; $filename = $1; my $file = ''; + $ENV{'PATH'} = $self->{'path'}; # This log request with a template retrieves only the LXR-relevant # data, i.e. changeset-id and commit time. open(HG, $$self{'hg-cmd'} Index: Subversion.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/Subversion.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Subversion.pm 8 Nov 2013 14:22:25 -0000 1.8 +++ Subversion.pm 3 Dec 2013 13:38:23 -0000 1.9 @@ -52,6 +52,7 @@ $self->{'svn_annotations'} = $config->{'sourceparams'}{'svn_annotations'} # Blame support will only work when annotations are available, or $config->{'sourceparams'}{'svn_blame'}; + $self->{'path'} = $config->{'svnpath'}; return $self; } @@ -66,6 +67,7 @@ $path = $self->revpath($pathname, $releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; open(DIR, "svn list $path |") or die("svn subprocess died unexpextedly: $!"); @@ -92,6 +94,7 @@ $uri = $self->revpath($filename,$releaseid); $uri =~ m/(.*)/; $uri = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; open(ANNO,"svn blame $uri |") or die("svn subprocess died unexpextedly: $!"); while( <ANNO> ) { @@ -133,6 +136,7 @@ my $path = $self->revpath($filename, $releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; my $res = `LANGUAGE=en svn info $path|grep 'Last Changed Rev'`; $res =~ m/(\d+)/; return $1; @@ -146,6 +150,7 @@ my ($self, $filename, $releaseid, $withannot) = @_; my $fileh; + $ENV{'PATH'} = $self->{'path'}; my $path = $self->revpath($filename, $releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path @@ -212,6 +217,7 @@ my $path = $self->revpath($filename,$releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; $res = `svn list -v $path`; $res =~ m/\s*\d+\s+\w+\s+(?:O\s+)?(\d+)/; return $1; @@ -225,6 +231,7 @@ my $path = $self->revpath($filename,$releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; $line = `LANGUAGE=en svn info $path|grep 'Last Changed Date'`; $line =~ m/(\d[\d-+ :]+)/; $line = $1; @@ -250,6 +257,7 @@ my $path = $self->revpath($pathname,$releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; my $res = `LANGUAGE=en svn info $path 2>/dev/null|grep 'Node Kind'`; return index($res, 'directory') >= 0; } @@ -260,6 +268,7 @@ my $path = $self->revpath($pathname,$releaseid); $path =~ m/(.*)/; $path = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; my $res = `LANGUAGE=en svn info $path 2>/dev/null|grep 'Node Kind'`; return index($res, 'file') >= 0; } @@ -300,6 +309,7 @@ $uri = $self->{'rootpath'} . '/trunk' . $filename; $uri =~ m/(.*)/; $uri = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; open(LOG,"svn log $uri |") or die("svn subprocess died unexpextedly: $!"); while(<LOG>){ @@ -319,6 +329,7 @@ $uri = $self->{'rootpath'} . '/branches'; $uri =~ m/(.*)/; $uri = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; open(BRCH,"svn list $uri |") or die("svn subprocess died unexpextedly: $!"); while(<BRCH>){ @@ -352,6 +363,7 @@ $uri = $self->{'rootpath'} . '/tags'; $uri =~ m/(.*)/; $uri = $1; # Untaint path + $ENV{'PATH'} = $self->{'path'}; open(TAGS,"svn list $uri |") or die("svn subprocess died unexpextedly: $!"); while(<TAGS>){ |