[pyxdg/f17] fix bz869877

Tom Callaway spot at fedoraproject.org
Fri Oct 26 14:36:28 UTC 2012


commit 8f1647dccc89fedd730aa9d9bd33dc84b3d86139
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Fri Oct 26 10:37:56 2012 -0400

    fix bz869877

 pyxdg-0.23-gracefully-handle-kde-config-fail.patch |   20 ++++++++++++++++++++
 pyxdg.spec                                         |    7 ++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/pyxdg-0.23-gracefully-handle-kde-config-fail.patch b/pyxdg-0.23-gracefully-handle-kde-config-fail.patch
new file mode 100644
index 0000000..384f038
--- /dev/null
+++ b/pyxdg-0.23-gracefully-handle-kde-config-fail.patch
@@ -0,0 +1,20 @@
+diff -up pyxdg-0.23/xdg/Menu.py.869877 pyxdg-0.23/xdg/Menu.py
+--- pyxdg-0.23/xdg/Menu.py.869877	2012-07-25 18:59:15.000000000 -0400
++++ pyxdg-0.23/xdg/Menu.py	2012-10-26 10:24:26.122225592 -0400
+@@ -889,8 +889,14 @@ def __mergeLegacyDir(dir, prefix, filena
+         return m
+ 
+ def __parseKDELegacyDirs(filename, parent):
+-    output = subprocess.check_output(['kde-config', '--path', 'apps'],
+-                                     universal_newlines=True).splitlines()
++    try:
++        output = subprocess.check_output(['kde-config', '--path', 'apps'],
++                                         universal_newlines=True).splitlines()
++    except OSError:
++        # print("Error executing kde-config. Error was ", OSError)
++        # Oh well, we tried.
++        output = []
++
+     try:
+         for dir in output[0].split(":"):
+             __parseLegacyDir(dir,"kde", filename, parent)
diff --git a/pyxdg.spec b/pyxdg.spec
index 0ad4a53..b89e592 100644
--- a/pyxdg.spec
+++ b/pyxdg.spec
@@ -6,12 +6,13 @@
 
 Name:           pyxdg
 Version:        0.23
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Python library to access freedesktop.org standards
 Group:          Development/Libraries
 License:        LGPLv2
 URL:            http://freedesktop.org/Software/pyxdg
 Source0:        http://www.freedesktop.org/~lanius/%{name}-%{version}.tar.gz
+Patch0:		pyxdg-0.23-gracefully-handle-kde-config-fail.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 # These are needed for the nose tests.
@@ -36,6 +37,7 @@ package contains a Python 3 version of PyXDG.
 
 %prep
 %setup -q
+%patch0 -p1 -b .869877
 
 %if 0%{?with_python3}
 rm -rf %{py3dir}
@@ -91,6 +93,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif #with_python3
 
 %changelog
+* Fri Oct 26 2012 Tom Callaway <spot at fedoraproject.org> - 0.23-2
+- gracefully handle kde-config fails
+
 * Mon Oct  8 2012 Tom Callaway <spot at fedoraproject.org> - 0.23-1
 - update to 0.23
 - enable python3


More information about the scm-commits mailing list