Accepting request 985468 from Base:System

- Include review comments: don't depend on fish.

- Add 4258-fish-subshell-prompt.patch fixing
  https://midnight-commander.org/ticket/4258 stopping fish from sending
  \r while printing prompt and mc erases prompt buffer.
- Add mc.fish, which the fish equivalent of /usr/share/mc/mc-wrapper.sh

OBS-URL: https://build.opensuse.org/request/show/985468
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mc?expand=0&rev=85
This commit is contained in:
Dominique Leuenberger 2022-06-29 14:00:28 +00:00 committed by Git OBS Bridge
commit b1429de2c9
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,15 @@
---
src/subshell/common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/src/subshell/common.c
+++ b/src/subshell/common.c
@@ -713,7 +713,7 @@ parse_subshell_prompt_string (const char
/* Extract the prompt from the shell output */
for (i = 0; i < bytes; i++)
- if (buffer[i] == '\n' || buffer[i] == '\r')
+ if (buffer[i] == '\n')
g_string_set_size (subshell_prompt_temp_buffer, 0);
else if (buffer[i] != '\0')
g_string_append_c (subshell_prompt_temp_buffer, buffer[i]);

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Jun 27 19:36:16 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Include review comments: don't depend on fish.
-------------------------------------------------------------------
Wed Jun 15 15:05:02 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add 4258-fish-subshell-prompt.patch fixing
https://midnight-commander.org/ticket/4258 stopping fish from sending
\r while printing prompt and mc erases prompt buffer.
- Add mc.fish, which the fish equivalent of /usr/share/mc/mc-wrapper.sh
-------------------------------------------------------------------
Sun Mar 27 19:39:05 UTC 2022 - Andreas Stieger <andreas.stieger@gmx.de>

25
mc.fish Normal file
View File

@ -0,0 +1,25 @@
function mc --description='Midnight Commander'
set -q TMPDIR || set -gx TMPDIR /tmp
set -gx _fish_MC_PWD_FILE $TMPDIR/mc-(id -un)/mc.pwd.$fish_pid
command mc -P "$_fish_MC_PWD_FILE" $argv
if test -r $_fish_MC_PWD_FILE
set -gx _fish_MC_PWD (cat $_fish_MC_PWD_FILE)
if test -n $_fish_MC_PWD && test $_fish_MC_PWD != $PWD && test -d $_fish_MC_PWD
cd $_fish_MC_PWD
end
set -e _fish_MC_PWD
end
set -e _fish_MC_PWD_FILE
set -e _fish_MC_USER
function _remove_tmp --on-job-exit caller --inherit-variable _fish_MC_PWD_FILE
command rm $_fish_MC_PWD_FILE
set -f dirn (dirname $_fish_MC_PWD_FILE)
if test -d "$dirn"
rm -f $dirn
end
functions -e _remove_tmp
end
end

15
mc.spec
View File

@ -29,6 +29,7 @@ Source2: %{name}.desktop
Source3: %{name}.png
Source4: cmake.syntax
Source6: http://ftp.midnight-commander.org/%{name}-%{version}.sha256
Source7: mc.fish
Patch0: mc-fix_lib_search_path.patch
Patch12: mc-wrapper.patch
Patch16: mc-esc-seq.patch
@ -44,6 +45,9 @@ Patch23: mc-extfs-iso9660-xorriso.patch
Patch32: 20_wrong_path_to_wrappers.patch
# PATCH-FIX-UPSTREAM mc-multi-press-f-keys.patch mc287 sbrabec@suse.cz - Fixed Esc + Numeral F-key emulation.
Patch41: mc-multi-press-f-keys.patch
# PATCH-FIX-UPSTREAM 4258-fish-subshell-prompt.patch https://midnight-commander.org/ticket/4258 mcepl@suse.com
# don't send \r while printing prompt
Patch42: 4258-fish-subshell-prompt.patch
# Patches from Fedora
#Patch adding -fpie and -pie to compilation and linking of setuid binaries
Patch52: mc-pie.patch
@ -69,6 +73,7 @@ BuildRequires: xorg-x11-devel
BuildRequires: xz
Requires(pre): permissions
Recommends: %{name}-lang = %{version}
Enhances: fish
Recommends: mkisofs
Recommends: xorriso
@ -105,10 +110,12 @@ echo "`grep %{name}-%{version}.tar.xz %{SOURCE6} | head -n1 | cut -c1-64` %{SOU
%patch23
%patch32
%patch41 -p1
%patch42 -p1
%patch52 -p1
%patch100 -p1
%build
%{?!make_build:%define make_build make -O %_smp_mflags V=1 VERBOSE=1}
autoreconf -fvi
%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter
export CFLAGS="%{optflags} %{warn_flags}"
@ -140,6 +147,10 @@ install -m 755 %{SOURCE1} %{buildroot}%{_datadir}/mc/
install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
# Fish wrapper script
install -D -m 644 %{SOURCE7} \
%{buildroot}%{_datadir}/fish/vendor_functions.d/mc.fish
for f in ext.d/misc.sh ext.d/sound.sh ext.d/video.sh \
extfs.d/gitfs+ extfs.d/uace extfs.d/uarc ;
do
@ -193,6 +204,10 @@ rm -rf %{buildroot}%{_datadir}/locale/be@tarask
%exclude %{_datadir}/mc/help/mc.hlp.*
%exclude %{_datadir}/locale/*/LC_MESSAGES/mc.mo
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_functions.d
%{_datadir}/fish/vendor_functions.d/mc.fish
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%dir %{_datadir}/icons/hicolor