[evolvis-commits] r18384: scmsvn:tasktrac.sh needs $INCLUDE_PATH set… which was lacking, anyway:

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Apr 26 16:23:57 CEST 2012


Author: mirabilos
Date: 2012-04-26 16:23:57 +0200 (Thu, 26 Apr 2012)
New Revision: 18384

Added:
   trunk/gforge_base/evolvisforge-5.1/src/utils/unlocale.sh
Modified:
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/debian/rules
   trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/00phpcron
   trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/db-postgresql
   trunk/gforge_base/evolvisforge-5.1/src/packaging/install/common
Log:
scmsvn:tasktrac.sh needs $INCLUDE_PATH set… which was lacking, anyway:

• bring in INCLUDE_PATH from Evolvis 4.8 (with $gfcommon added, as well
  as the Debian standard /usr/share/php and /usr/share/pear which are a
  must-have… and which probably should be added to pre.php as well…)
• bring in $LC and $LU short-hands for C and C.UTF-8 locale
• substitute gforge for @OLDPACKAGE@
• add 00phpcron in front of plugin crontabs as well (not just core)

Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-04-26 13:41:53 UTC (rev 18383)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-04-26 14:23:57 UTC (rev 18384)
@@ -18,8 +18,9 @@
 
   [ Thorsten Glaser ]
   * Improve security of git repositories
+  * Fix environment of cronjobs (including scmsvn tasktrac.sh)
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 26 Apr 2012 15:38:30 +0200
+ -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 26 Apr 2012 16:03:00 +0200
 
 fusionforge (1:5.1.1+evolvis56) unstable; urgency=low
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/rules
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/rules	2012-04-26 13:41:53 UTC (rev 18383)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/rules	2012-04-26 14:23:57 UTC (rev 18384)
@@ -86,7 +86,7 @@
 	export PLUGLONGNAME="`cat $(CURDIR)/plugins/$*/NAME`"; $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/debian/dsf-in/plugin.prerm > $@
 
 debian/$(PACKAGE)-plugin-%.cron.d:
-	$(SED_REPLACE) -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$* > $@
+	(cat $(CURDIR)/packaging/cron.d/00phpcron ; $(SED_REPLACE) -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$*) | $(SED_REPLACE) > $@
 
 debian/$(OLDPACKAGE)-%.cron.d:
 	(cat $(CURDIR)/packaging/cron.d/00phpcron ; $(SED_REPLACE) -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) | $(SED_REPLACE) > $@

Modified: trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/00phpcron
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/00phpcron	2012-04-26 13:41:53 UTC (rev 18383)
+++ trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/00phpcron	2012-04-26 14:23:57 UTC (rev 18384)
@@ -1,10 +1,18 @@
 FFDIR=/usr/share/@OLDPACKAGE@
+FFBASE=/usr/share/@OLDPACKAGE@
 FFCRON=/usr/share/@OLDPACKAGE@/cronjobs
 FFUSER=@OLDPACKAGE@
 
 # You may need to change the pathname to php CLI (command line interface)
-PHP="/usr/bin/php -q -d include_path=.:/etc/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@/www/include"
+ETCGFORGE=/etc/@OLDPACKAGE@
+INCLUDE_PATH=/etc/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@/www/include:/usr/share/@OLDPACKAGE@/common:/usr/share/php:/usr/share/pear
+PHP="/usr/bin/php -q -d include_path=.:/etc/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@:/usr/share/@OLDPACKAGE@/www/include:/usr/share/@OLDPACKAGE@/common:/usr/share/php:/usr/share/pear"
 
 # Don't mail command output to anyone.
 MAILTO=""
 
+# set the locale to C; set LC_CTYPE to C or UTF-8, respectively
+LC="/usr/share/@OLDPACKAGE@/bin/unlocale.sh --"
+LU="/usr/share/@OLDPACKAGE@/bin/unlocale.sh -u --"
+
+#- end of 00phpcron -

Modified: trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/db-postgresql
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/db-postgresql	2012-04-26 13:41:53 UTC (rev 18383)
+++ trunk/gforge_base/evolvisforge-5.1/src/packaging/cron.d/db-postgresql	2012-04-26 14:23:57 UTC (rev 18384)
@@ -45,7 +45,7 @@
 0 * * * * root $PHP $FFCRON/create_scm_repos.php
 
 # Gather commit stats from SCM repositories
-0 2 * * * root $PHP $FFCRON/gather_scm_stats.php
+0 2 * * * root $LU $PHP $FFCRON/gather_scm_stats.php
 
 # Generate snapshots and tarballs from SCM repositories
 0 3 * * * root $PHP $FFCRON/generate_scm_snapshots.php

Modified: trunk/gforge_base/evolvisforge-5.1/src/packaging/install/common
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/packaging/install/common	2012-04-26 13:41:53 UTC (rev 18383)
+++ trunk/gforge_base/evolvisforge-5.1/src/packaging/install/common	2012-04-26 14:23:57 UTC (rev 18384)
@@ -33,3 +33,4 @@
 locales/*                              usr/share/locale/
 utils/user-del.php                     usr/share/@OLDPACKAGE@/bin/
 utils/scm-newsubrepo.php               usr/share/@OLDPACKAGE@/bin/
+utils/unlocale.sh                      usr/share/@OLDPACKAGE@/bin/

Added: trunk/gforge_base/evolvisforge-5.1/src/utils/unlocale.sh
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/utils/unlocale.sh	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/src/utils/unlocale.sh	2012-04-26 14:23:57 UTC (rev 18384)
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Drop locale. When called with -u, set to UTF-8, otherwise US-ASCII.
+
+# In some shells it’s an error to unset an unset variable
+for v in LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE \
+    LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY \
+    LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME; do
+	eval $v=C
+done
+
+for v in LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_IDENTIFICATION \
+    LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
+    LC_PAPER LC_TELEPHONE LC_TIME; do
+	eval unset $v
+done
+
+if test x"$1" = x"-u"; then
+	shift
+	LC_CTYPE=en_US.UTF-8
+fi
+
+test x"$1" = x"--" && shift
+
+export LANG LC_CTYPE
+exec "$@"


Property changes on: trunk/gforge_base/evolvisforge-5.1/src/utils/unlocale.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the evolvis-commits mailing list