[File] [PATCH] Magdir/misctools libtool library file; mime type missing

Jörg Jenderek (GMX) joerg.jen.der.ek at gmx.net
Wed Aug 23 03:05:03 UTC 2023


Hello,

some days i inspect my discs with visual disk space tool gdmap.  So i
looked in some directories for non coloured areas.  Some samples use
filename extension la.


When i run file command version 5.45 on such samples with LA file name
suffix i get an output like:

XSParagraph.la:      libtool library file, ASCII text
art.la:              libtool library file, ASCII text
libQtDeclarative.la: libtool library file, ASCII text
libQtTest.la:        libtool library file, ASCII text
libarchive.la:       libtool library file, ASCII text
libxar.la:           libtool library file, ASCII text
yuv.la:              libtool library file, ASCII text


With --extension option only ??? is displayed for the samples.
Furthermore with option -i for inspected samples only generic
text/plain  is shown.

For comparison reason i also run the file format identification
utility DROID ( See https://sourceforge.net/projects/droid/). This
does not recognize the la examples.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies now
also all my LA examples as "libtool library control info" by
la-libtool.trid.xml with mime type application/x-shared-library-la.

This tool list the used file name extension and with -v option the
related URL pointing to used software. That informations are
expressed by comment lines inside Magdir/misctools like:
# URL:		https://www.gnu.org/software/libtool/manual/html_node/
#		Linking-libraries.html
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/l/la-libtool.trid.xml


All detected LA samples are described by Magdir/misctools with line like:
0 search/80 .la\ -\ a\ libtool\ library\ file	libtool library file

On Linux (mint and raspbian) the LA samples are described as "libtool
shared library" by shared mime data-base (see freedesktop.org.xml*).
Instead of generic mime type text/plain an own user defined one is used.
That is now expressed inside Magdir/misctools by line like:
!:mime	application/x-shared-library-la
And the file name suffix is now shown by line like:
!:ext	la

There exist no exact file format specification but at least there exist
a manual for libtool and there exist a chapter about linking libraries.
So i use that page as reference. Apparently all libtool samples start
with a comment line that looks like:
	# libxar.la - a libtool library file
But i do not know if this is always true. So for control reason i show
first line which seems to contain specific base name before la name
suffix. So this is done by line like:
 >0	string		x	\b, 1st line "%s"
After applying the above mentioned modifications by patch
file-5.45-misctools-la.diff then all my inspected examples are now
described with more details. This now looks like:

XSParagraph.la:      libtool library file, 1st line
		     "# XSParagraph.la - a libtool library file"
		     , ASCII text
art.la:              libtool library file, 1st line
		     "# art.la - a libtool library file"
		     , ASCII text
libQtDeclarative.la: libtool library file, 1st line
		     "# libQtDeclarative.la - a libtool library file"
		     , ASCII text
libQtTest.la:        libtool library file, 1st line
		     "# libQtTest.la - a libtool library file"
		     , ASCII text
libarchive.la:       libtool library file, 1st line
		     "# libarchive.la - a libtool library file"
		     , ASCII text
libxar.la:           libtool library file, 1st line
		     "# libxar.la - a libtool library file"
		     , ASCII text
yuv.la:              libtool library file, 1st line
		     "# yuv.la - a libtool library file"
		     , ASCII text

I hope my diff file can be applied in future version of file
utility.

Unfortunately the LA suffix is also used for other file
formats like in EDLIN.LA.

With best wishes,
Jörg Jenderek
--
Jörg Jenderek
-------------- next part --------------
-- 
File mailing list
File at astron.com
https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
--- file-5.45/magic/Magdir/misctools.old	2023-02-09 18:43:53.000000000 +0100
+++ file-5.45/magic/Magdir/misctools	2023-08-23 04:57:25.677390700 +0200
@@ -94,9 +94,19 @@
 >>11	beshort		!0x0D0A			\b, lines not separated by CRLF
 
 # Summary: Libtool library file
-# Extension: .la
 # Submitted by: Tomasz Trojanowski <tomek at uninet.com.pl>
+# Update:	Joerg Jenderek
+# URL:		https://www.gnu.org/software/libtool/manual/html_node/Linking-libraries.html
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/l/la-libtool.trid.xml
+# Note:		called "libtool library control info" by TrID and
+#		"Libtool Shared Library" by shared MIME-info database
 0	search/80	.la\ -\ a\ libtool\ library\ file	libtool library file
+# https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/data/freedesktop.org.xml.in
+#!:mime	text/plain
+!:mime	application/x-shared-library-la
+!:ext	la
+# like "# libxar.la - a libtool library file"
+>0	string		x	\b, 1st line "%s"
 
 # Summary: Libtool object file
 # Extension: .lo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.45-misctools-la.diff.sig
Type: application/octet-stream
Size: 780 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230823/35795830/attachment.obj>


More information about the File mailing list