Commit 6747e2be authored by Fabien Amarger's avatar Fabien Amarger
Browse files

chore(debian): Remove debian package name format from new cube command

parent 97d1287fa822
......@@ -797,7 +797,6 @@ layout, and a full featured cube with "full" layout.',
def run(self, args):
import re
from logilab.common.shellutils import ASK
cubename = args[0]
if not re.match("[_A-Za-z][_A-Za-z0-9]*$", cubename):
......@@ -812,20 +811,7 @@ layout, and a full featured cube with "full" layout.',
mkdir(destdir)
except OSError as err:
self.fail("failed to create directory %r\n(%s)" % (destdir, err))
default_name = "cubicweb-%s" % cubename.lower().replace("_", "-")
if verbose:
distname = input(
"Debian name for your cube ? [%s]): " % default_name
).strip()
if not distname:
distname = default_name
elif not distname.startswith("cubicweb-"):
if ASK.confirm("Do you mean cubicweb-%s ?" % distname):
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")
distname = "cubicweb-%s" % cubename.lower().replace("_", "-")
cubedir = osp.join(destdir, distname)
if osp.exists(cubedir):
self.fail("%s already exists!" % cubedir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment