- handle non-existent dependency sets correctly in python (#593553)

- make find-lang look in all locale dirs (#584866)
This commit is contained in:
Panu Matilainen 2010-05-21 13:06:25 +00:00
parent bf44a4b91a
commit 5004ac7e27
3 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,30 @@
commit 2d468d2cd9d2a5e2f9adcdecdd9f017fe04eb77a
Author: Till Maas <opensource@till.name>
Date: Thu May 20 11:35:16 2010 +0300
Search all locale dirs in find-lang.sh, not just those under share/ (#159)
diff --git a/scripts/find-lang.sh b/scripts/find-lang.sh
index bb25b31..e33ed0c 100755
--- a/scripts/find-lang.sh
+++ b/scripts/find-lang.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#findlang - automagically generate list of language specific files
#for inclusion in an rpm spec file.
-#This does assume that the *.mo files are under .../share/locale/...
+#This does assume that the *.mo files are under .../locale/...
#Run with no arguments gets a usage message.
#findlang is copyright (c) 1998 by W. L. Estes <wlestes@uncg.edu>
@@ -99,8 +99,8 @@ done
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
-'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
-'"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
+'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
+'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
/^$/d' > $MO_NAME

View File

@ -0,0 +1,36 @@
commit 0e0e332b466a9784620c483faa374067381e96ce
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Wed May 19 10:12:43 2010 +0300
Handle non-existent dependency sets in python (RhBug:593553)
- rpmdsNew() returns NULL if the requested dependency type doesn't
exist in the header. The C-side API can handle NULL to all rpmds
"methods" and this is how librpm deals with non-existent sets rather
than waste memory on for empty ds structures. However the python side
wasn't expecting NULL for legal requests (but not setting error either)
and thus blowing up with SystemError exception.
- Raise TypeError on illegal arguments to rpm.ds constructor, and present
non-existent dependency sets as empty rpm.ds objects to python. This
lets python callers use iteration over ds items regardless of whether
the dependency actually exists or not. The alternative of returning
None (or raising exceptions) would break existing code for no
particularly good reason.
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index 771cd06..4587201 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -288,10 +288,11 @@ static PyObject * rpmds_new(PyTypeObject * subtype, PyObject *args, PyObject *kw
} else {
ds = rpmdsNew(h, tagN, 0);
}
+ } else {
+ PyErr_SetString(PyExc_TypeError, "header or tuple expected");
+ return NULL;
}
- if (ds == NULL) return NULL;
-
return rpmds_Wrap(subtype, ds);
}

View File

@ -21,7 +21,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: 14%{?dist}
Release: 15%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@ -50,6 +50,8 @@ Patch205: rpm-4.8.0-erasure-dsi.patch
Patch206: rpm-4.8.0-prep-keep-empty.patch
Patch207: rpm-4.8.0-python-nocontexts.patch
Patch208: rpm-4.8.0-python-mibool.patch
Patch209: rpm-4.8.0-python-emptyds.patch
Patch210: rpm-4.8.0-findlang-localedirs.patch
# These are not yet upstream
Patch301: rpm-4.6.0-niagara.patch
@ -205,6 +207,8 @@ packages on a system.
%patch206 -p1 -b .prep-keep-empty
%patch207 -p1 -b .python-nocontexts
%patch208 -p1 -b .python-mibool
%patch209 -p1 -b .python-emptyds
%patch210 -p1 -b .findlang-localedirs
%patch301 -p1 -b .niagara
%patch302 -p1 -b .geode
@ -420,6 +424,10 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Fri May 21 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-15
- handle non-existent dependency sets correctly in python (#593553)
- make find-lang look in all locale dirs (#584866)
* Fri Apr 23 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-14
- lose dangling symlink to extinct (and useless) berkeley_db_svc (#585174)