[File] [PATCH] of Magdir/archive for Debian binary package; GNU variant *.ipk

Christos Zoulas christos at zoulas.com
Sat Feb 15 19:14:55 UTC 2020


Committed, thanks!

christos

> On Feb 14, 2020, at 6:00 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> some days ago i updated package on my enigma tv receiver. The
> update packages used by opkp manager have the file name extension ipk.
> According to Wikipedia the Debian package format is used for such
> updates. When running file command version 5.38 on such examples
> and other Debian packages i get an output like:
> 
> libc6-dev_2.28-2_mips.deb:
> 	Debian binary package (format 2.0), with control.tar.xz,
> 	data compression xz
> openjdk-6-source_6b11-9.1_all.deb:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression bz2
> opkg_0.2.4-r0-vuplus0-vti005_armv7ahf-vfp-neon.ipk:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression gz/
> opkg-arch-config_1.0-r1-vti04_vuultimo4k.ipk:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression gz/
> xfslibs-test-lzma.deb:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 
> Instead "gz" after data compression for some examples "gz/" is shown.
> This is not a big error, but this cosmetic error may irritate users.
> Furthermore with --extension option only deb/udeb is displayed.
> 
> So i change/add lines in Magdir/archive. So old line for showing file
> name extensions get additional "ipk" word and now becomes
> !:ext	deb/udeb/ipk
> 
> In current version look for third archive name by line like
>>> 0	search/0x93e4f	data.tar.	\b, data compression
> For Debian package third archive member has file name data.tar.gz,
> data.tar.xz, data.tar.bz2 or data.tar.lzma. So last part of file name
> indicated used data compression. This was shown by line
>>>> &0	string		x		%.4s
> For BSD variant of ar archives stored filenames are right-padded
> with ASCII spaces (0x20). So some additional spaces at the end
> after gz do not hurt by above magic line.
> Unfortunately also System V (or GNU) variant of ar archive is
> sometimes used like in inspected ipk archives. There slash
> character ('/' 0x2F) is used to mark the end of the filename. So by
> above line phrase "gz/ " is displayed.
> Of course a regular expression could be used to catch last name
> extension.
> But i decided to use another method. So i display the 2 beginning
> characters of name extension by line
>>>> &0	string		x		%.2s
> Then check if next character is not a terminating space or slash.
> If this is true, then display this character. This now looks:
>>>> &2		ubyte	!0x20
>>>>> &-1	ubyte	!0x2f
>>>>>> &-1	ubyte	x		\b%c
> Then do the same procedure for possible fourth character by lines
>>>>>>> &0	ubyte	!0x20
>>>>>>>> &-1	ubyte	!0x2f
>>>>>>>>> &-1	ubyte	x		\b%c
> 
> After applying the above mentioned modifications by patch
> file-5.38-archive-ipk.diff then i get an output like:
> 
> libc6-dev_2.28-2_mips.deb:
> 	Debian binary package (format 2.0), with control.tar.xz,
> 	data compression xz
> openjdk-6-source_6b11-9.1_all.deb:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression bz2
> opkg_0.2.4-r0-vuplus0-vti005_armv7ahf-vfp-neon.ipk:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression gz
> opkg-arch-config_1.0-r1-vti04_vuultimo4k.ipk:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression gz
> xfslibs-test-lzma.deb:
> 	Debian binary package (format 2.0), with control.tar.gz,
> 	data compression lzma
> 
> I hope my diff file can be applied in future version of
> file utility.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> 
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXkcmYQAKCRCv8rHJQhrU
> 1qsbAJsFIBG44s5YpBMG1ejV/wkL0hYJqwCgr5eCifxKqjWUSH90vvYN/0UEUkg=
> =S2Kf
> -----END PGP SIGNATURE-----
> <file-5_38-archive-ipk_diff.DEFANGED-197589><file-5_38-archive-ipk_diff_sig.DEFANGED-197590>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20200215/89951c35/attachment.asc>


More information about the File mailing list