head	1.3;
access;
symbols
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.2
	RELEASE_5_3_0:1.2
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.2
	RELEASE_4_6_2:1.2
	RELEASE_4_6_1:1.2
	RELEASE_4_6_0:1.2
	RELEASE_5_0_DP1:1.2
	RELEASE_4_5_0:1.2
	RELEASE_4_4_0:1.2
	RELEASE_4_3_0:1.2
	RELEASE_4_2_0:1.2
	RELEASE_4_1_1:1.2
	RELEASE_4_1_0:1.2
	RELEASE_3_5_0:1.2
	RELEASE_4_0_0:1.2
	RELEASE_3_4_0:1.2
	RELEASE_3_3_0:1.2
	RELEASE_3_2_0:1.2
	RELEASE_3_1_0:1.2
	RELEASE_2_2_8:1.2;
locks; strict;
comment	@# @;


1.3
date	2009.07.08.02.35.36;	author pgollucci;	state dead;
branches;
next	1.2;

1.2
date	98.11.04.04.17.02;	author ache;	state Exp;
branches;
next	1.1;

1.1
date	98.11.02.11.04.02;	author ache;	state Exp;
branches;
next	;


desc
@@


1.3
log
@- patch file shuffle for my sanity
@
text
@--- lib/siteconf.pl.orig	Thu Jul 23 01:44:21 1998
+++ lib/siteconf.pl	Wed Nov  4 07:06:48 1998
@@@@ -9,6 +9,7 @@@@
 
 local($DirectoryIndex, $UserDir, $DocumentRoot, $Port, $Server, $ServerAddress);
 local(@@AliasList,@@ScriptAliasList,@@ServerCache);
+local($FCacheFile);
 
 $DirectoryIndex="";
 $UserDir="";
@@@@ -24,21 +25,6 @@@@
 
 $NUM_IP_ADDR_RE = '(\d+)\.(\d+)\.(\d+)\.(\d+)';
 
-$FCacheFile = "$WEBGLIMPSE_HOME/.sitecache";
-
-# If can't write to preferred cache file, use alternate
-if (!open(F,">$FCacheFile")) {
-	$FCacheFile = "/tmp/.sitecache";
-	if (!open(F,">$FCacheFile")) {
-		print "Error, cannot find a usable cache file!\n";
-		$FCacheFile = '';
-	} else {
-		close(F);
-	}
-} else {
-	close(F);
-}
-
 ########################################################################
 # Read [vhost].wgsiteconf file settings
 sub ReadConf	{
@@@@ -327,10 +313,9 @@@@
 	return "";
 }
 
-# NO GUARANTEE THAT THE USER RUNNING confarc CAN WRITE TO $WEBGLIMPSE_HOME!!!
-# Changed fixed filename to $FCacheFile, tested at beginning of package. --GB 7/6/98
 sub SaveCache	{
-	open (FCACHE, ">$FCacheFile");
+	open (FCACHE, ">$FCacheFile") ||
+		die "Error, can't write to $FCacheFile: ";
 	foreach $host (keys %ServerCache)	{
 		my($a, $b, $c, $d) = unpack('C4', $ServerCache{$host});
 		print FCACHE "$host $a $b $c $d\n";
@@@@ -340,7 +325,10 @@@@
 }
 
 sub LoadCache	{
-	open (FCACHE, $FCacheFile);
+	$FCacheFile = shift;
+	return if (! -e $FCacheFile);
+	open (FCACHE, $FCacheFile) ||
+		die "Error, can't read from $FCacheFile: ";
 	while (<FCACHE>)	{
 		my($host, $a, $b, $c, $d) = split(' ');
 		$ServerCache{$host} = pack('C4', $a, $b, $c, $d);
@


1.2
log
@autosense localization from env vars
always put site cache locally
@
text
@@


1.1
log
@when can't open global .sitecache, open in in current directory
instead of in /tmp because conflict in multiuser system
@
text
@d1 3
a3 3
--- lib/siteconf.pl.bak	Thu Jul 23 01:44:21 1998
+++ lib/siteconf.pl	Mon Nov  2 13:58:29 1998
@@@@ -28,7 +28,7 @@@@
d5 14
a18 2
 # If can't write to preferred cache file, use alternate
 if (!open(F,">$FCacheFile")) {
d20 38
a57 4
+	$FCacheFile = ".sitecache";
 	if (!open(F,">$FCacheFile")) {
 		print "Error, cannot find a usable cache file!\n";
 		$FCacheFile = '';
@

