diff --git a/zeroinstall-injector-1.1-rm-space.patch b/zeroinstall-injector-1.1-rm-space.patch deleted file mode 100644 index e5ad5de..0000000 --- a/zeroinstall-injector-1.1-rm-space.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 9269f43875d9a58601976626f17cb488dd2f6fb5 Mon Sep 17 00:00:00 2001 -From: Thomas Leonard -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 - diff --git a/zeroinstall-injector-1.1-rm-versions.patch b/zeroinstall-injector-1.1-rm-versions.patch deleted file mode 100644 index 6f1ae0c..0000000 --- a/zeroinstall-injector-1.1-rm-versions.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 6cd13b5b860c4edc615f111017fac614e28d9fed Mon Sep 17 00:00:00 2001 -From: Michel Alexandre Salim -Date: Wed, 29 Jun 2011 14:31:45 +0200 -Subject: [PATCH] 0alias: new-style launcher scripts - -alias.py: -- generate new-style launcher script without --versions handling -- modify detection code to detect both variants of launcher scripts - -testalias.py: -- updated to match new launcher script template -- also test parsing of old-style launcher scripts ---- - tests/testalias.py | 27 ++++++++++++++++++++++++++- - zeroinstall/alias.py | 28 +++++++++++++++++++++------- - 2 files changed, 47 insertions(+), 8 deletions(-) - -diff --git a/tests/testalias.py b/tests/testalias.py -index a96aea4..43863a8 100755 ---- a/tests/testalias.py -+++ b/tests/testalias.py -@@ -9,14 +9,22 @@ sys.path.insert(0, '..') - from zeroinstall import alias - - expected_script = """#!/bin/sh -+exec 0launch 'http://example.com/foo.xml' "$@" -+""" -+ -+old_script = """#!/bin/sh - if [ "$*" = "--versions" ]; then - exec 0launch -gd 'http://example.com/foo.xml' "$@" - else - exec 0launch 'http://example.com/foo.xml' "$@" - fi -+ """ -+ -+expected_script_main = """#!/bin/sh -+exec 0launch --main 'a'\\'''\\''\\test' 'http://example.com/foo.xml' "$@" - """ - --expected_script_main = """#!/bin/sh -+old_script_main = """#!/bin/sh - if [ "$*" = "--versions" ]; then - exec 0launch -gd 'http://example.com/foo.xml' "$@" - else -@@ -53,6 +61,23 @@ class TestAlias(BaseTest): - uri, main = alias.parse_script(tmp.name) - self.assertEquals('http://example.com/foo.xml', uri) - self.assertEquals('a\'\'\\test', main) -+ -+ def testParseOld(self): -+ tmp = tempfile.NamedTemporaryFile() -+ tmp.write(old_script) -+ tmp.flush() -+ tmp.seek(0) -+ uri, main = alias.parse_script(tmp.name) -+ self.assertEquals('http://example.com/foo.xml', uri) -+ self.assertEquals(None, main) -+ -+ tmp = tempfile.NamedTemporaryFile() -+ tmp.write(old_script_main) -+ tmp.flush() -+ tmp.seek(0) -+ uri, main = alias.parse_script(tmp.name) -+ self.assertEquals('http://example.com/foo.xml', uri) -+ self.assertEquals('a\'\'\\test', main) - - def testParseException(self): - tmp = tempfile.NamedTemporaryFile() -diff --git a/zeroinstall/alias.py b/zeroinstall/alias.py -index a7189ab..9b9fa89 100644 ---- a/zeroinstall/alias.py -+++ b/zeroinstall/alias.py -@@ -8,7 +8,7 @@ Support code for 0alias scripts. - - from zeroinstall import _ - --_template = '''#!/bin/sh -+_old_template = '''#!/bin/sh - if [ "$*" = "--versions" ]; then - exec 0launch -gd '%s' "$@" - else -@@ -16,6 +16,10 @@ else - fi - ''' - -+_template = '''#!/bin/sh -+exec 0launch %s '%s' "$@" -+''' -+ - class NotAnAliasScript(Exception): - pass - -@@ -27,12 +31,22 @@ def parse_script(pathname): - @raise NotAnAliasScript: if we can't parse the script - """ - stream = file(pathname) -- template_header = _template[:_template.index("-gd '")] -+ template_header = _template[:_template.index("%s '")] - actual_header = stream.read(len(template_header)) -- if template_header != actual_header: -- raise NotAnAliasScript(_("'%s' does not look like a script created by 0alias") % pathname) -- rest = stream.read() # If it's a 0alias script, it should be quite short! -- line = rest.split('\n')[2] -+ stream.seek(0) -+ if template_header == actual_header: -+ # If it's a 0alias script, it should be quite short! -+ rest = stream.read() -+ line = rest.split('\n')[1] -+ else: -+ old_template_header = \ -+ _old_template[:_old_template.index("-gd '")] -+ actual_header = stream.read(len(old_template_header)) -+ if old_template_header != actual_header: -+ raise NotAnAliasScript(_("'%s' does not look like a script created by 0alias") % pathname) -+ rest = stream.read() -+ line = rest.split('\n')[2] -+ - split = line.rfind("' '") - if split != -1: - # We have a --main -@@ -57,4 +71,4 @@ def write_script(stream, interface_uri, main = None): - else: - main_arg = "" - -- stream.write(_template % (interface_uri, main_arg, interface_uri)) -+ stream.write(_template % (main_arg, interface_uri)) --- -1.7.5.4 -