From 9269f43875d9a58601976626f17cb488dd2f6fb5 Mon Sep 17 00:00:00 2001
From: Thomas Leonard <talex5@gmail.com>
Date: Sat, 2 Jul 2011 10:49:29 +0100
Subject: [PATCH] Removed extra space from alias scripts
---
tests/testalias.py | 2 +-
zeroinstall/alias.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/testalias.py b/tests/testalias.py
index 0618f9b..a2d4366 100755
--- a/tests/testalias.py
+++ b/tests/testalias.py
@@ -9,7 +9,7 @@ sys.path.insert(0, '..')
from zeroinstall import alias
expected_script = """#!/bin/sh
-exec 0launch 'http://example.com/foo.xml' "$@"
+exec 0launch 'http://example.com/foo.xml' "$@"
"""
old_script = """#!/bin/sh
diff --git a/zeroinstall/alias.py b/zeroinstall/alias.py
index a6fb6dd..f46b59c 100644
--- a/zeroinstall/alias.py
+++ b/zeroinstall/alias.py
@@ -17,7 +17,7 @@ fi
'''
_template = '''#!/bin/sh
-exec 0launch %s '%s' "$@"
+exec 0launch %s'%s' "$@"
'''
class NotAnAliasScript(Exception):
@@ -31,7 +31,7 @@ def parse_script(pathname):
@raise NotAnAliasScript: if we can't parse the script
"""
stream = file(pathname)
- template_header = _template[:_template.index("%s '")]
+ template_header = _template[:_template.index("%s'")]
actual_header = stream.read(len(template_header))
stream.seek(0)
if template_header == actual_header:
@@ -67,7 +67,7 @@ def write_script(stream, interface_uri, main = None):
assert "\\" not in interface_uri
if main is not None:
- main_arg = "--main '%s'" % main.replace("'", "'\\''")
+ main_arg = "--main '%s' " % main.replace("'", "'\\''")
else:
main_arg = ""
--
1.7.5.4