[Checkins] SVN: zc.recipe.rhrc/trunk/ Cleaned up trailing whitespace.
Jim Fulton
jim at zope.com
Wed May 26 10:53:09 EDT 2010
Log message for revision 112727:
Cleaned up trailing whitespace.
Changed:
U zc.recipe.rhrc/trunk/README.txt
U zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt
U zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py
-=-
Modified: zc.recipe.rhrc/trunk/README.txt
===================================================================
--- zc.recipe.rhrc/trunk/README.txt 2010-05-26 14:53:07 UTC (rev 112726)
+++ zc.recipe.rhrc/trunk/README.txt 2010-05-26 14:53:08 UTC (rev 112727)
@@ -10,6 +10,18 @@
Changes
*******
+1.2.0 (2010/05/26)
+==================
+
+New Features
+------------
+
+
+Bugs Fixed
+----------
+
+- Generated run scripts has trailing whitespace.
+
1.1.0 (2008/02/01)
==================
Modified: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt 2010-05-26 14:53:07 UTC (rev 112726)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt 2010-05-26 14:53:08 UTC (rev 112727)
@@ -12,7 +12,7 @@
- The file /etc/init.d/PART should exist, where PART is the part name.
-A simple example will, hopefully make this clearer.
+A simple example will, hopefully make this clearer.
>>> demo = tmpdir('demo')
@@ -46,15 +46,15 @@
>>> ls(demo)
- zoperc
-
+
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# This script is for adminstrator convenience. It should
# NOT be installed as a system startup script!
<BLANKLINE>
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $*
@@ -67,7 +67,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $*
<BLANKLINE>
@@ -77,7 +77,7 @@
There are a couple of things to note about the generated script:
-- It uses $* to pass arguments, so arguments can't be quoted. This is
+- It uses $* to pass arguments, so arguments can't be quoted. This is
OK because the arguments will be simple verbs like start and stop.
- It includes a comment saying that the script shouldn't be used as a
@@ -119,14 +119,14 @@
Now the script contains a chkconfig comment:
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
# description: please, please work
<BLANKLINE>
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $* \
@@ -140,7 +140,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $* \
</dev/null
@@ -179,7 +179,7 @@
then chkconfig --del would have been run on the zoperc script.
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -191,7 +191,7 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
su zope -c \
@@ -206,7 +206,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
su zope -c \
"/opt/zope/bin/zopectl -C /etc/zope.conf $*" \
@@ -254,7 +254,7 @@
--add zoperc
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -266,7 +266,7 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $* \
@@ -280,7 +280,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
/opt/zope/bin/zopectl -C /etc/zope.conf $* \
</dev/null
@@ -318,7 +318,7 @@
--add zoperc
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -330,7 +330,7 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
@@ -346,7 +346,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
su zope -c \
@@ -361,7 +361,7 @@
-------------------------------------
In the example above, we generated a script based on a command line.
-If we have a part that creates a control script on it's own, ten it
+If we have a part that creates a control script on it's own, then it
can ommit the run-script option and it's already created run script
will be used. Let's create a run script ourselves:
@@ -394,7 +394,7 @@
--add zoperc
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -406,10 +406,10 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
- echo zope:
+ echo zope:
/demo/zope "$@" \
</dev/null
<BLANKLINE>
@@ -421,9 +421,9 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
- echo zope:
+ echo zope:
/demo/zope "$@" \
</dev/null
<BLANKLINE>
@@ -464,7 +464,7 @@
...
... [instance2]
... """ % dict(dest=demo))
-
+
>>> write(demo, 'instance2', '')
Note that for instance 2, we are arranging for the script to pre-exist.
@@ -477,7 +477,7 @@
--add zoperc
>>> cat(demo, 'zoperc')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -489,10 +489,10 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
- echo instance2:
+ echo instance2:
/demo/instance2 "$@" \
</dev/null
<BLANKLINE>
@@ -509,14 +509,14 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
su zope -c \
"/opt/zope/bin/zopectl -C /etc/instance1.conf $*" \
</dev/null
<BLANKLINE>
- echo instance2:
+ echo instance2:
/demo/instance2 "$@" \
</dev/null
<BLANKLINE>
@@ -537,7 +537,7 @@
- zoperc-instance1
>>> cat(demo, 'zoperc-instance1')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# This script is for adminstrator convenience. It should
# NOT be installed as a system startup script!
@@ -548,7 +548,7 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
@@ -563,7 +563,7 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
su zope -c \
@@ -633,7 +633,7 @@
- acme-instance2
>>> cat(demo, 'acme')
- #!/bin/sh
+ #!/bin/sh
<BLANKLINE>
# the next line is for chkconfig
# chkconfig: 345 90 10
@@ -645,10 +645,10 @@
exit 1
fi
<BLANKLINE>
- case $1 in
+ case $1 in
stop)
<BLANKLINE>
- echo acme-instance2:
+ echo acme-instance2:
/demo/acme-instance2 "$@" \
</dev/null
<BLANKLINE>
@@ -665,20 +665,20 @@
${0} start
<BLANKLINE>
;;
- *)
+ *)
<BLANKLINE>
LD_LIBRARY_PATH=/opt/foolib \
su acme -c \
"/opt/zope/bin/zopectl -C /etc/instance1.conf $*" \
</dev/null
<BLANKLINE>
- echo acme-instance2:
+ echo acme-instance2:
/demo/acme-instance2 "$@" \
</dev/null
<BLANKLINE>
;;
esac
- <BLANKLINE>
+ <BLANKLINE>
Edge case, when we remove the part, we uninstall acme:
Modified: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py 2010-05-26 14:53:07 UTC (rev 112726)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py 2010-05-26 14:53:08 UTC (rev 112727)
@@ -11,11 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Create a system deployment for an application
-$Id: __init__.py 15402 2006-12-01 15:58:08Z jim $
-"""
-
import logging, os, shutil, stat
import zc.buildout
@@ -93,13 +89,13 @@
else:
script = self.no_script(part)
-
+
cooked.append(script)
if chkconfig:
cooked = [s + ' \\\n </dev/null'
for s in cooked]
-
+
script = '\n\n '.join(cooked)
cooked.reverse()
rscript = '\n\n '.join(cooked)
@@ -114,10 +110,10 @@
name = options.get('deployment-name', self.name)
if self.deployment:
path = os.path.join(options['dest'], name+'-'+part)
- script = 'echo %s: \n%s' % ( name+'-'+part, path)
+ script = 'echo %s:\n%s' % ( name+'-'+part, path)
else:
path = os.path.join(options['dest'], part)
- script = 'echo %s: \n%s' % (part, path)
+ script = 'echo %s:\n%s' % (part, path)
if not os.path.exists(path):
logger.error("Part %s doesn't define run-script "
"and %s doesn't exist."
@@ -156,8 +152,8 @@
if options.get('chkconfig'):
chkconfigcommand = options.get('chkconfigcommand', '/sbin/chkconfig')
os.system(chkconfigcommand+' --del '+name)
-
+
chkconfig_template = '''\
# the next line is for chkconfig
# chkconfig: %s
@@ -176,13 +172,13 @@
fi
"""
-rc_template = """#!/bin/sh
+rc_template = """#!/bin/sh
%(CHKCONFIG)s
%(rootcheck)s
-case $1 in
+case $1 in
stop)
-
+
%(CTL_SCRIPT_R)s
;;
@@ -193,8 +189,8 @@
${0} start
;;
- *)
-
+ *)
+
%(CTL_SCRIPT)s
;;
More information about the checkins
mailing list