sysutils/vifm: update to 0.12.1, from maintainer xaizek at posteo.net

All patches merged upstream.
This commit is contained in:
landry 2022-09-22 11:17:31 +00:00
parent f6366ff551
commit ef5a410386
14 changed files with 6 additions and 320 deletions

View File

@ -1,5 +1,5 @@
COMMENT = ncurses file manager with Vim-like everything
V = 0.12
V = 0.12.1
DISTNAME = vifm-${V}
CATEGORIES = sysutils
HOMEPAGE = https://vifm.info/

View File

@ -1,2 +1,2 @@
SHA256 (vifm-0.12.tar.bz2) = M6lhjzKzW1uMZEg4hPmtCZY8qEZbKTXe95FZAo4nssA=
SIZE (vifm-0.12.tar.bz2) = 1426579
SHA256 (vifm-0.12.1.tar.bz2) = j+KBPr3Mz+ma7OArBdYqIJkVJdRrDM+67Dr2FMZlVog=
SIZE (vifm-0.12.1.tar.bz2) = 1510709

View File

@ -1,24 +0,0 @@
1. Install Default-256.vifm with other sample color schemes.
2. Port system exports CFLAGS and LDFLAGS which breaks tests.
Index: src/Makefile.in
--- src/Makefile.in.orig
+++ src/Makefile.in
@@ -628,7 +628,8 @@ dist_sample_colors__DATA = ../data/colors/astrell-root
../data/colors/dmilith-user.vifm \
../data/colors/istib-solarized-dark.vifm \
../data/colors/juef-zenburn.vifm \
- ../data/colors/reicheltd-light.vifm
+ ../data/colors/reicheltd-light.vifm \
+ ../data/colors/Default-256.vifm
dist_vim_doc__DATA = ../data/vim/doc/plugin/vifm-plugin.txt
nodist_vim_doc__DATA = $(abs_srcdir)/../data/vim/doc/plugin/tags
@@ -2599,6 +2600,7 @@ clean-local:
runtests:
echo 'mkdir -p $(abs_builddir)/../tests/' > $@_
+ echo 'unset CFLAGS LDFLAGS' > $@_
echo \
'$(MAKE) -C $(abs_srcdir)/../tests B=$(abs_builddir)/../tests/ CC="$(CC)"' \
>> $@_

View File

@ -1,23 +0,0 @@
Disable old workaround for curses on OpenBSD.
Index: src/compat/curses.c
--- src/compat/curses.c.orig
+++ src/compat/curses.c
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#ifdef __OpenBSD__
+#ifdef FAKE_NCURSESW
#include "curses.h"
@@ -31,7 +31,7 @@ int
compat_wget_wch(WINDOW *w, wint_t *wc)
{
*wc = wgetch(w);
- return ((char)*wc == ERR) ? ERR : OK;
+ return ((char)*wc == ERR) ? ERR : (*wc >= KEY_MIN ? KEY_CODE_YES : OK);
}
int

View File

@ -1,21 +0,0 @@
Disable old workaround for curses on OpenBSD.
Index: src/compat/curses.h
--- src/compat/curses.h.orig
+++ src/compat/curses.h
@@ -31,11 +31,11 @@
* for implementation as it needs more than just wchar_t.) */
#define K(x) ((wchar_t)((wint_t)0xe000 + 1 + (x)))
-/* OpenBSD has perverted ncurses library, which has stubs with infinite loops
- * instead of real wide functions. As there is only a couple of wide functions
- * in use, they can be emulated. */
+/* In the past OpenBSD has perverted ncurses library, which had stubs with
+ * infinite loops instead of real wide functions. As there is only a couple of
+ * wide functions in use, they can be emulated on systems like that. */
-#ifndef __OpenBSD__
+#ifndef FAKE_NCURSESW
#define compat_wget_wch wget_wch
#define compat_waddwstr waddwstr

View File

