Ticket #2997 (new enhancement)

Opened 12 years ago

Last modified 10 years ago

mc does not support autodetection for extfs - problem with different formats of .ipk files (now with patch)

Reported by: cracket Owned by:
Priority: major Milestone: Future Releases
Component: mc-vfs Version: 4.7.0
Keywords: ipk ar tar vfs Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

There is a problem with .ipk files support in mc, mainly because one extension .ipk can have two different formats. First format is tar.gz archive which is currently supported by mc. However second format is based on ar, and archives in this format are provided by some openembedded distributions. Unfortunatelly ar does not support tar archives and vice versa.

To support both formats with same extension mc should have sort of "autodetection" or fallback if first extension returned with error code, because currently trying to browse or "enter" ipk archive triggers error:

tar: To nie wygląda jak archiwum tar
tar: Przeskoczenie do następnego nagłówka
tar: Zakończenie w stanie błędu z powodu uprzednich błędów

or without my polish locale:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Short workaround for supporting ar ipk files is to put in mc.ext section:

regex/\.ipk$
        Open=%cd %p#uar
        View=%view{ascii} ar t %f

and remove ipk from other sections

I attach "ar" ipk example file, the examples of "tar" ipk files are attached here: http://www.midnight-commander.org/ticket/2925

Attachments

kernel-module-gspca-sunplus_3.1.1-r7_vusolo.ipk (8.6 KB) - added by cracket 12 years ago.
ar format of ipk installation package
2997_ipk_extfs_improvements.diff (6.6 KB) - added by chown 10 years ago.
Patch with more complete fix for #2997

Change History

Changed 12 years ago by cracket

ar format of ipk installation package

comment:1 Changed 10 years ago by chown

Attaching a patch for a more complete fix, adding handler for both types of ipk. If the ipk is a gzip file we handle as tar.gz, otherwise we handle as deb file. Tested with open and view operations. One side effect is that corrupt tar.gz format ipk files will give a deb file error.

Patch file: 2997_ipk_extfs_improvements.diff
Files changed:

misc/ext.d/package.sh
misc/mc.ext.in

Files added:

src/vfs/extfs/helpers/ipk

Please be aware if you want to test this that you need to remove your ~/.config/mc/mc.ext file to get the top level changes.

Changed 10 years ago by chown

Patch with more complete fix for #2997

comment:2 Changed 10 years ago by chown

  • Summary changed from mc does not support autodetection for extfs - problem with different formats of .ipk files to mc does not support autodetection for extfs - problem with different formats of .ipk files (now with patch)
Note: See TracTickets for help on using tickets.