From ead47067ec888833255aeb48d970779e3fa69a6a Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Wed, 25 Mar 2015 21:57:32 +0100 Subject: [PATCH] Hide protected functions from other modules This is done in order to avoid symbol collisions with libsolv library, namely the map_* symbols collide. Resolves: rhbz#1201897 --- ...-characters-only-if-charset-is-not-U.patch | 30 +++++++++++++++++++ ...protected-symbols-from-other-modules.patch | 27 +++++++++++++++++ libedit-wchar.patch | 17 ----------- libedit.spec | 12 ++++++-- 4 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch create mode 100644 0002-Hide-protected-symbols-from-other-modules.patch delete mode 100644 libedit-wchar.patch diff --git a/0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch b/0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch new file mode 100644 index 0000000..44b6c4d --- /dev/null +++ b/0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch @@ -0,0 +1,30 @@ +From 8c0f52589d106e5ac32d7868d7b51d3dfab6c0a5 Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Wed, 25 Mar 2015 17:33:00 +0100 +Subject: [PATCH] Ignore non-ASCII characters only if charset is not UTF-8 + +--- + src/eln.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/eln.c b/src/eln.c +index 5bcfb4f..6023891 100644 +--- a/src/eln.c ++++ b/src/eln.c +@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread) + { + const wchar_t *tmp; + +- el->el_flags |= IGNORE_EXTCHARS; ++ if (!(el->el_flags & CHARSET_IS_UTF8)) ++ el->el_flags |= IGNORE_EXTCHARS; + tmp = el_wgets(el, nread); +- el->el_flags &= ~IGNORE_EXTCHARS; ++ if (!(el->el_flags & CHARSET_IS_UTF8)) ++ el->el_flags &= ~IGNORE_EXTCHARS; + return ct_encode_string(tmp, &el->el_lgcyconv); + } + +-- +2.1.0 + diff --git a/0002-Hide-protected-symbols-from-other-modules.patch b/0002-Hide-protected-symbols-from-other-modules.patch new file mode 100644 index 0000000..8e2cca2 --- /dev/null +++ b/0002-Hide-protected-symbols-from-other-modules.patch @@ -0,0 +1,27 @@ +From 9ac358bf7fe9a6c322edc1fc85a5d288c5f8f92d Mon Sep 17 00:00:00 2001 +From: Boris Ranto +Date: Wed, 25 Mar 2015 21:37:07 +0100 +Subject: [PATCH] Hide protected symbols from other modules + +--- + src/sys.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/sys.h b/src/sys.h +index 25b14bb..f039532 100644 +--- a/src/sys.h ++++ b/src/sys.h +@@ -71,8 +71,8 @@ + #endif + + #ifndef protected +-# define protected /* Redefined from elsewhere to "static" */ +- /* When we want to hide everything */ ++# define protected __attribute__ ((visibility ("hidden"))) ++ /* hide protected symbols from other modules */ + #endif + + #ifndef __arraycount +-- +2.1.0 + diff --git a/libedit-wchar.patch b/libedit-wchar.patch deleted file mode 100644 index 2827a22..0000000 --- a/libedit-wchar.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -rup libedit-20141029-3.1-bak/src/eln.c libedit-20141029-3.1/src/eln.c ---- libedit-20141029-3.1-bak/src/eln.c 2015-03-14 09:19:41.804370242 +0100 -+++ libedit-20141029-3.1/src/eln.c 2015-03-15 08:58:36.182162570 +0100 -@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread) - { - const wchar_t *tmp; - -- el->el_flags |= IGNORE_EXTCHARS; -+ if (!(el->el_flags & CHARSET_IS_UTF8)) -+ el->el_flags |= IGNORE_EXTCHARS; - tmp = el_wgets(el, nread); -- el->el_flags &= ~IGNORE_EXTCHARS; -+ if (!(el->el_flags & CHARSET_IS_UTF8)) -+ el->el_flags &= ~IGNORE_EXTCHARS; - return ct_encode_string(tmp, &el->el_lgcyconv); - } - diff --git a/libedit.spec b/libedit.spec index 4afaa6b..8486075 100644 --- a/libedit.spec +++ b/libedit.spec @@ -4,12 +4,13 @@ Summary: The NetBSD Editline library Name: libedit Version: 3.1 -Release: 10.%{snap}cvs%{?dist} +Release: 11.%{snap}cvs%{?dist} License: BSD Group: System Environment/Libraries URL: http://www.thrysoee.dk/editline/ Source0: http://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz -Patch0: libedit-wchar.patch +Patch1: 0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch +Patch2: 0002-Hide-protected-symbols-from-other-modules.patch BuildRequires: ncurses-devel %description @@ -30,7 +31,8 @@ This package contains development files for %{name}. %prep %setup -q -n %{name}-%{dir_snap}-%{version} -%patch0 -p1 +%patch1 -p1 +%patch2 -p1 # Suppress rpmlint error. iconv -f ISO8859-1 -t UTF-8 -o ChangeLog.utf-8 ChangeLog @@ -71,6 +73,10 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -delete %{_includedir}/editline/readline.h %changelog +* Wed Mar 25 2015 Boris Ranto - 3.1-11.20141030cvs +- change the format of patches +- hide protected functions from other modules + * Wed Mar 18 2015 Boris Ranto - 3.1-10.20141030cvs - ignore external characters in input only if not utf8