You are not logged in.

#1 2020-06-19 12:07:51

flying sheep
Member
Registered: 2012-02-29
Posts: 86

MIME types for .pkg.tar.*z?

Arch packages don’t have a distinctive MIME type on my system which would be necessary to register a default application to them (e.g. something like the GDebi installer is for .deb packages).

Why not? And what would an acceptable family of MIME types be? something like this?

application/x-arch-package+gzip, ...+x-xz, ...

Offline

#2 2020-06-19 13:22:01

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,204

Re: MIME types for .pkg.tar.*z?

Keep in mind that packages from official repos now use zst compression and are named as *.pkg.tar.zst files , pkg.tar.*z won't cover them.

MIME types seem to be used almost exclusively by graphical programs .
pacman is a pure CLI application, what would be gained by having a mime type for packages ?

Last edited by Lone_Wolf (2020-06-19 13:22:34)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2020-06-19 15:44:31

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 3,895

Re: MIME types for .pkg.tar.*z?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2020-06-19 19:10:36

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,439

Re: MIME types for .pkg.tar.*z?

https://specifications.freedesktop.org/ … ubclassing

I encourage you to create a mimeinfo subclass for compressed tarballs (every compression format recognized by libarchive is eligible) that matches on any tarball filename stem which ends in '.pkg'. This mimeinfo subclass would then be recognized as e.g. application/x-pacman-pkg+tar, and I guess a GUI for libalpm would be able to associate itself as a file opener for it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2020-06-21 13:37:35

flying sheep
Member
Registered: 2012-02-29
Posts: 86

Re: MIME types for .pkg.tar.*z?

Thank you for that reference! Hmm, there’s something inelegant about that subclassing system because new media types have to be created for combinations instead of having a way to chain them.

Therefore mimetypes like x-xz-compressed-tar exist and I’d need to create another subclass for each of those (as well as for plain application/x-tar):

$ grep compressed-tar /usr/share/mime/subclasses
application/x-compressed-tar application/gzip
application/x-lrzip-compressed-tar application/x-lrzip
application/x-lzma-compressed-tar application/x-lzma
application/x-webarchive application/x-compressed-tar
application/x-lzip-compressed-tar application/x-lzip
application/x-bzip-compressed-tar application/x-bzip
application/x-xz-compressed-tar application/x-xz
application/x-zstd-compressed-tar application/zstd
application/x-lz4-compressed-tar application/x-lz4

Right? Where can I look up which compressions are supported? Does libalpm e.g. also support .pkg.zip?

Last edited by flying sheep (2020-06-21 13:38:42)

Offline

#6 2020-06-22 10:36:31

Allan
Member
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,939
Website

Re: MIME types for .pkg.tar.*z?

flying sheep wrote:

Where can I look up which compressions are supported? Does libalpm e.g. also support .pkg.zip?

Anything supported by libarchive is supported by libalpm.  So technically .pkg.zip files should work.

Offline

#7 2020-06-22 12:27:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 23,727
Website

Re: MIME types for .pkg.tar.*z?

flying sheep wrote:

I’d need to create another subclass for each of those (as well as for plain application/x-tar):

Why?  The repos only use zst compression.  xz was formerly used, but no longer.  The only way anything else would be used is for locally built packages and then only if you've explicitly specified a different compression algorithm in your makepkg.conf.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2020-06-22 14:19:41

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,439

Re: MIME types for .pkg.tar.*z?

Trilby wrote:
flying sheep wrote:

I’d need to create another subclass for each of those (as well as for plain application/x-tar):

Why?  The repos only use zst compression.  xz was formerly used, but no longer.  The only way anything else would be used is for locally built packages and then only if you've explicitly specified a different compression algorithm in your makepkg.conf.

Sounds like you've answered your own question. tongue

But also please note that the default compression for makepkg.conf and thus makepkg is still xz, not zst. zst is only the default in chroot builds, i.e. extra-x86_64-build or makechrootpkg.

There are also other tools like https://github.com/jordansissel/fpm/ which only support some cherry-picked list of compression types and haven't updated their pacman package generator in 4 years. Though I think based on what I've seen people attaching to github releases, this produces files named .pacman or something.

cmake also had a merge request to add pacman package generation, though it died once I submitted review comments, lol: https://gitlab.kitware.com/cmake/cmake/ … uests/4185
(But looking at it again, it defaulted to zstd.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB