From b56e23a7d3448ef2a67d456ed7afb1e019796454 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@linaro.org>
Date: Mon, 6 Jan 2025 15:08:15 +0000
Subject: [PATCH] mc.ext.ini: support OpenEmbedded ipk archives
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Two types of ipk archives appear to exist:
* OpenWRT
* Openembedded / Yocto
The former is a (gzip-compressed) tar archive, which appears to be
modelled after the Debian package format (but not matching it
exactly!), containing the three files debian-binary, data.tar, and
control.tar (the latter two may be compressed).
The latter is a proper Debian archive, which means it's an ar archive,
with the files debian-binary, control.tar, and data.tar in exactly this
order. control and data may also be compressed.
While modelled after the Debian package format [1], OpenWRT ipk
archives don't strictly adhere to it: Debian packages should be ar
archives (not tar) and the order of files inside the archive matters
(OpenWRT doesn't follow this).
Midnight Commander is currently unable to display the Openembedded ipk
archives as both use the .ipk suffix, and because one is a tar- and one
is an ar archive, and because the ipk suffix is hooked up to
Include=tar.gz, which (obviously) doesn't support ar archives.
Update mc.ext.ini to also handle OpenEmbedded ipk packages by also
inspecting the type, in addition to the suffix. Note that we can not
unconditionally use the deb rule for both types because the OpenWRT
package don't strictly conform to the Debian package format and
dpkg-deb and friends complain.
Link: https://manpages.debian.org/bookworm/dpkg-dev/deb.5.en.html [1]
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
misc/mc.ext.ini.in | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/misc/mc.ext.ini.in b/misc/mc.ext.ini.in
index 5c69d81a6ac8..df2fde202bfc 100644
a
|
b
|
View=%cd %p/patchsetfs:// |
207 | 207 | Regex=\\.t([gp]?z|ar\\.g?[zZ])$ |
208 | 208 | Include=tar.gz |
209 | 209 | |
210 | | [ipk] |
211 | | Shell=.ipk |
212 | | Include=tar.gz |
213 | | |
214 | 210 | [gem] |
215 | 211 | Shell=.gem |
216 | 212 | Include=tar.gz |
… |
… |
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view wim |
928 | 924 | Type=^ASCII mail text |
929 | 925 | Open=%cd %p/mailfs:// |
930 | 926 | |
| 927 | [ipk-deb] |
| 928 | Shell=.ipk |
| 929 | Type=^Debian binary package |
| 930 | Open=%cd %p/deb:// |
| 931 | View=%view{ascii} @EXTHELPERSDIR@/package.sh view deb |
| 932 | |
| 933 | [ipk-targz] |
| 934 | Shell=.ipk |
| 935 | Type=\(gzip compressed |
| 936 | Include=tar.gz |
| 937 | |
931 | 938 | |
932 | 939 | ### Sources ### |
933 | 940 | |