git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitweb on OpenBSD (-T not supported on filesystems...)
@ 2006-09-17  8:45 Andrew Pamment
  2006-09-17  9:12 ` Jakub Narebski
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pamment @ 2006-09-17  8:45 UTC (permalink / raw)
  To: git

Hi git people

I'm not sure if this is useful but I thought I would post it anyway,

in gitweb.cgi on line 1560 where you have -T testing a file descripter, it  
doesn't work on OpenBSD 3.9, which makes viewing blobs not work.

I solved this (or I think I have) by replacing $fd with $filename.

Andrew

-- 
Mort - http://www.mort-os.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gitweb on OpenBSD (-T not supported on filesystems...)
  2006-09-17  8:45 gitweb on OpenBSD (-T not supported on filesystems...) Andrew Pamment
@ 2006-09-17  9:12 ` Jakub Narebski
  2006-09-17  9:46   ` Andrew Pamment
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2006-09-17  9:12 UTC (permalink / raw)
  To: git

Andrew Pamment wrote:

> I'm not sure if this is useful but I thought I would post it anyway,
> 
> in gitweb.cgi on line 1560 where you have -T testing a file descripter, it  
> doesn't work on OpenBSD 3.9, which makes viewing blobs not work.
> 
> I solved this (or I think I have) by replacing $fd with $filename.

This doesn't work. $filename is file name relative to the git repository,
i.e. full path would be $projectroot/$project/../$file_name _if_ the
repository is full repository and not bare repository, and when projects
are symlinked .. goes up linked directory.

We need '-T $fd', where $fd is open pipe from git-cat-file, to avoid
creating temporary files (we just removed need for $tmp_dir and temporary
files for creating diffs).


What Perl version do you use? Does 'perldoc -f -X' has the following lines?

        -X FILEHANDLE

        (...) If "-T" or "-B" is used on a filehandle, the current IO buffer
        is examined rather than the first block. (...)

The solution for you would be to skip -T test.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gitweb on OpenBSD (-T not supported on filesystems...)
  2006-09-17  9:12 ` Jakub Narebski
@ 2006-09-17  9:46   ` Andrew Pamment
  2006-09-17  9:51     ` Jakub Narebski
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pamment @ 2006-09-17  9:46 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git@vger.kernel.org

On Sun, 17 Sep 2006 18:42:12 +0930, Jakub Narebski <jnareb@gmail.com>  
wrote:

> What Perl version do you use? Does 'perldoc -f -X' has the following  
> lines?
>
>         -X FILEHANDLE
>
>         (...) If "-T" or "-B" is used on a filehandle, the current IO  
> buffer
>         is examined rather than the first block. (...)

The version of perl is the one that comes with OpenBSD 3.9, it is v5.8.6.

I do get the above text when I run 'perldoc -f -X', does this mean it  
should work? When I try the original -T $fd I get:

Software error:
-T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  
line 1598.

> The solution for you would be to skip -T test.

That works fine. Thanks.

Andrew

-- 
Mort - http://www.mort-os.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gitweb on OpenBSD (-T not supported on filesystems...)
  2006-09-17  9:46   ` Andrew Pamment
@ 2006-09-17  9:51     ` Jakub Narebski
  2006-09-17 15:07       ` Randal L. Schwartz
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2006-09-17  9:51 UTC (permalink / raw)
  To: git

Andrew Pamment wrote:

> On Sun, 17 Sep 2006 18:42:12 +0930, Jakub Narebski <jnareb@gmail.com>  
> wrote:
> 
>> What Perl version do you use? Does 'perldoc -f -X' has the following  
>> lines?
>>
>>         -X FILEHANDLE
>>
>>         (...) If "-T" or "-B" is used on a filehandle, the current IO  
>> buffer
>>         is examined rather than the first block. (...)
> 
> The version of perl is the one that comes with OpenBSD 3.9, it is v5.8.6.
> 
> I do get the above text when I run 'perldoc -f -X', does this mean it  
> should work? 

I thought that OpenBSD has perhaps distributed some old Perl version that
doesn't have -X tests (including -T/-B) on filehandles.

> When I try the original -T $fd I get: 
> 
> Software error:
> -T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  
> line 1598.

So this means that Perl implementation in OpenBSD is flawed.

Does anyone else has problem with gitweb on other systems? (I guess that
gitweb doesn't work with ActivePerl).

>> The solution for you would be to skip -T test.
> 
> That works fine. Thanks.

The -T test is just a fallback for when we cannot derive mimetype. I don't
know if you should default to 'application/octet-stream' or 'text/plain' in
your case; that perhaps depends on the repository.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gitweb on OpenBSD (-T not supported on filesystems...)
  2006-09-17  9:51     ` Jakub Narebski
@ 2006-09-17 15:07       ` Randal L. Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Randal L. Schwartz @ 2006-09-17 15:07 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

>>>>> "Jakub" == Jakub Narebski <jnareb@gmail.com> writes:

Jakub> I thought that OpenBSD has perhaps distributed some old Perl version that
Jakub> doesn't have -X tests (including -T/-B) on filehandles.

>> When I try the original -T $fd I get: 
>> 
>> Software error:
>> -T and -B not implemented on filehandles at /var/www/htdocs/git/gitweb.cgi  
>> line 1598.

Jakub> So this means that Perl implementation in OpenBSD is flawed.

No, see "perldoc perldiag":

       "-T" and "-B" not implemented on filehandles
           (F) Perl can't peek at the stdio buffer of filehandles when it
           doesn't know about your kind of stdio.  You'll have to use a file-
           name instead.

So the problem is that OpenBSD has a stdio that is not what the Perl authors
anticipated, because it requires peeking behind official interfaces.  Perl
isn't flawed. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-17 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-17  8:45 gitweb on OpenBSD (-T not supported on filesystems...) Andrew Pamment
2006-09-17  9:12 ` Jakub Narebski
2006-09-17  9:46   ` Andrew Pamment
2006-09-17  9:51     ` Jakub Narebski
2006-09-17 15:07       ` Randal L. Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).