Ticket #4571 (new enhancement)

Opened 4 weeks ago

Last modified 2 weeks ago

Modernize user menu

Reported by: eugenesan Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

I've been working on modernizing the default user menu and decided to share it here.

First patch changes the default spacing in menu items.
The second patch:

  1. Removes archaic news and latex related items
  2. Reworks tarball options to support bare tarball, improve compressed tarballs
  3. Add support for regular archives (supported by 7z, which is most of them)
  4. Add support for compressing/un-compressing of more variants
  5. Add compression conversion
  6. Add hashing, git, vidir, ncdu, tail and mcdiff options

Feel free to adjust if I removed something people actually.

P.S.
From my previous experience using this ticket tracker, I never get notifications.
Do I need to do anything special to enable mail notifications for tickets?

P.P.S.
I chose mc-skin as a component. Wasn't sure where user menu fits.

Attachments

0001-menu-Reduce-menu-ittems-width-to-allow-longer-text.patch (9.5 KB) - added by eugenesan 4 weeks ago.
0001-menu-drop-archaic-and-add-modern-archival-options.patch (19.4 KB) - added by eugenesan 4 weeks ago.
0001-menu-drop-archaic-items-modernize-archival-options-v2.patch (20.0 KB) - added by eugenesan 4 weeks ago.
0001-menu-drop-archaic-items-modernize-archival-options-v4.patch (23.3 KB) - added by eugenesan 3 weeks ago.
0001-menu-drop-archaic-items-modernize-archival-options-v5.patch (28.1 KB) - added by eugenesan 3 weeks ago.
New version of the patch with 7z binary detection and various fixes
0001-menu-drop-archaic-items-modernize-archival-options-v6.patch (36.5 KB) - added by eugenesan 3 weeks ago.
Updated version of the main patch with more compression options, fixes, improvments and shortcuts reorganization
0001-menu-optional-gui-tools.patch (1.6 KB) - added by eugenesan 3 weeks ago.
Optional patch to add various GUI tools

Change History

comment:1 Changed 4 weeks ago by andrew_b

  • Component changed from mc-skin to mc-core

comment:2 Changed 4 weeks ago by andrew_b

Related to #3442.

comment:3 follow-up: ↓ 5 Changed 4 weeks ago by zaytsev

From my previous experience using this ticket tracker, I never get notifications.

I have fixed them in #4557 - are you still not getting anything?

comment:4 follow-up: ↓ 6 Changed 4 weeks ago by zaytsev

Few comments:

Compress the current subdirectory (tar.xz using 7z)

Why do you want to offer this alternative? (honest question)

sha512sum

At least on Mac this doesn't exist, can you use a fallback to shasum -a512 ?

comment:5 in reply to: ↑ 3 Changed 4 weeks ago by eugenesan

Replying to zaytsev:

From my previous experience using this ticket tracker, I never get notifications.

I have fixed them in #4557 - are you still not getting anything?

It's working now. Thank you for fixing it!

comment:6 in reply to: ↑ 4 ; follow-up: ↓ 9 Changed 4 weeks ago by eugenesan

Replying to zaytsev:

Few comments:

Compress the current subdirectory (tar.xz using 7z)

Why do you want to offer this alternative? (honest question)

Some systems still use older XZ that is not multi-threaded. But even on systems with newer XZ, 7z is sill faster (especially if you use the "ASMC" compiled version). Also, in my local menu I add "-slp -m0=lzma2 -mx=9 -mfb=256 -md=256m -mlc=4 -ms=on" and get better compression but it was too much for default config ;-)

sha512sum

At least on Mac this doesn't exist, can you use a fallback to shasum -a512 ?

It should be trivial, assuming MacOS has the "which" command.
Is sha256sum also missing?

Last edited 4 weeks ago by eugenesan (previous) (diff)

comment:7 Changed 4 weeks ago by eugenesan

Everyone,
If you look closely you will see that I switched to using "7z" instead of '7za', '7zz' etc.
The main reason is that Debian/Ubuntu? already switched from p7zip to 7zip and provide cli only using wrappers (7z, 7za, 7zr, p7zip), actual binaries are not even in the path.

Since I can't check all other Distros and OS's, could you please report which variants of '7z' are available on you system.

Thanks.

comment:8 Changed 4 weeks ago by zaytsev

It should be trivial, assuming MacOS has the "which" command. Is sha256sum also missing?

zaytsev@Yurys-MBP % which sha256sum
sha256sum not found

Since I can't check all other Distros and OS's, could you please report which variants of '7z' are available on you system.

On macOS only 7zz is provided via the sevenzip homebrew package:

https://formulae.brew.sh/formula/sevenzip

On BSD I think 7z is provided via the p7zip port.

On Red Hat you have 7za via p7zip package.

You can check other distros yourself using the service from our friend Mykola:

https://pkgs.org/search/?q=7zip

comment:9 in reply to: ↑ 6 Changed 4 weeks ago by eugenesan

Attaching an updated version of the 2nd patch which minor fix and shasum hashing as a default, since it is a part of Perl and should be available by default on more systems(shaXXXsum is the fallback).

Will start working on 7z support on "all" systems.

Last edited 4 weeks ago by eugenesan (previous) (diff)

comment:10 Changed 4 weeks ago by eugenesan

I just reviewed all 7zip related code and '7za' is used in most places with fallback to 7z in some places and 7z/7zz/7zr in other.

This is what 7zip doc say:

Alone         7za.exe: Standalone version of 7-Zip console that supports only 7z/xz/cab/zip/gzip/bzip2/tar.
Alone2        7zz.exe: Standalone version of 7-Zip console that supports all formats.
Alone7z       7zr.exe: Standalone version of 7-Zip console that supports only 7z (reduced version)

Should we unify that with something like:

P7ZIP=`which 7zz 2>/dev/null` || P7ZIP=`which 7z 2>/dev/null` || P7ZIP=`which 7za 2>/dev/null`

Here is my reasoning:
'7zz' should be the first option since it is an ASM optimized pre-built binary with complete format support
'7z' Non-ASM built equivalent of 7zz and is the default on most modern Linux systems
'7za' if available, is the binary that should support all uses on older and systems with p7zip systems
I think we can drop '7zr' since it is only suitable for .7z archives and I believe no distro/os shipping it alone.

P.S.
I am suprised Fedora and Arch do not ship 7zip package...

Last edited 4 weeks ago by eugenesan (previous) (diff)

comment:11 Changed 3 weeks ago by eugenesan

I am attaching a new version of the main (second) patch.
It still uses the default '7z' (until we decide which variant to use).
I also added an option to use ENV variable for compression options.
Those are the values I set in my .profile if anyone is interested:

export COMPRESS_OPTS_7Z="-slp -myx=9 -mx=9 -mfb=256 -md=256m -mlc=4"
export COMPRESS_OPTS_ZSTD="--long --ultra -22"

P.S.
I am having difficulties understanding what "+' and '=' conditions are supposed to do.
By reading documentation, it looks like '+' is only for "showing" menu items and '=' enables/disables the item. But, it doesn't work as I understand it.
It would be nice if anyone could explain how those should be used.

Changed 3 weeks ago by eugenesan

New version of the patch with 7z binary detection and various fixes

Changed 3 weeks ago by eugenesan

Updated version of the main patch with more compression options, fixes, improvments and shortcuts reorganization

Changed 3 weeks ago by eugenesan

Optional patch to add various GUI tools

comment:12 Changed 2 weeks ago by andrew_b

Related to #3290.

Note: See TracTickets for help on using tickets.