From 73ec6b19bba84c16ed66f22ed376f588b146e1b8 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Jun 29 2011 12:30:38 +0000 Subject: Update to 1.1 Remove --versions option, obsoleted in favor of '0alias launcher' --- diff --git a/.gitignore b/.gitignore index 498d86d..fd4d3d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/zeroinstall-injector-1.0.tar.bz2 +/zeroinstall-injector-1.1.tar.bz2 diff --git a/sources b/sources index 0ae10c2..3eaee65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6b3864376e8846d6bd0b4180faa11b40 zeroinstall-injector-1.0.tar.bz2 +c36310465a164ce5592776a8d7136ad7 zeroinstall-injector-1.1.tar.bz2 diff --git a/zeroinstall-injector-1.0-fix-versions.patch b/zeroinstall-injector-1.0-fix-versions.patch deleted file mode 100644 index b3a25df..0000000 --- a/zeroinstall-injector-1.0-fix-versions.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- zeroinstall-injector-1.0/zeroinstall/alias.py.fix-versions 2011-05-23 10:10:43.000000000 +0200 -+++ zeroinstall-injector-1.0/zeroinstall/alias.py 2011-06-22 14:46:56.457683015 +0200 -@@ -10,7 +10,7 @@ - - _template = '''#!/bin/sh - if [ "$*" = "--versions" ]; then -- exec 0launch -gd '%s' "$@" -+ exec 0launch -gd '%s' - else - exec 0launch %s '%s' "$@" - fi ---- zeroinstall-injector-1.0/tests/testalias.py.fix-versions 2011-05-23 10:10:43.000000000 +0200 -+++ zeroinstall-injector-1.0/tests/testalias.py 2011-06-22 14:58:48.609768005 +0200 -@@ -10,7 +10,7 @@ - - expected_script = """#!/bin/sh - if [ "$*" = "--versions" ]; then -- exec 0launch -gd 'http://example.com/foo.xml' "$@" -+ exec 0launch -gd 'http://example.com/foo.xml' - else - exec 0launch 'http://example.com/foo.xml' "$@" - fi -@@ -18,7 +18,7 @@ - - expected_script_main = """#!/bin/sh - if [ "$*" = "--versions" ]; then -- exec 0launch -gd 'http://example.com/foo.xml' "$@" -+ exec 0launch -gd 'http://example.com/foo.xml' - else - exec 0launch --main 'a'\\'''\\''\\test' 'http://example.com/foo.xml' "$@" - fi diff --git a/zeroinstall-injector-1.1-rm-versions.patch b/zeroinstall-injector-1.1-rm-versions.patch new file mode 100644 index 0000000..4359476 --- /dev/null +++ b/zeroinstall-injector-1.1-rm-versions.patch @@ -0,0 +1,56 @@ +--- 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 zeroinstall import _ + +-_template = '''#!/bin/sh ++_old_template = '''#!/bin/sh + if [ "$*" = "--versions" ]; then + exec 0launch -gd '%s' "$@" + else +@@ -16,6 +16,10 @@ + fi + ''' + ++_template = '''#!/bin/sh ++exec 0launch %s '%s' "$@" ++''' ++ + class NotAnAliasScript(Exception): + pass + +@@ -27,12 +31,22 @@ + @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 @@ + else: + main_arg = "" + +- stream.write(_template % (interface_uri, main_arg, interface_uri)) ++ stream.write(_template % (main_arg, interface_uri)) diff --git a/zeroinstall-injector.spec b/zeroinstall-injector.spec index 532bc37..4dc3df1 100644 --- a/zeroinstall-injector.spec +++ b/zeroinstall-injector.spec @@ -4,8 +4,8 @@ #global prerel rc1 Name: zeroinstall-injector -Version: 1.0 -Release: 3%{?dist} +Version: 1.1 +Release: 1%{?dist} Summary: The Zero Install Injector (0launch) Group: Applications/System @@ -13,11 +13,11 @@ License: LGPLv2 URL: http://0install.net Source0: http://downloads.sourceforge.net/project/zero-install/injector/%{version}/%{name}-%{version}.tar.bz2 # https://sourceforge.net/tracker/?func=detail&aid=3324502&group_id=76468&atid=547191 -Patch0: %{name}-1.0-fix-versions.patch +Patch0: %{name}-1.1-rm-versions.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -BuildRequires: python-devel +BuildRequires: python-devel >= 2.6 BuildRequires: desktop-file-utils BuildRequires: gettext # for-tests @@ -57,7 +57,7 @@ automatically check for updates when software is run. %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -b .fix-versions +%patch0 -p1 -b .rm-versions %build %{__python} setup.py build @@ -132,6 +132,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %attr(755,zeroinst,zeroinst) %{cache_dir}/implementations %changelog +* Wed Jun 29 2011 Michel Salim - 1.1-1 +- Update to 1.1 +- Remove --versions option, obsoleted in favor of '0alias launcher' + * Wed Jun 22 2011 Michel Salim - 1.0-3 - Fix --versions handling of 0alias-generated launchers