Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: website by xunsun from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 5 Jan 2006 01:39:36 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: website by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : website
Dir : linux-ha/website
Modified Files:
moinmoin.php trick.php
Log Message:
*don't escap '/' for wiki url
*rearrange the test for caching to save one unlink() invocation
*remove one touch() and one chmod() which are unnecessary
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/website/moinmoin.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- moinmoin.php 3 Jan 2006 14:19:34 -0000 1.17
+++ moinmoin.php 5 Jan 2006 08:39:34 -0000 1.18
@@ -75,21 +75,25 @@
global $MOINMOINstandardreplace, $current_cache_prefix,
$current_cache_relprefix, $PageTitle;
global $MOINMOINfetched;
- $PageTitle = str_replace("/","_", $ptitle);
+ # $PageTitle = str_replace("/","_", $ptitle);
+ $PageTitle = $ptitle;
$filename = "$MOINMOINurl/$PageTitle";
- $cachefile =
"$MOINMOINcachedir/$MOINMOINalias$PageTitle$CACHESUFFIX.html";
+ # $cachefile =
"$MOINMOINcachedir/$MOINMOINalias$PageTitle$CACHESUFFIX.html";
+ $cachefile = sprintf("%s/%s%s%s.html", $MOINMOINcachedir,
$MOINMOINalias, str_replace("/","_2f", $ptitle), $CACHESUFFIX);
# for attachments and the like
$current_cache_prefix =
"$MOINMOINcachedir/${MOINMOINalias}${PageTitle}__";
$current_cache_relprefix = "${MOINMOINalias}${PageTitle}__";
set_time_limit(30);
umask(077);
- if (MoinMoinNoCache($cachefile) && file_exists($cachefile)) {
- unlink($cachefile);
- }
- if (!file_exists($cachefile))
- {
-
+ if (!MoinMoinNoCache($cachefile) && file_exists($cachefile)) {
+ $body = implode("",file($cachefile));
+ $msg=sprintf("READ %d bytes from %s"
+ , filesize($cachefile), $cachefile);
+ LogIt($msg);
+ } else {
+ if (!file_exists($filename))
+ return "<b>Not Found.</b>";
$content = implode("",file($filename));
if (!$GLOBALS["MOINMOINstandardregsloaded"])
@@ -112,19 +116,17 @@
}
$body = preg_replace ($MOINMOINallsearch, $MOINMOINallreplace,
$content);
- $fd = fopen($cachefile, "w");
- fwrite($fd, $body);
- fclose ($fd);
- chmod($cachefile, $MOINMOINfilemod);
- $msg=sprintf("EXPANDED %d bytes into %s"
- , filesize($cachefile), $cachefile);
- $MOINMOINfetched[$cachefile] = true;
+ if($fd = fopen($cachefile, "w"))
+ {
+ fwrite($fd, $body);
+ fclose ($fd);
+ chmod($cachefile, $MOINMOINfilemod);
+ $msg=sprintf("EXPANDED %d bytes into %s"
+ , filesize($cachefile), $cachefile);
+ LogIt($msg);
+ $MOINMOINfetched[$cachefile] = true;
+ }
- } else {
- $body = implode("",file($cachefile));
- $msg=sprintf("READ %d bytes from %s"
- , filesize($cachefile), $cachefile);
- LogIt($msg);
}
return $body;
@@ -329,8 +331,6 @@
$datestamp=date("Y/m/d_H:i:s");
if (file_exists($logfile) && filesize($logfile) > 1000000) {
rename($logfile, "$logfile.OLD");
- touch($logfile);
- chmod($logfile, 0644);
}
error_log("$datestamp $message\n", 3, $logfile);
chmod($logfile, 0644);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/website/trick.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- trick.php 3 Jan 2006 14:19:34 -0000 1.11
+++ trick.php 5 Jan 2006 08:39:34 -0000 1.12
@@ -91,7 +91,7 @@
# in case there are some special chars in the page name, that are not yet
escaped ...
# $MOINMOINpagename is used to request that page from the wiki, or to read in
the cache file
-$MOINMOINpagename = str_replace(array("
","!",",","-",".","/","'","(",")",":"), array("_20","_21","_2c",
"_2d","_2e","_2f","_27", "_28", "_29", "_3a"), $MOINMOINpagename);
+$MOINMOINpagename = str_replace(array(" ","!",",","-",".","'","(",")",":"),
array("_20","_21","_2c", "_2d","_2e","_27", "_28", "_29", "_3a"),
$MOINMOINpagename);
$content = MoinMoin($MOINMOINpagename);
------------------------------
Message: 2
Date: Thu, 5 Jan 2006 10:58:42 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/cib
Modified Files:
io.c
Log Message:
Fix for bug 254
Even simplir than splitting out the status section into a new file,
just dont write it out.
This makes sense since we discard the info when reading the CIB from disk
anyway.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- io.c 21 Dec 2005 07:26:39 -0000 1.36
+++ io.c 5 Jan 2006 17:58:41 -0000 1.37
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.36 2005/12/21 07:26:39 andrew Exp $ */
+/* $Id: io.c,v 1.37 2006/01/05 17:58:41 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -417,10 +417,38 @@
}
if(error_code == cib_ok) {
+ crm_data_t *cib_copy_status = NULL;
+ crm_data_t *cib_copy_no_status = NULL;
+
crm_debug_3("Writing CIB out to %s", CIB_FILENAME);
CRM_DEV_ASSERT(new_cib != NULL);
- CRM_DEV_ASSERT(write_xml_file(
- new_cib, CIB_FILENAME) >= 0);
+
+ /* Given that we discard the status section on startup
+ * there is no point writing it out in the first place
+ * since users just get confused by it
+ *
+ * Although, it does help me once in a while
+ *
+ * So make a copy of the CIB and delete the status
+ * section before we write it out
+ * Perhaps not the most efficient thing to do but
+ * it will work reliably
+ */
+ cib_copy_no_status = copy_xml(new_cib);
+ cib_copy_status = find_xml_node(
+ cib_copy_no_status, XML_CIB_TAG_STATUS, TRUE);
+ CRM_DEV_ASSERT(cib_copy_status != NULL);
+
+ free_xml_from_parent(
+ cib_copy_no_status, cib_copy_status);
+ create_xml_node(cib_copy_no_status, XML_CIB_TAG_STATUS);
+
+ CRM_DEV_ASSERT(
+ write_xml_file(
+ cib_copy_no_status, CIB_FILENAME) >= 0);
+
+ free_xml(cib_copy_no_status);
+
if (crm_assert_failed) {
error_code = -4;
}
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 26, Issue 2
*******************************************