sfv.cgi #2

  • //
  • guest/
  • heather_van_steenburgh/
  • perforce/
  • utils/
  • p4db_0.99f/
  • sfv.cgi
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/usr/bin/perl -w
# -*- perl -*-
use P4CGI ;
use strict ;
#
#################################################################
#  CONFIGURATION INFORMATION 
#  All config info should be in P4CGI.pm
#
#################################################################
#
#  P4 special file viewer for HTML, JPEG and GIF files
#  View a "special" file
#
#################################################################

use viewConfig ;

$| = 1 ; # Turn output buffering off

# Get type arg
my $type = P4CGI::cgi()->param("TYPE") ;
&P4CGI::bail("No file type specified") unless defined $type ;

# Get file spec argument
my $file = P4CGI::cgi()->param("FSPC") ;
&P4CGI::bail("No file specified") unless defined $file ;

my $revision = P4CGI::cgi()->param("REV") ;
$revision = "#$revision" if defined $revision ;
$revision="" unless defined $revision ;

my ($url,$desc,$content,$about) = @{$viewConfig::TypeData{$type}} ;
&P4CGI::bail("Undefined type code") unless defined $url ;

my $filename=$file ;
$filename =~ s/^.*\///;

print
    "Content-Type: $content\n",
    "Content-Disposition: filename=$filename\n",
    "\n" ;

local *P4 ;
&P4CGI::p4call( *P4, "print -q \"$file$revision\"" );
while(<P4>) {
    print ;
} ;       

#
# That's it folks
#




# Change User Description Committed
#2 382 heather_van_steenburgh Bring up to 0.99f level
#1 381 heather_van_steenburgh The version of P4DB in the public depot isn't 0.99f.
Branch for 0.99f
//guest/heather_van_steenburgh/perforce/utils/p4db/sfv.cgi
#1 380 heather_van_steenburgh P4DB baseline
//guest/perforce_software/utils/p4db/sfv.cgi
#1 11 Perforce maintenance Add Fredric Fredricson's depot browser, P4DB.