[Fusionforge-commits] r9646 - in trunk/gforge: packaging/install utils

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Apr 29 16:21:57 CEST 2010


Author: lolando
Date: 2010-04-29 16:21:57 +0200 (Thu, 29 Apr 2010)
New Revision: 9646

Added:
   trunk/gforge/utils/forge_get_config
Modified:
   trunk/gforge/packaging/install/common
Log:
Added a tool to read config files and return a value (for scripts)

Modified: trunk/gforge/packaging/install/common
===================================================================
--- trunk/gforge/packaging/install/common	2010-04-29 14:20:14 UTC (rev 9645)
+++ trunk/gforge/packaging/install/common	2010-04-29 14:21:57 UTC (rev 9646)
@@ -11,6 +11,7 @@
 utils/fill-in-the-blanks.pl            usr/share/gforge/bin/
 deb-specific/gforge-config             usr/sbin/
 utils/include.pl                       usr/share/gforge/lib/
+utils/forge_get_config                 usr/share/gforge/bin/
 #
 deb-specific/user_dump_update.pl       usr/share/gforge/bin/
 deb-specific/group_dump_update.pl      usr/share/gforge/bin/

Added: trunk/gforge/utils/forge_get_config
===================================================================
--- trunk/gforge/utils/forge_get_config	                        (rev 0)
+++ trunk/gforge/utils/forge_get_config	2010-04-29 14:21:57 UTC (rev 9646)
@@ -0,0 +1,46 @@
+#! /usr/bin/php5 -f
+<?php
+/**
+ * FusionForge source control management
+ *
+ * Copyright 2009, Roland Mas
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+        
+require (dirname(__FILE__).'/../www/env.inc.php');
+require_once $gfwww.'include/pre.php';
+
+if (count ($argv) == 3) {
+	echo forge_get_config ($argv[1], $argv[2]) . "\n" ;
+} elseif (count($argv) == 2) {
+	echo forge_get_config ($argv[1]) . "\n" ;
+} else {
+	echo "Usage: .../forge-get-config <variable> [ <section> ]
+For instance: .../forge-get-config web_host
+              .../forge-get-config repo_prefix scmsvn
+" ;
+        exit (1) ;
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>




More information about the Fusionforge-commits mailing list