Ticket #4298 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Fix mcview for diff files on systems that have no /bin/cat (like NixOS).

Reported by: skvadrik Owned by: andrew_b
Priority: major Milestone: 4.8.28
Component: mc-core Version: master
Keywords: Cc: slyfox
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description (last modified by slyfox) (diff)


When opening .diff or .patch files mcview invokes /bin/cat. NixOS has no /bin/cat (the path to cat looks like /run/current-system/sw/bin/cat). However cat is still in PATH, so replace /bin/cat with just cat. This should not affect other systems as /bin should normally be in PATH.

Steps to reproduce:

  1. Create file 1.diff: echo aaa > 1.diff
  2. Try to open it with mcview: mcview 1.diff

Expected result: file is opened for viewing.
Actual result: nothing happens, the command returns error code 1.

System information:

$ uname -a
Linux skvadr 5.14.14 #1-NixOS SMP PREEMPT Wed Oct 20 09:57:59 UTC 2021 x86_64 GNU/Linux

mc information:

GNU Midnight Commander 4.8.27
Built with GLib 2.70.0
Built with S-Lang 2.3.2 with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
Home directory: /home/skvadrik
Profile root directory: /home/skvadrik

[System data]
    Config directory: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/etc/mc/
    Data directory:   /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/share/mc/
    File extension handlers: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/ext.d/
    VFS plugins and scripts: /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/
	extfs.d:        /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/extfs.d/
	fish:           /nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27/libexec/mc/fish/

[User data]
    Config directory: /home/skvadrik/.config/mc/
    Data directory:   /home/skvadrik/.local/share/mc/
	skins:          /home/skvadrik/.local/share/mc/skins/
	extfs.d:        /home/skvadrik/.local/share/mc/extfs.d/
	fish:           /home/skvadrik/.local/share/mc/fish/
	mcedit macros:  /home/skvadrik/.local/share/mc/mc.macros
	mcedit external macros: /home/skvadrik/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/skvadrik/.cache/mc/
$ mc --configure-options
 '--disable-static' '--disable-dependency-tracking' '--prefix=/nix/store/5i0m5h6s3rlh05nfk03f0p0mvzaq5399-mc-4.8.27' '--enable-vfs-smb' 'CC=gcc' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'


0001-Fix-mcview-for-diff-files-on-systems-that-have-no-bi.patch (1.0 KB) - added by skvadrik 3 years ago.

Change History

comment:1 Changed 3 years ago by slyfox

  • Cc slyfox added
  • Description modified (diff)

comment:2 Changed 3 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Component changed from mcview to mc-core
  • Milestone changed from Future Releases to 4.8.28

comment:3 Changed 3 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset set to committed-master
  • Resolution set to fixed
  • Branch state changed from no branch to merged

comment:4 Changed 3 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.