[c-c newcube] finish #676915: cubicweb-ctl newcube must be aware of python modules and debian package convention (python part already implemented)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 15 Apr 2010 18:47:37 +0200
changeset 5297 cc747dcef851
parent 5274 16461f675734
child 5298 66b0987716f9
[c-c newcube] finish #676915: cubicweb-ctl newcube must be aware of python modules and debian package convention (python part already implemented)
devtools/devctl.py
--- a/devtools/devctl.py	Thu Apr 15 12:48:40 2010 +0200
+++ b/devtools/devctl.py	Thu Apr 15 18:47:37 2010 +0200
@@ -523,7 +523,7 @@
         if exists(cubedir):
             self.fail("%s already exists !" % (cubedir))
         skeldir = join(BASEDIR, 'skeleton')
-        default_name = 'cubicweb-%s' % cubename.lower()
+        default_name = 'cubicweb-%s' % cubename.lower().replace('_', '-')
         if verbose:
             distname = raw_input('Debian name for your cube ? [%s]): ' % default_name).strip()
             if not distname:
@@ -533,7 +533,8 @@
                     distname = 'cubicweb-' + distname
         else:
             distname = default_name
-
+        if not re.match('[a-z][-a-z0-9]*$', distname):
+            raise BadCommandUsage("cube distname should be a valid debian package name")
         longdesc = shortdesc = raw_input('Enter a short description for your cube: ')
         if verbose:
             longdesc = raw_input('Enter a long description (leave empty to reuse the short one): ')