1 |
commit: 11c1d710556ac8e59d1c4fd68ba0d2d23b2757ca |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 20 17:12:41 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 20 17:12:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11c1d710 |
7 |
|
8 |
app-misc/mc: improve iso9660 error detection, bug #533214 |
9 |
|
10 |
Reported-by: Łukasz Stelmach |
11 |
Bug: https://bugs.gentoo.org/533214 |
12 |
Package-Manager: Portage-2.3.69, Repoman-2.3.16 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
app-misc/mc/files/mc-4.8.23-3933-iso9660-1.patch | 85 +++++++++++++++++ |
16 |
app-misc/mc/files/mc-4.8.23-3933-iso9660-2.patch | 29 ++++++ |
17 |
app-misc/mc/mc-4.8.23-r1.ebuild | 111 +++++++++++++++++++++++ |
18 |
3 files changed, 225 insertions(+) |
19 |
|
20 |
diff --git a/app-misc/mc/files/mc-4.8.23-3933-iso9660-1.patch b/app-misc/mc/files/mc-4.8.23-3933-iso9660-1.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..be08e68b296 |
23 |
--- /dev/null |
24 |
+++ b/app-misc/mc/files/mc-4.8.23-3933-iso9660-1.patch |
25 |
@@ -0,0 +1,85 @@ |
26 |
+From afdc9719f3e37921b621046f01f23fe6b705f059 Mon Sep 17 00:00:00 2001 |
27 |
+From: Andrew Borodin <aborodin@×××××.ru> |
28 |
+Date: Sun, 7 Jul 2019 14:44:10 +0300 |
29 |
+Subject: [PATCH 1/2] Ticket #3933: report iso9660 listing errors. |
30 |
+ |
31 |
+Variation 1: |
32 |
+ |
33 |
+Steps to reproduce: |
34 |
+ |
35 |
+ * create empty .iso file (touch foo.iso) |
36 |
+ * run 'mc' and press enter on empty .iso |
37 |
+ |
38 |
+Expected result: some error about invalid file format (sililar to what |
39 |
+F3 view would yield). |
40 |
+Actual result: mc elters a file as if it would be empty valid file. |
41 |
+ |
42 |
+Variation 2: |
43 |
+Steps to reproduce: |
44 |
+ |
45 |
+ * pick valid .iso file |
46 |
+ * deinstall all helper tools that handle .sio (isoinfo, xorriso, etc.) |
47 |
+ * run 'mc' and press enter on empty .iso |
48 |
+ |
49 |
+Expected result: some error about invalid file format (sililar to what |
50 |
+F3 view would yield) |
51 |
+Actual result: mc enters a file as if it would be empty valid file |
52 |
+ |
53 |
+Variation 2 is especially confusing for users as it does not hint them |
54 |
+that they should install a tool to get it working. They just observe |
55 |
+silently broken behaviour. |
56 |
+ |
57 |
+Signed-off-by: Andrew Borodin <aborodin@×××××.ru> |
58 |
+--- |
59 |
+ src/vfs/extfs/helpers/iso9660.in | 14 +++++++++++--- |
60 |
+ 1 file changed, 11 insertions(+), 3 deletions(-) |
61 |
+ |
62 |
+diff --git a/src/vfs/extfs/helpers/iso9660.in b/src/vfs/extfs/helpers/iso9660.in |
63 |
+index 8c2240e8e..76273522e 100644 |
64 |
+--- a/src/vfs/extfs/helpers/iso9660.in |
65 |
++++ b/src/vfs/extfs/helpers/iso9660.in |
66 |
+@@ -93,6 +93,8 @@ xorriso_rm() { |
67 |
+ |
68 |
+ # tested to comply with isoinfo 2.0's output |
69 |
+ test_iso () { |
70 |
++ which isoinfo 2>/dev/null || (echo "isoinfo not found" >&2; return 1) |
71 |
++ |
72 |
+ CHARSET=$(locale charmap 2>/dev/null) |
73 |
+ if test -z "$CHARSET"; then |
74 |
+ CHARSET=$(locale 2>/dev/null | @GREP@ LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p') |
75 |
+@@ -119,6 +121,8 @@ test_iso () { |
76 |
+ } |
77 |
+ |
78 |
+ mcisofs_list () { |
79 |
++ local lsl r |
80 |
++ |
81 |
+ # left as a reminder to implement compressed image support =) |
82 |
+ case "$1" in |
83 |
+ *.lz) MYCAT="lzip -dc";; |
84 |
+@@ -133,7 +137,11 @@ mcisofs_list () { |
85 |
+ *) MYCAT="cat";; |
86 |
+ esac |
87 |
+ |
88 |
+- $ISOINFO -l -i "$1" 2>/dev/null | @AWK@ -v SEMICOLON=$SEMICOLON ' |
89 |
++ lsl=$($ISOINFO -l -i "$1" 2>/dev/null) |
90 |
++ r=$? |
91 |
++ test $r -gt 0 && return $r |
92 |
++ |
93 |
++ echo "$lsl" | @AWK@ -v SEMICOLON=$SEMICOLON ' |
94 |
+ BEGIN { |
95 |
+ dir=""; |
96 |
+ # Pattern to match 8 first fields. |
97 |
+@@ -183,8 +191,8 @@ shift |
98 |
+ case "$cmd" in |
99 |
+ list) |
100 |
+ xorriso_list "$@" || { |
101 |
+- test_iso "$@"; |
102 |
+- mcisofs_list "$@"; |
103 |
++ test_iso "$@" || exit 1 |
104 |
++ mcisofs_list "$@" || exit 1 |
105 |
+ } |
106 |
+ exit 0 |
107 |
+ ;; |
108 |
+-- |
109 |
+2.22.0 |
110 |
+ |
111 |
|
112 |
diff --git a/app-misc/mc/files/mc-4.8.23-3933-iso9660-2.patch b/app-misc/mc/files/mc-4.8.23-3933-iso9660-2.patch |
113 |
new file mode 100644 |
114 |
index 00000000000..173def62eb0 |
115 |
--- /dev/null |
116 |
+++ b/app-misc/mc/files/mc-4.8.23-3933-iso9660-2.patch |
117 |
@@ -0,0 +1,29 @@ |
118 |
+From c1b6d29b95a373108e8d03ac629dcb03fcec854c Mon Sep 17 00:00:00 2001 |
119 |
+From: Andrew Borodin <aborodin@×××××.ru> |
120 |
+Date: Sun, 7 Jul 2019 15:51:28 +0300 |
121 |
+Subject: [PATCH 2/2] iso9660: report errors in copyout in case of isoinfo |
122 |
+ usage. |
123 |
+ |
124 |
+Signed-off-by: Andrew Borodin <aborodin@×××××.ru> |
125 |
+--- |
126 |
+ src/vfs/extfs/helpers/iso9660.in | 4 ++-- |
127 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
128 |
+ |
129 |
+diff --git a/src/vfs/extfs/helpers/iso9660.in b/src/vfs/extfs/helpers/iso9660.in |
130 |
+index 76273522e..f9c6e50ef 100644 |
131 |
+--- a/src/vfs/extfs/helpers/iso9660.in |
132 |
++++ b/src/vfs/extfs/helpers/iso9660.in |
133 |
+@@ -222,8 +222,8 @@ case "$cmd" in |
134 |
+ ;; |
135 |
+ copyout) |
136 |
+ xorriso_copyout "$@" || { |
137 |
+- test_iso "$@"; |
138 |
+- mcisofs_copyout "$@"; |
139 |
++ test_iso "$@" || exit 1 |
140 |
++ mcisofs_copyout "$@" || exit 1 |
141 |
+ } |
142 |
+ exit 0 |
143 |
+ ;; |
144 |
+-- |
145 |
+2.22.0 |
146 |
+ |
147 |
|
148 |
diff --git a/app-misc/mc/mc-4.8.23-r1.ebuild b/app-misc/mc/mc-4.8.23-r1.ebuild |
149 |
new file mode 100644 |
150 |
index 00000000000..322ccb31aed |
151 |
--- /dev/null |
152 |
+++ b/app-misc/mc/mc-4.8.23-r1.ebuild |
153 |
@@ -0,0 +1,111 @@ |
154 |
+# Copyright 1999-2019 Gentoo Authors |
155 |
+# Distributed under the terms of the GNU General Public License v2 |
156 |
+ |
157 |
+EAPI=7 |
158 |
+ |
159 |
+inherit flag-o-matic |
160 |
+ |
161 |
+MY_P=${P/_/-} |
162 |
+ |
163 |
+DESCRIPTION="GNU Midnight Commander is a text based file manager" |
164 |
+HOMEPAGE="https://www.midnight-commander.org" |
165 |
+SRC_URI="http://ftp.midnight-commander.org/${MY_P}.tar.xz" |
166 |
+ |
167 |
+LICENSE="GPL-3" |
168 |
+SLOT="0" |
169 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris" |
170 |
+IUSE="+edit gpm nls samba sftp +slang spell test unicode X +xdg" |
171 |
+ |
172 |
+REQUIRED_USE="spell? ( edit )" |
173 |
+ |
174 |
+RDEPEND=">=dev-libs/glib-2.26.0:2 |
175 |
+ gpm? ( sys-libs/gpm ) |
176 |
+ kernel_linux? ( sys-fs/e2fsprogs ) |
177 |
+ samba? ( net-fs/samba ) |
178 |
+ sftp? ( net-libs/libssh2 ) |
179 |
+ slang? ( >=sys-libs/slang-2 ) |
180 |
+ !slang? ( sys-libs/ncurses:0=[unicode?] ) |
181 |
+ spell? ( app-text/aspell ) |
182 |
+ X? ( x11-libs/libX11 |
183 |
+ x11-libs/libICE |
184 |
+ x11-libs/libXau |
185 |
+ x11-libs/libXdmcp |
186 |
+ x11-libs/libSM )" |
187 |
+DEPEND="${RDEPEND} |
188 |
+ app-arch/xz-utils |
189 |
+ virtual/pkgconfig |
190 |
+ nls? ( sys-devel/gettext ) |
191 |
+ test? ( dev-libs/check ) |
192 |
+ " |
193 |
+ |
194 |
+S=${WORKDIR}/${MY_P} |
195 |
+ |
196 |
+PATCHES=( |
197 |
+ "${FILESDIR}"/${P}-3933-iso9660-1.patch |
198 |
+ "${FILESDIR}"/${P}-3933-iso9660-2.patch |
199 |
+) |
200 |
+ |
201 |
+pkg_pretend() { |
202 |
+ if use slang && use unicode ; then |
203 |
+ ewarn "\"unicode\" USE flag only takes effect when the \"slang\" USE flag is disabled." |
204 |
+ fi |
205 |
+} |
206 |
+ |
207 |
+src_configure() { |
208 |
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket" |
209 |
+ |
210 |
+ local myeconfargs=( |
211 |
+ --disable-dependency-tracking |
212 |
+ --disable-silent-rules |
213 |
+ --enable-charset |
214 |
+ --enable-vfs |
215 |
+ --with-homedir=$(usex xdg 'XDG' '.mc') |
216 |
+ --with-screen=$(usex slang 'slang' "ncurses$(usex unicode 'w' '')") |
217 |
+ $(use_enable kernel_linux vfs-undelfs) |
218 |
+ # Today mclib does not expose any headers and is linked to |
219 |
+ # single 'mc' binary. Thus there is no advantage of having |
220 |
+ # a library. Let's avoid shared library altogether |
221 |
+ # as it also conflicts with sci-libs/mc: bug #685938 |
222 |
+ --disable-mclib |
223 |
+ $(use_enable nls) |
224 |
+ $(use_enable samba vfs-smb) |
225 |
+ $(use_enable sftp vfs-sftp) |
226 |
+ $(use_enable spell aspell) |
227 |
+ $(use_enable test tests) |
228 |
+ $(use_with gpm gpm-mouse) |
229 |
+ $(use_with X x) |
230 |
+ $(use_with edit internal-edit) |
231 |
+ ) |
232 |
+ econf "${myeconfargs[@]}" |
233 |
+} |
234 |
+ |
235 |
+src_test() { |
236 |
+ # CK_FORK=no to avoid using fork() in check library |
237 |
+ # as mc mocks fork() itself: bug #644462. |
238 |
+ # |
239 |
+ # VERBOSE=1 to make test failures contain detailed |
240 |
+ # information. |
241 |
+ CK_FORK=no emake check VERBOSE=1 |
242 |
+} |
243 |
+ |
244 |
+src_install() { |
245 |
+ emake DESTDIR="${D}" install |
246 |
+ dodoc AUTHORS README NEWS |
247 |
+ |
248 |
+ # fix bug #334383 |
249 |
+ if use kernel_linux && [[ ${EUID} == 0 ]] ; then |
250 |
+ fowners root:tty /usr/libexec/mc/cons.saver |
251 |
+ fperms g+s /usr/libexec/mc/cons.saver |
252 |
+ fi |
253 |
+ |
254 |
+ if ! use xdg ; then |
255 |
+ sed 's@MC_XDG_OPEN="xdg-open"@MC_XDG_OPEN="/bin/false"@' \ |
256 |
+ -i "${ED%/}"/usr/libexec/mc/ext.d/*.sh || die |
257 |
+ fi |
258 |
+} |
259 |
+ |
260 |
+pkg_postinst() { |
261 |
+ elog "To enable exiting to latest working directory," |
262 |
+ elog "put this into your ~/.bashrc:" |
263 |
+ elog ". ${EPREFIX}/usr/libexec/mc/mc.sh" |
264 |
+} |