@ -1,34 +0,0 @@
Handle $TERM not being defined in tests.
Index: src/int/term_title.c
--- src/int/term_title.c.orig
+++ src/int/term_title.c
@@ -52,6 +52,7 @@
#include "../utils/test_helpers.h"
#include "../utils/utf8.h"
#include "../utils/utils.h"
+#include "../vifm.h"
/* Kind of title we're working with. */
typedef enum
@@ -180,7 +181,7 @@ ensure_initialized(void)
title_state.kind = query_title_kind();
if(title_state.kind == TK_ABSENT)
{
- title_state.kind = title_kind_for_termenv(env_get("TERM"));
+ title_state.kind = title_kind_for_termenv(env_get_def("TERM", ""));
apply_term_guess(title_state.kind);
}
@@ -198,9 +199,9 @@ query_title_kind(void)
{
#ifndef _WIN32
int need_cleanup = 0;
- if(cur_term == NULL)
+ if(cur_term == NULL && !vifm_testing())
{
- (void)setupterm((char *)env_get("TERM"), 1, (int *)0);
+ (void)setupterm((char *)env_get_def("TERM", ""), 1, (int *)0);
need_cleanup = 1;
}

View File

@ -1,22 +0,0 @@
Handle $TERM not being defined in tests.
Index: src/ui/fileview.c
--- src/ui/fileview.c.orig
+++ src/ui/fileview.c
@@ -49,6 +49,7 @@
#include "../flist_pos.h"
#include "../opt_handlers.h"
#include "../sort.h"
+#include "../vifm.h"
#include "color_scheme.h"
#include "column_view.h"
#include "quickview.h"
@@ -274,7 +275,7 @@ draw_dir_list_only(view_t *view)
size_t col_width, col_count;
int visible_cells;
- if(curr_stats.load_stage < 2)
+ if(curr_stats.load_stage < 2 || vifm_testing())
{
return;
}

View File

@ -1,37 +0,0 @@
1. Rely on flags in `config.h`
2. Improve detection of clang.
Index: tests/Makefile
--- tests/Makefile.orig
+++ tests/Makefile
@@ -143,8 +143,7 @@ override CFLAGS := $(CFLAGS) -MMD -MP -pipe \
-Wall -Wno-char-subscripts \
-Itest-support/ -Itest-support/stic/ \
-include $(B)../build-aux/config.h \
- -DTEST -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED \
- -D_FILE_OFFSET_BITS=64
+ -DTEST
override LDFLAGS := $(LDFLAGS)
ifdef unix_env
MF := $(abspath $(B)../src/Makefile)
@@ -177,15 +176,18 @@ override CFLAGS += -fcommon
ifeq (,$(findstring -lpthread,$(LDFLAGS)))
override LDFLAGS += -pthread
endif
+
+# work around clang
+is_clang_cc := $(findstring clang,$(shell $(ACTUAL_CC) --version))
ifneq (,$(findstring --coverage, $(LDFLAGS)))
- ifeq (,$(findstring clang,$(CC)))
+ ifeq (,$(is_clang_cc))
# clang is inconvenient with regard to this flag, don't do coverage with
# it
override CFLAGS += --coverage
override LDFLAGS += --coverage
endif
endif
-ifeq (,$(findstring clang,$(CC)))
+ifeq (,$(is_clang_cc))
# don't precompile header with clang (on OS X gcc is likely to be a symlink
# to clang) because it handles macros in a different way
ifneq (Darwin,$(shell uname -s))

View File

@ -1,50 +0,0 @@
Disable a test on OpenBSD and other systems with BSD-like chown.
Index: tests/fileops/chmod.c
--- tests/fileops/chmod.c.orig
+++ tests/fileops/chmod.c
@@ -22,7 +22,7 @@ static void set_file_perms(const int perms[13]);
static void alloc_file_list(view_t *view, const char filename[]);
static mode_t perms_to_mode(const int perms[13]);
static mode_t get_perms(const char path[]);
-static int not_osx(void);
+static int can_reset_x_on_files(void);
static mode_t mask;
@@ -92,7 +92,7 @@ set_file_perms(const int perms[13])
assert_success(unlink(SANDBOX_PATH "/file"));
}
-TEST(reset_executable_bits_from_files_only, IF(not_osx))
+TEST(reset_executable_bits_from_files_only, IF(can_reset_x_on_files))
{
FILE *f;
@@ -188,13 +188,20 @@ get_perms(const char path[])
}
static int
-not_osx(void)
+can_reset_x_on_files(void)
{
-#ifndef __APPLE__
- return 1;
-#else
- return 0;
-#endif
+ FILE *f;
+ assert_non_null(f = fopen(SANDBOX_PATH "/file", "w"));
+ fclose(f);
+
+ assert_success(chmod(SANDBOX_PATH "/file", 0777));
+ assert_int_equal(0777, get_perms(SANDBOX_PATH "/file"));
+
+ assert_success(os_system("chmod a-x+X " SANDBOX_PATH "/file"));
+ int perms = get_perms(SANDBOX_PATH "/file");
+ assert_success(unlink(SANDBOX_PATH "/file"));
+
+ return (perms == 0666);
}
#endif

