# # cgimake.conf for Safari # Copyright (c) 1999 by Barrie Slaymaker, rbs@telerama.com # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the README file. # # # perforce project cgimake.conf file # %env_override = ( P4PORT => 'public.perforce.com:1666', P4CLIENT => 'safari', PERL5LIB => '/home/barries/src/safari/lib', SAF_CONF_DIR => "$config_dir/$project" , SAF_PROJECT => $project , ) ; sub target_fixup { $_ = '/' . $_ unless m@^/@ ; error( "No '..' allowed in target" ) if m@(^|/)\.\.(/|$)@ ; # # Publish a few things in the environment for the Makefile and # for safari-aware scripts. There are two sets of variables: # those for the actual target, and those for the target passed # with PATH_INFO. This is because links in the resulting web page # will be relative to PATH_INFO, not necessarily to the file # being built (which may have been specified with a targets= entry # in the QUERY_STRING). # my ( undef, $rev, $filter, $file ) = split( '/', $_, 4 ) ; $filter = $cgi->param( 'filter' ) if defined $cgi->param( 'filter' ) ; $rev = $cgi->param( 'rev' ) if defined $cgi->param( 'rev' ) ; $file = $cgi->param( 'file' ) if defined $cgi->param( 'file' ) ; $_ = "/$rev" ; $_ .= "/$filter" if defined( $filter ) ; $_ .= "/$file" if defined ( $file ) ; $ENV{SAF_REV} = $rev ; $ENV{SAF_FILTER} = $filter ; $ENV{SAF_FILE} = $file ; $ENV{SAF_TARGET} = $_ ; # # Special hack since perforce wisely chose to use '#' as the # type specifier indicating a revision number. # my $p4_rev = $rev ; $p4_rev =~ s/^_/#/ ; $ENV{SAF_P4_REV} = $p4_rev ; my $target = $_ ; # trim off trailing filename. Assumes all directory requests end in a '/' $target =~ s@[^/]+$@@ ; my @chunks = split( '/', $target ) ; my $up_to_project = '../' x ( @chunks - 1 ) ; my $up_to_rev = '../' x ( @chunks - 2 ) ; my $up_to_filter = '../' x ( @chunks - 3 ) ; $ENV{SAF_UP_TO_PROJECT} = $up_to_project ; $ENV{SAF_UP_TO_REV} = $up_to_rev ; $ENV{SAF_UP_TO_FILTER} = $up_to_filter ; my ( $path_rev, $path_filter ) = $target =~ m@/([^/]*)/([^/]*)@ ; $ENV{SAF_PATH_PROJECT} = $project ; $ENV{SAF_PATH_REV} = $path_rev ; $ENV{SAF_PATH_FILTER} = $path_filter ; return $_ ; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 188 | Barrie Slaymaker | minor nit fix. | ||
#4 | 187 | Barrie Slaymaker |
Added lots of options to saf_http_out to let the source file be used to figure out file type for determining filter and tool menus. Changed Makefiles to pass the original source file name in to saf_http_out. Added --PRE to saf_http_out. This is good for displaying plain text versions of HTML files. Improved the tool and filter logic in Safari::Edit::p4.pm to work with original file type to determine what makes sense for what kind of file. This really needs to be generalized in to a config file instead of being buried in a module. Increased usage of HTML::Entities::encode_entities instead of s///g . Moved Content-type: header to after the edit() routine call and now we pass and recover mime-type as an option. Added SAF_TARGET to environment under cgimake, Fixed updirectory counting, which broke when cgimake started parsing the project name from PATH_INFO. Removed all edit routines from saf_http_out.conf files. NOTE: we can now fall back to a single cgimake.conf file. Any day now. |
||
#3 | 168 | Barrie Slaymaker | Added YAPC paper, slides | ||
#2 | 165 | Barrie Slaymaker | Applied Greg KH's license patch. | ||
#1 | 162 | Barrie Slaymaker | First code & documentation checkin |