[Checkins] SVN: zc.recipe.rhrc/trunk/s Added an uninstall recipe.

Jim Fulton jim at zope.com
Tue Dec 5 17:35:54 EST 2006


Log message for revision 71427:
  Added an uninstall recipe.
  

Changed:
  U   zc.recipe.rhrc/trunk/setup.py
  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/setup.py
===================================================================
--- zc.recipe.rhrc/trunk/setup.py	2006-12-05 22:33:21 UTC (rev 71426)
+++ zc.recipe.rhrc/trunk/setup.py	2006-12-05 22:35:54 UTC (rev 71427)
@@ -1,9 +1,18 @@
 from setuptools import setup
 
+
+entry_points = '''
+[zc.buildout]
+default=zc.recipe.rhrc:Recipe
+
+[zc.buildout.uninstall]
+default=zc.recipe.rhrc:uninstall
+'''
+
 name = 'zc.recipe.rhrc'
 setup(
     name=name,
-    entry_points='[zc.buildout]\ndefault=%s:Recipe' % name,
+    entry_points=entry_points,
     package_dir = {'': 'src'},
     install_requires = "zc.buildout" # XXX Grrr should use tests_require
     )

Modified: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt	2006-12-05 22:33:21 UTC (rev 71426)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt	2006-12-05 22:35:54 UTC (rev 71427)
@@ -109,6 +109,7 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
     buildout: Installing zoperc
     --add zoperc
 
@@ -166,9 +167,14 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
+    --del zoperc
     buildout: Installing zoperc
     --add zoperc
 
+Note the --del output.  If we hadn't set the chkconfigcommand to echo,
+then chkconfig --del would have been run on the zoperc script.
+
     >>> cat(demo, 'zoperc')
     #!/bin/sh 
     <BLANKLINE>
@@ -239,6 +245,8 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
+    --del zoperc
     buildout: Installing zoperc
     --add zoperc
 
@@ -302,6 +310,8 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
+    --del zoperc
     buildout: Installing zoperc
     --add zoperc
 
@@ -373,6 +383,8 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
+    --del zoperc
     buildout: Installing zoperc
     --add zoperc
 
@@ -509,6 +521,8 @@
 
     >>> print system('bin/buildout'),
     buildout: Uninstalling zoperc
+    buildout: Running uninstall recipe
+    --del zoperc
     buildout: Installing zoperc
     --add acme
 

Modified: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py	2006-12-05 22:33:21 UTC (rev 71426)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py	2006-12-05 22:35:54 UTC (rev 71427)
@@ -116,6 +116,12 @@
     def update(self):
         pass
 
+def uninstall(name, options):
+    if options.get('chkconfig'):
+        chkconfigcommand = options.get('chkconfigcommand', 'chkconfig')
+        os.system(chkconfigcommand+' --del '+name)
+    
+
 chkconfig_template = '''\
 # the next line is for chkconfig
 # chkconfig: %s



More information about the Checkins mailing list