View File

@ -1,14 +0,0 @@
Work around chown being mocked on OpenBSD on `make test`.
Index: tests/fileops/chown.c
--- tests/fileops/chown.c.orig
+++ tests/fileops/chown.c
@@ -1,6 +1,7 @@
#include <stic.h>
-#ifndef _WIN32
+/* Port system of OpenBSD mocks `chown` which breaks this test */
+#if !defined(_WIN32) && !defined(__OpenBSD__)
#include <sys/types.h>
#include <unistd.h> /* chdir() unlink() */

View File

@ -1,17 +0,0 @@
Skip checking atime.
Index: tests/fileops/generic.c
--- tests/fileops/generic.c.orig
+++ tests/fileops/generic.c
@@ -244,7 +244,11 @@ perform_merge(int op)
#define st_atim st_atime
#define st_mtim st_mtime
#endif
+#ifndef __OpenBSD__
+ /* Whether this works actually depends on file-system and its mount
+ * options. */
assert_success(memcmp(&src.st_atim, &dst.st_atim, sizeof(src.st_atim)));
+#endif
assert_success(memcmp(&src.st_mtim, &dst.st_mtim, sizeof(src.st_mtim)));
assert_success(memcmp(&src.st_mode, &dst.st_mode, sizeof(src.st_mode)));
}

View File

@ -1,24 +0,0 @@
Work around weird mime-type of directories.
Index: tests/utils/matcher.c
--- tests/utils/matcher.c.orig
+++ tests/utils/matcher.c
@@ -4,6 +4,7 @@
#include <stdio.h> /* remove() */
#include <stdlib.h> /* free() */
+#include <string.h> /* strcmp() */
#include <test-utils.h>
@@ -463,7 +464,9 @@ has_mime_type_detection(void)
static int
has_mime_type_detection_and_not_windows(void)
{
- return has_mime_type_detection() && not_windows();
+ return has_mime_type_detection()
+ && not_windows()
+ && strcmp(get_mimetype(TEST_DATA_PATH, 0), "inode/directory") == 0;
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */

View File

@ -1,51 +0,0 @@
Don't hard-code OS X, do a runtime behaviour check.
Index: tests/utils/regexp.c
--- tests/utils/regexp.c.orig
+++ tests/utils/regexp.c
@@ -2,7 +2,7 @@
#include "../../src/utils/regexp.h"
-static int not_osx(void);
+static int has_empty_regexps(void);
TEST(bad_regex_leaves_line_unchanged)
{
@@ -10,10 +10,8 @@ TEST(bad_regex_leaves_line_unchanged)
regexp_replace("barfoobar", "*foo", "z", 1, 0));
}
-TEST(no_infinite_loop_on_empty_global_match, IF(not_osx))
+TEST(no_infinite_loop_on_empty_global_match, IF(has_empty_regexps))
{
- /* On OS X, regular expressions which can match empty strings don't
- * compile. */
assert_string_equal("zbarfoobar", regexp_replace("barfoobar", "", "z", 1, 0));
}
@@ -45,13 +43,18 @@ TEST(back_reference_substitution)
}
static int
-not_osx(void)
+has_empty_regexps(void)
{
-#ifndef __APPLE__
- return 1;
-#else
- return 0;
-#endif
+ /* At least on OS X and OpenBSD, regular expressions which can match empty
+ * strings don't compile. */
+ regex_t re;
+ int err = regcomp(&re, "", /*cflags=*/0);
+ if(err == 0)
+ {
+ err = regexec(&re, "bla", /*nmatch=*/0, /*pmatch=*/NULL, /*eflags=*/0);
+ regfree(&re);
+ }
+ return (err == 0);
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */

View File

@ -21,6 +21,9 @@ share/doc/vifm/INSTALL
share/doc/vifm/NEWS
share/doc/vifm/README
share/doc/vifm/TODO
share/fish/
share/fish/vendor_completions.d/
share/fish/vendor_completions.d/vifm.fish
@comment share/pixmaps/
@comment share/pixmaps/vifm.png
share/vifm/