# # perl project cgimake.conf file 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. # # %env_override = ( P4PORT => '10.144.1.60:1666', P4CLIENT => 'barries', P4USER => 'barries', 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 ( $path_project, $path_rev, $path_filter, $file ) = split( '/', $_, 4 ) ; $ENV{SAF_PATH_PROJECT} = $project ; $ENV{SAF_PATH_REV} = $path_rev ; $ENV{SAF_PATH_FILTER} = $path_filter ; $ENV{SAF_PATH_FILE} = $path_file ; 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 ; return $_ ; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#8 | 198 | Barrie Slaymaker |
Removed HREF anchor around rev number, fixed URL in change number anchor in file log. Made perl/cgimake.conf set SAF_PATH_... env. vars properly. |
||
#7 | 188 | Barrie Slaymaker | minor nit fix. | ||
#6 | 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. |
||
#5 | 183 | Barrie Slaymaker | Minor tweak to P4 config | ||
#4 | 178 | Barrie Slaymaker |
Modified cgimake to get the project name out of the target name if one isn't supplied. This makes it so that Apache's mod_rewrite is no longer needed to extract the project name from the URL and place it in the QUERY_STRING, and so that you can call cgimake from the command line and place the project name in the target path: cgimake /perl/_head/Default/depot/ Modified cgimake to work easily from the command line Fixed some minor bugs in assembling paths that were causing // to appear in paths when no project is specified. Fixed minor bug that cause cgimake to try to read a bogus config file when there is no $project Tweaked p4_get to provide a more reasonable level of verbosity. Updated the apache doc to reflect the simpler, non-rewrite technique. Added targets to fetch a new _head revision if the head change number has changed. Need to check in p4_update. |
||
#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 |