Re: [PATCHv2/RFC] gitweb: Prepare for splitting gitweb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 14, 2010 at 09:24, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
> On Wed, 14 Jul 2010, Ævar Arnfjörð Bjarmason wrote:
>> On Tue, Jul 13, 2010 at 22:24, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
>>
>> > I wrote simple script that tests result of __DIR__ and $FindBin::Bin.
>> > For cgi-bin / mod_cgi it was:
>> >
>> >  __DIR__       = /var/www/cgi-bin/gitweb (symlink to /home/local/gitweb)
>> >  $FindBin::Bin = /home/local/gitweb
>> >
>> > For mod_perl (ModPerl::Registry handler) it was
>> >
>> >  __DIR__       = /var/www/perl/gitweb (symlink to /home/local/gitweb)
>> >  $FindBin::Bin = /
>> >
>> > As you can see it's useless.  I have't checked the FastCGI case...
>>
>> Thanks for spending time researching what was an offhand ignorant "hey
>> wasn't .." comment. Also, sorry :)
>
> Nothing to it.  I wanted to check if there really is a problem with
> FindBin on mod_perl, as I was not sure with description in "Known Issues"
> section in FindBin manpage.
>
> Note that using 'FindBin->again();' after 'use FindBin;' fixes this
> issue.  So perhaps it would be beter to use FindBin than borrow code
> for __DIR__ from Dir::Self.

That should work, though note that FindBin->again requires at least
perl 5.8.3. This should work on older versions (if Gitweb cares):

    if ($] <= 5.008003) {
        delete $INC{'FindBin.pm'};
        require FindBin;
    } else {
        FindBin->again;
    }

See https://rt.cpan.org/Public/Bug/Display.html?id=57988 and
http://search.cpan.org/diff?from=Module-Install-0.98&to=Module-Install-0.99
for reference.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]