From 44d81dc91610b1dc5d42cb8ff16efc8f475af02c Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Jul 11 2019 13:10:28 +0000 Subject: Fix building with glibc 2.25 --- diff --git a/vifm-0.8.2-Conditionally-display-device-ID-in-file-info.patch b/vifm-0.8.2-Conditionally-display-device-ID-in-file-info.patch new file mode 100644 index 0000000..1d935c8 --- /dev/null +++ b/vifm-0.8.2-Conditionally-display-device-ID-in-file-info.patch @@ -0,0 +1,64 @@ +From fdc939f21c5e3c28bb529417de0e20ee3d94c2d8 Mon Sep 17 00:00:00 2001 +From: xaizek +Date: Fri, 7 Jul 2017 20:25:54 +0300 +Subject: [PATCH] Conditionally display device ID in file info +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Check whether major and minor macros are available, they aren't +defined in POSIX. + +Thanks to Robert Sarkozi. + +Petr Písař: Ported from df383c6adab6342cbb2177527917caed7400b207 to +0.8.2. + +Signed-off-by: Petr Písař +--- + src/modes/file_info.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/src/modes/file_info.c b/src/modes/file_info.c +index a541255..b1a9b29 100644 +--- a/src/modes/file_info.c ++++ b/src/modes/file_info.c +@@ -316,22 +316,26 @@ show_file_type(FileView *view, int curr_y) + const char *const type = (entry->type == FT_CHAR_DEV) + ? "Character Device" + : "Block Device"; +- char full_path[PATH_MAX]; +- struct stat st; + + mvwaddstr(menu_win, curr_y, 8, type); + +- get_current_full_path(view, sizeof(full_path), full_path); +- if(os_stat(full_path, &st) == 0) ++#if defined(major) && defined(minor) + { +- char info[64]; ++ char full_path[PATH_MAX]; ++ struct stat st; ++ get_current_full_path(view, sizeof(full_path), full_path); ++ if(os_stat(full_path, &st) == 0) ++ { ++ char info[64]; + +- snprintf(info, sizeof(info), "Device Id: 0x%x:0x%x", major(st.st_rdev), +- minor(st.st_rdev)); ++ snprintf(info, sizeof(info), "Device Id: 0x%x:0x%x", major(st.st_rdev), ++ minor(st.st_rdev)); + +- curr_y += 2; +- mvwaddstr(menu_win, curr_y, 2, info); ++ curr_y += 2; ++ mvwaddstr(menu_win, curr_y, 2, info); ++ } + } ++#endif + } + else if(entry->type == FT_SOCK) + { +-- +2.20.1 + diff --git a/vifm.spec b/vifm.spec index 96d8305..3fd10e3 100644 --- a/vifm.spec +++ b/vifm.spec @@ -4,12 +4,14 @@ Name: vifm Version: 0.8.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Lightweight file manager with vi like key-bindings License: GPLv2+ URL: http://vifm.info/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 +# Fix building with glibc 2.25, bug #1606644, in upstream after 0.9 +Patch0: vifm-0.8.2-Conditionally-display-device-ID-in-file-info.patch BuildRequires: gcc BuildRequires: autoconf @@ -34,6 +36,7 @@ A ncurses based CLI file manager with vi like key-bindings %prep %setup -q +%patch0 -p1 %build @@ -81,6 +84,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %changelog +* Thu Jul 11 2019 Petr Pisar - 0.8.2-8 +- Fix building with glibc 2.25 (bug #1606644) + * Sun Feb 03 2019 Fedora Release Engineering - 0.8.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild