From cf43ec2f6c12ef580d62b229f5194c27b9228437 Mon Sep 17 00:00:00 2001 From: Henrik Holst <6200749+hholst80@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:32:17 +0000 Subject: [PATCH 1/3] Update vifm to 0.13 --- .../vifm/patches/disable-failed-tests.patch | 38 ------------------- srcpkgs/vifm/template | 12 +++--- 2 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 srcpkgs/vifm/patches/disable-failed-tests.patch diff --git a/srcpkgs/vifm/patches/disable-failed-tests.patch b/srcpkgs/vifm/patches/disable-failed-tests.patch deleted file mode 100644 index f674a4be66d8..000000000000 --- a/srcpkgs/vifm/patches/disable-failed-tests.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git tests/Makefile tests/Makefile -index 1419a4edd..a213d70ef 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -67,14 +67,14 @@ B ?= - BUILD := $(B)bin/build/$(BINSUBDIR) - - # engine --suites += abbrevs autocmds cmds commands completion keys options parsing -+suites += abbrevs autocmds cmds completion keys options parsing - suites += text_buffer variables - # io - suites += ioeta ionotif iop ior - # ui - suites += colmgr column_view viewcolumns_parser - # everything else --suites += bmarks env escape fileops filetype filter lua misc undo utils -+suites += bmarks env escape fileops filetype filter undo utils - - # these are built, but not automatically executed - apps := fuzz regs_shmem_app -diff --git tests/fileops/chown.c tests/fileops/chown.c -index ef7b1a405..cd2c33388 100644 ---- a/tests/fileops/chown.c -+++ b/tests/fileops/chown.c -@@ -65,12 +65,10 @@ TEST(file_group_is_changed, IF(has_more_than_one_group)) - mark_selection_or_current(curr_view); - fops_chown(0, 1, 0, gid1); - assert_success(os_stat("dir/chown-me", &s)); -- assert_true(s.st_gid == gid1); - - mark_selection_or_current(curr_view); - fops_chown(0, 1, 0, gid2); - assert_success(os_stat("dir/chown-me", &s)); -- assert_true(s.st_gid == gid2); - - assert_success(unlink("dir/chown-me")); - assert_success(rmdir("dir")); diff --git a/srcpkgs/vifm/template b/srcpkgs/vifm/template index 67cc901ec943..fa820ceeba7b 100644 --- a/srcpkgs/vifm/template +++ b/srcpkgs/vifm/template @@ -1,20 +1,20 @@ # Template file for 'vifm' pkgname=vifm -version=0.12 +version=0.13 revision=1 build_style=gnu-configure configure_args="--without-gtk" hostmakedepends="mdocml" -makedepends="ncurses-devel file-devel" +makedepends="ncurses-devel file-devel perl" depends="desktop-file-utils" -short_desc="Ncurses-based file manager with vi-like keybindings" +short_desc="Vifm is a file manager with curses interface and a Vim-like environment" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://vifm.info/" -distfiles="${SOURCEFORGE_SITE}/vifm/vifm-${version}.tar.bz2" -checksum=33a9618f32b35b5b8c64483884f9ad09963ca8465b2935def79159028e27b2c0 +distfiles="https://github.com/vifm/vifm/releases/download/v0.13/vifm-0.13.tar.bz2" +checksum=0d9293749a794076ade967ecdc47d141d85e450370594765391bdf1a9bd45075 -CFLAGS="-fcommon" +CFLAGS="-fcommon -Wno-unused-result" post_install() { vsconf data/vifmrc From 83c5faf1151d854b39c91ef4b3186144d43255ba Mon Sep 17 00:00:00 2001 From: Henrik Holst <6200749+hholst80@users.noreply.github.com> Date: Wed, 5 Jul 2023 23:14:05 +0000 Subject: [PATCH 2/3] Update srcpkgs/vifm/template Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com> --- srcpkgs/vifm/template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcpkgs/vifm/template b/srcpkgs/vifm/template index fa820ceeba7b..ac6a9729a599 100644 --- a/srcpkgs/vifm/template +++ b/srcpkgs/vifm/template @@ -4,10 +4,10 @@ version=0.13 revision=1 build_style=gnu-configure configure_args="--without-gtk" -hostmakedepends="mdocml" -makedepends="ncurses-devel file-devel perl" +hostmakedepends="mdocml perl" +makedepends="ncurses-devel file-devel" depends="desktop-file-utils" -short_desc="Vifm is a file manager with curses interface and a Vim-like environment" +short_desc="File manager with curses interface and a Vim-like environment" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://vifm.info/" From 4e6e5887124c29fba929202d8bb5c70fe4983fa7 Mon Sep 17 00:00:00 2001 From: Henrik Holst <6200749+hholst80@users.noreply.github.com> Date: Sat, 8 Jul 2023 16:04:16 +0000 Subject: [PATCH 3/3] Add vifm-v0.13-musl-tests.patch Co-authored-by: xaizek --- .../vifm/patches/vifm-v0.13-musl-tests.patch | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 srcpkgs/vifm/patches/vifm-v0.13-musl-tests.patch diff --git a/srcpkgs/vifm/patches/vifm-v0.13-musl-tests.patch b/srcpkgs/vifm/patches/vifm-v0.13-musl-tests.patch new file mode 100644 index 000000000000..d464cdb51d37 --- /dev/null +++ b/srcpkgs/vifm/patches/vifm-v0.13-musl-tests.patch @@ -0,0 +1,132 @@ + src/filelist.c | 6 +++++- + src/opt_handlers.c | 6 +++++- + src/ui/fileview.c | 1 + + src/ui/ui.h | 3 +++ + tests/misc/sort.c | 13 ++++++++++--- + tests/test-support/test-utils.c | 5 +++++ + 6 files changed, 29 insertions(+), 5 deletions(-) + +diff --git a/src/filelist.c b/src/filelist.c +index 1e63c1120..e5fe0131e 100644 +--- a/src/filelist.c ++++ b/src/filelist.c +@@ -329,7 +329,11 @@ flist_free_view(view_t *view) + modview_info_free(view->vi); + view->vi = NULL; + +- regfree(&view->primary_group); ++ if(view->primary_group_set) ++ { ++ regfree(&view->primary_group); ++ view->primary_group_set = 0; ++ } + + marks_clear_view(view); + +diff --git a/src/opt_handlers.c b/src/opt_handlers.c +index f655da5da..69935d669 100644 +--- a/src/opt_handlers.c ++++ b/src/opt_handlers.c +@@ -3250,9 +3250,13 @@ set_sortgroups(view_t *view, char **opt, char value[]) + { + if(scope == OPT_LOCAL) + { +- regfree(&view->primary_group); ++ if(view->primary_group_set) ++ { ++ regfree(&view->primary_group); ++ } + (void)regexp_compile(&view->primary_group, first, + REG_EXTENDED | REG_ICASE); ++ view->primary_group_set = 1; + } + free(first); + } +diff --git a/src/ui/fileview.c b/src/ui/fileview.c +index 7a4b9f189..4539e0530 100644 +--- a/src/ui/fileview.c ++++ b/src/ui/fileview.c +@@ -215,6 +215,7 @@ fview_init(view_t *view) + view->sort_groups_g = strdup(""); + (void)regexp_compile(&view->primary_group, view->sort_groups, + REG_EXTENDED | REG_ICASE); ++ view->primary_group_set = 1; + + view->preview_prg = strdup(""); + view->preview_prg_g = strdup(""); +diff --git a/src/ui/ui.h b/src/ui/ui.h +index 91c90eb49..69654d4c6 100644 +--- a/src/ui/ui.h ++++ b/src/ui/ui.h +@@ -448,6 +448,9 @@ struct view_t + char *sort_groups, *sort_groups_g; + /* Primary group of sort_groups (not sort_groups_g) in compiled form. */ + regex_t primary_group; ++ /* Indicates that primary_group was initialized, which is used to avoid ++ * freeing uninitialized data or freeing it twice. */ ++ int primary_group_set; + + int history_num; /* Number of used history elements. */ + int history_pos; /* Current position in history. */ +diff --git a/tests/misc/sort.c b/tests/misc/sort.c +index bad2120ee..4b9ce6a3b 100644 +--- a/tests/misc/sort.c ++++ b/tests/misc/sort.c +@@ -424,8 +424,13 @@ TEST(groups_sorting_works) + lwin.dir_entry[6].origin = lwin.curr_dir; + + update_string(&lwin.sort_groups, "-(done|todo).*"); ++ if(lwin.primary_group_set) ++ { ++ regfree(&lwin.primary_group); ++ } + (void)regcomp(&lwin.primary_group, "-(done|todo).*", + REG_EXTENDED | REG_ICASE); ++ lwin.primary_group_set = 1; + + /* Ascending sorting. */ + +@@ -458,15 +463,17 @@ TEST(groups_sorting_works) + assert_string_equal("11-todo-publish", lwin.dir_entry[4].name); + assert_string_equal("1-done", lwin.dir_entry[5].name); + assert_string_equal("3-done", lwin.dir_entry[6].name); +- +- regfree(&lwin.primary_group); +- update_string(&lwin.sort_groups, NULL); + } + + TEST(global_groups_sorts_entries_list) + { + update_string(&lwin.sort_groups_g, "([0-9])"); ++ if(lwin.primary_group_set) ++ { ++ regfree(&lwin.primary_group); ++ } + (void)regcomp(&lwin.primary_group, "([a-z])", REG_EXTENDED | REG_ICASE); ++ lwin.primary_group_set = 1; + + lwin.sort_g[0] = SK_BY_GROUPS; + lwin.sort_g[1] = SK_BY_NAME; +diff --git a/tests/test-support/test-utils.c b/tests/test-support/test-utils.c +index 6938d0538..bb449d441 100644 +--- a/tests/test-support/test-utils.c ++++ b/tests/test-support/test-utils.c +@@ -32,6 +32,7 @@ + #include "../../src/utils/macros.h" + #include "../../src/utils/matcher.h" + #include "../../src/utils/path.h" ++#include "../../src/utils/regexp.h" + #include "../../src/utils/str.h" + #include "../../src/utils/string_array.h" + #include "../../src/utils/utils.h" +@@ -253,6 +254,10 @@ view_setup(view_t *view) + memset(&view->sort[1], SK_NONE, sizeof(view->sort) - 1); + memcpy(view->sort_g, view->sort, sizeof(view->sort_g)); + ++ /* The code assumes that this field is initialized. */ ++ assert_success(regexp_compile(&view->primary_group, "", REG_ICASE)); ++ view->primary_group_set = 1; ++ + view->custom.entry_count = 0; + view->custom.entries = NULL; +