file-roller: fix for inconsistencies between p7zip and 7zip

This commit is contained in:
oreo639 2023-12-29 07:23:29 -08:00 committed by classabbyamp
parent a67fea33a9
commit 8f5c4b0e82
2 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,24 @@
Based on: https://gitlab.gnome.org/GNOME/file-roller/-/issues/148#note_1382009
file-roller assumes p7zip and assumes that 'follow_links' is disabled by default.
This is true in p7zip but not 7zip. 7zip does not have a -l flag, and instead provides,
the -snl and -snh flags for disabling 'follow_links'.
This fixes compressing 7z files with 'follow_links' enabled and compressing files with
broken symlinks with 'follow_links' disabled.
--- a/src/fr-command-7z.c.orig
+++ b/src/fr-command-7z.c
@@ -325,8 +325,11 @@ fr_command_7z_add (FrCommand *command,
fr_process_add_arg (command->process, "-bd");
fr_process_add_arg (command->process, "-bb1");
fr_process_add_arg (command->process, "-y");
- if (follow_links)
- fr_process_add_arg (command->process, "-l");
+ if (! follow_links)
+ {
+ fr_process_add_arg (command->process, "-snh");
+ fr_process_add_arg (command->process, "-snl");
+ }
add_password_arg (command, archive->password, FALSE);
if ((archive->password != NULL)
&& (*archive->password != 0)

View file

@ -1,7 +1,7 @@
# Template file for 'file-roller'
pkgname=file-roller
version=43.0
revision=1
revision=2
build_style=meson
hostmakedepends="gettext glib-devel itstool pkg-config desktop-file-utils
gtk-update-icon-cache"