aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-03-19 14:10:45 +0100
committerGuido Günther <agx@sigxcpu.org>2012-03-19 14:19:58 +0100
commit288b96835180477d3884595bf21f9c0516650a7f (patch)
tree082acd68e27f08d822e55346494484b4f5b92327 /gbp
parentf4b42e677c64c443c14e8671db51fe58e6494588 (diff)
gbp-create-remote-repo: improve remote script readability
Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r--gbp/scripts/create_remote_repo.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py
index e483bf35..e73c92c6 100644
--- a/gbp/scripts/create_remote_repo.py
+++ b/gbp/scripts/create_remote_repo.py
@@ -130,20 +130,21 @@ def build_remote_script(remote):
Create the script that will be run on the remote side
>>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg'})
- '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --bare --shared\\necho "pkg packaging" > description\\n'
+ '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --bare --shared\\necho "pkg packaging" > description\\n'
"""
- remote_script = """
-set -e
-umask 002
-if [ -d %(base)s"%(dir)s" ]; then
- echo "Repository at \"%(base)s%(dir)s\" already exists - giving up."
- exit 1
-fi
-mkdir -p %(base)s"%(dir)s"
-cd %(base)s"%(dir)s"
-git init --bare --shared
-echo "%(pkg)s packaging" > description
-""" % remote
+ remote_script_pattern = ['',
+ 'set -e',
+ 'umask 002',
+ 'if [ -d %(base)s"%(dir)s" ]; then',
+ ' echo "Repository at \"%(base)s%(dir)s\" already exists - giving up."',
+ ' exit 1',
+ 'fi',
+ 'mkdir -p %(base)s"%(dir)s"',
+ 'cd %(base)s"%(dir)s"',
+ 'git init --bare --shared',
+ 'echo "%(pkg)s packaging" > description',
+ '' ]
+ remote_script = '\n'.join(remote_script_pattern) % remote
return remote_script