#!/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 # ################################################################# # 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") ; &P4CGI::bail("No revision specified") unless defined $revision ; if($type eq "HTML") { print "Content-type: text/html\n\n" ; local *P4 ; &P4CGI::p4call( *P4, "print $file#$revision" ); <P4> ; while(<P4>) { print ; } ; } elsif($type eq "GIF") { print "Content-type: image/gif\n\n" ; local *P4 ; &P4CGI::p4call( *P4, "print $file#$revision" ); <P4> ; while(<P4>) { print ; } ; } elsif($type eq "JPEG") { print "Content-type: image/jpeg\n\n" ; local *P4 ; &P4CGI::p4call( *P4, "print $file#$revision" ); <P4> ; while(<P4>) { print ; } ; } else { &P4CGI::bail("Unknown type $type!") ; } ; # # That's it folks #
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 381 | heather_van_steenburgh |
The version of P4DB in the public depot isn't 0.99f. Branch for 0.99f |
||
#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. |