From aa7103c50e7c058eaf5482e54e1b65b7f7a63cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Thu, 10 Sep 2015 09:59:23 +0200 Subject: [PATCH] update to 2.7.3 - resolves #1261678 --- .gitignore | 2 +- ...y-to-get-terminal-width-from-dev-tty.patch | 72 ------------------- man-db.spec | 9 ++- sources | 2 +- 4 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 1255930-try-to-get-terminal-width-from-dev-tty.patch diff --git a/.gitignore b/.gitignore index 841275b..cfd11a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/man-db-2.7.2.tar.xz +/man-db-2.7.3.tar.xz diff --git a/1255930-try-to-get-terminal-width-from-dev-tty.patch b/1255930-try-to-get-terminal-width-from-dev-tty.patch deleted file mode 100644 index 0d664b6..0000000 --- a/1255930-try-to-get-terminal-width-from-dev-tty.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 80f1dc0fe23b9f6ec9eb2ea7c5a2b654e9840dd9 Mon Sep 17 00:00:00 2001 -From: Colin Watson -Date: Sat, 22 Aug 2015 11:13:11 +0000 -Subject: Try to get terminal width from /dev/tty - -If man is running within something like lesspipe, then there may be -a current tty that neither stdin nor stdout points to. Try to get -hold of it using /dev/tty. Fixes Fedora bug #1255930. - -* lib/linelength.c (get_line_length): Try /dev/tty before either -stdout or stdin. ---- -diff --git a/lib/linelength.c b/lib/linelength.c -index f2632a7..69a702f 100644 ---- a/lib/linelength.c -+++ b/lib/linelength.c -@@ -34,6 +34,13 @@ - #include - #include - #include -+#include -+#include -+#include -+ -+#ifndef _PATH_TTY -+# define _PATH_TTY "/dev/tty" -+#endif /* _PATH_TTY */ - - static int line_length = -1; - -@@ -42,7 +49,7 @@ int get_line_length (void) - const char *columns; - int width; - #ifdef TIOCGWINSZ -- int stdin_tty, stdout_tty; -+ int dev_tty, tty_fd = -1; - #endif - - if (line_length != -1) -@@ -72,14 +79,25 @@ int get_line_length (void) - * may well be because the user is trying something like - * 'MAN_KEEP_STDERR=1 man foo >/dev/null' to see just the error - * messages, so use the window size from stdin as a fallback. -+ * In some cases we may have neither (e.g. if man is running inside -+ * lesspipe); /dev/tty should be a reliable way to get to the -+ * current tty if it exists. - */ -- stdin_tty = isatty (STDIN_FILENO); -- stdout_tty = isatty (STDOUT_FILENO); -- if (stdin_tty || stdout_tty) { -+ dev_tty = open (_PATH_TTY, O_RDONLY); -+ if (dev_tty >= 0) -+ tty_fd = dev_tty; -+ else if (isatty (STDOUT_FILENO)) -+ tty_fd = STDOUT_FILENO; -+ else if (isatty (STDIN_FILENO)) -+ tty_fd = STDIN_FILENO; -+ if (tty_fd >= 0) { -+ int ret; - struct winsize wsz; - -- if (ioctl (stdout_tty ? STDOUT_FILENO : STDIN_FILENO, -- TIOCGWINSZ, &wsz)) -+ ret = ioctl (tty_fd, TIOCGWINSZ, &wsz); -+ if (dev_tty >= 0) -+ close (dev_tty); -+ if (ret) - perror ("TIOCGWINSZ failed"); - else if (wsz.ws_col) - return line_length = wsz.ws_col; --- -cgit v0.9.0.2 diff --git a/man-db.spec b/man-db.spec index 95168fc..2b52bee 100644 --- a/man-db.spec +++ b/man-db.spec @@ -3,8 +3,8 @@ Summary: Tools for searching and reading man pages Name: man-db -Version: 2.7.2 -Release: 3%{?dist} +Version: 2.7.3 +Release: 1%{?dist} # GPLv2+ .. man-db # GPLv3+ .. gnulib License: GPLv2+ and GPLv3+ @@ -15,7 +15,6 @@ Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.ta Source1: man-db.crondaily Source2: man-db.sysconfig Patch0: 1151558-switch-man-and-root-in-init-systemd-man-db.conf.patch -Patch1: 1255930-try-to-get-terminal-width-from-dev-tty.patch Obsoletes: man < 2.0 Provides: man = %{version} @@ -135,6 +134,10 @@ fi %lang(zh_CN) %{_datadir}/man/zh_CN/man*/* %changelog +* Thu Sep 10 2015 Nikola Forró - 2.7.3-1 +- update to 2.7.3 + resolves #1261678 + * Mon Aug 24 2015 Nikola Forró - 2.7.2-3 - try to get terminal width from /dev/tty resolves #1255930 diff --git a/sources b/sources index 94a3e54..95b5e5a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4b9480e4f1da04abb22ae7a9345ace6b man-db-2.7.2.tar.xz +df898c82d766dad6492a5a96d5a26647 man-db-2.7.3.tar.xz