[zeroinstall-injector] also update testsuite
Michel Alexandre Salim
salimma at fedoraproject.org
Wed Jun 29 12:43:00 UTC 2011
commit 5662d1590156629b2704ba3945a763b53a5f5587
Author: Michel Alexandre Salim <michel.salim at cs.fau.de>
Date: Wed Jun 29 14:38:53 2011 +0200
also update testsuite
zeroinstall-injector-1.1-rm-versions.patch | 59 +++++++++++++++++++++++++---
1 files changed, 53 insertions(+), 6 deletions(-)
---
diff --git a/zeroinstall-injector-1.1-rm-versions.patch b/zeroinstall-injector-1.1-rm-versions.patch
index 4359476..7d37b41 100644
--- a/zeroinstall-injector-1.1-rm-versions.patch
+++ b/zeroinstall-injector-1.1-rm-versions.patch
@@ -1,6 +1,50 @@
---- zeroinstall-injector-1.1/zeroinstall/alias.py.rm-versions 2011-06-25 16:31:12.000000000 +0200
-+++ zeroinstall-injector-1.1/zeroinstall/alias.py 2011-06-29 14:26:06.464268155 +0200
-@@ -8,7 +8,7 @@
+From 4eb8b95718db10d8bf6024ad5aeea19ce1f777d3 Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <salimma at fedoraproject.org>
+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
+---
+ tests/testalias.py | 12 ++----------
+ zeroinstall/alias.py | 28 +++++++++++++++++++++-------
+ 2 files changed, 23 insertions(+), 17 deletions(-)
+
+diff --git a/tests/testalias.py b/tests/testalias.py
+index a96aea4..7934c96 100755
+--- a/tests/testalias.py
++++ b/tests/testalias.py
+@@ -9,19 +9,11 @@ sys.path.insert(0, '..')
+ from zeroinstall import alias
+
+ expected_script = """#!/bin/sh
+-if [ "$*" = "--versions" ]; then
+- exec 0launch -gd 'http://example.com/foo.xml' "$@"
+-else
+- exec 0launch 'http://example.com/foo.xml' "$@"
+-fi
++exec 0launch 'http://example.com/foo.xml' "$@"
+ """
+
+ expected_script_main = """#!/bin/sh
+-if [ "$*" = "--versions" ]; then
+- exec 0launch -gd 'http://example.com/foo.xml' "$@"
+-else
+- exec 0launch --main 'a'\\'''\\''\\test' 'http://example.com/foo.xml' "$@"
+-fi
++exec 0launch --main 'a'\\'''\\''\\test' 'http://example.com/foo.xml' "$@"
+ """
+
+ class TestAlias(BaseTest):
+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 _
@@ -9,7 +53,7 @@
if [ "$*" = "--versions" ]; then
exec 0launch -gd '%s' "$@"
else
-@@ -16,6 +16,10 @@
+@@ -16,6 +16,10 @@ else
fi
'''
@@ -20,7 +64,7 @@
class NotAnAliasScript(Exception):
pass
-@@ -27,12 +31,22 @@
+@@ -27,12 +31,22 @@ def parse_script(pathname):
@raise NotAnAliasScript: if we can't parse the script
"""
stream = file(pathname)
@@ -48,9 +92,12 @@
split = line.rfind("' '")
if split != -1:
# We have a --main
-@@ -57,4 +71,4 @@
+@@ -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
+
More information about the scm-commits
mailing list