AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.66k stars 554 forks source link

Submit AppImage to file/libmagic #727

Open TheAssassin opened 6 years ago

TheAssassin commented 6 years ago

Every developer and/or Linux user knows the command file, which can be used to display file types of arbitrary files.

At the moment, AppImages are recognized as ELF executables:

...AppImage: ELF 64-bit LSB executable, x86-64, version 1, dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

I experimented a bit, and with the following definition (incomplete type 1), I can get a result like:

# contents of file "appimage"
8   string  AI\01   AppImage (type 1)
8   string  AI\02   AppImage (type 2)
# compile definition file "appimage" to "appimage.mgc"
> file -C -m appimage
# now use it for type 1 AppImage
> file -z -m appimage.mgc ...AppImage
...AppImage: AppImage (type 1), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=[...], stripped
# type 2 AppImage
> file -z -m appimage.mgc ...AppImage
...AppImage: AppImage (type 2), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped

Many tools use libmagic instead of the shared MIME database (/usr/share/mime, package shared-mime-info), and therefore don't recognize AppImages. We should submit the AppImage specification as a definition to the maintainers of file/libmagic.

See http://openpreservation.org/blog/2012/08/09/magic-editing-and-creation-primer/ on how to submit definitions.

Information missing in the example definition:

probonopd commented 6 years ago

Information missing in the example definition

Do we need to clarify those before we can submit this to libmagic?

TheAssassin commented 6 years ago

I would rather send in a complete definition instead of a half finished one. If it's only half finished, potential AppImages won't be recognized.

Regarding the MIME types, libmagic users seem to be more interested in getting MIME types, as they're more "machine readable" than the textual descriptions. It shouldn't be a problem to add the "official" MIME types to the corresponding definitions.

probonopd commented 6 years ago

Do I need to do something?

TheAssassin commented 6 years ago

@probonopd we just need a volunteer who's willing to do the work. Doesn't matter who's going to do it.