Historical bug tracker for the Pacman package manager.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
FS#10438 - Freedesktop Mime Type for PKGBUILD and Arch packages
Attached to Project:
Pacman
Opened by Riri (chicha) - Saturday, 17 May 2008, 13:26 GMT
Last edited by Allan McRae (Allan) - Friday, 12 February 2016, 13:17 GMT
Opened by Riri (chicha) - Saturday, 17 May 2008, 13:26 GMT
Last edited by Allan McRae (Allan) - Friday, 12 February 2016, 13:17 GMT
|
DetailsHello,
Freedesktop MIME specifications are now stable and widly used across many (all ?) desktops such KDE, Gnome, XFCE and others ... I think it would be great if PKGBUILD files and {i686,x86_64}.pkg.tar.gz Arch packages had their own MIME type like RPM spec, RPM, DEB, changelog, COPYING, etc files. In addition to being Freedesktop compliant this will help applications such text editors (gedit, kate ...), compression tools and file browsers be aware of Arch file types and behave as a consequence (syntax highlight, cute arch icons are two examples). - The first solution is to ship a mime spec for PKGBUILD files with pacman. I do not think you would like it as long as it will make pacman depends on shared-mime-info . - The second solution is to open a request to Freedesktop people to add a mime spec for PKGBUILD and arch packages to the standard. This is the cleaner solution in my opinion. This is likely to be accepted as long as the PKGBUILD and Arch packages formats are stable since years, and they already have RPM, DEB and other distro specific data. Here is a link to a documentation about the subject : http://freedesktop.org/wiki/Specifications/AddingMIMETutor Here is a link to freedesktop bugzilla : https://bugs.freedesktop.org/buglist.cgi?product=shared-mime-info&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED Please also find attached 2 mime spec for Arch PKGBUILD and packages. They might be attached to the request at Freedesktop, but should be reviewed first. Once those mime types will be accepted and shiped with Freedesktop's mime db, I will be pleased to work on syntax highlighting for gedit, and compression/decompression inside fille-roller, icons for Nautilus and other Gnome applications. Thank you very much for you attention ! Cheers, Chicha. |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 12 February 2016, 13:17 GMT
Reason for closing: Upstream
Additional comments about closing: This should be done upstream.
Friday, 12 February 2016, 13:17 GMT
Reason for closing: Upstream
Additional comments about closing: This should be done upstream.
x-arch-pkgbuild.xml
* that french translation seems pretty useless, I would just remove it :)
* why not just simply using the .pkg.tar.gz extension?
It seems really weird to include the arch there. Even if only i686 and x86 64 are officially supported, it doesn't mean you are limited to these arch, you could build pacman packages for any arch. There were also some discussions about the "any" arch for arch-independent packages.
Besides, the arch was not originally included in the filenames, it was added with pacman 3 I think, for the current/extra repos.
But there might be still some old packages there that don't have it. And all packages from the community repo don't have it either.
Finally, in the default /etc/makepkg.conf we have the following variables :
BUILDSCRIPT='PKGBUILD'
PKGEXT='.pkg.tar.gz'
SRCEXT='.src.tar.gz'
- The french translation is useless, I agree. It is just there to show that there are i18n stuffs too in the xml file.
- I agree about the .pkg.tar.gz extension. The more I think about it the more I find having architecture dependend stuffs is bad :-)
- I forgot about .src.tar.gz. I thought it was just a convient way to upload files to AUR ... Do you see it as a src.rpm equivalent ?
Also I was thinking about a dedicated package in a first stage, such archlinux-freedesktop or something similar, before submitting a request to freedesktop.
This package could have the .xml files to define the MIME data, and also some icones for nice display in Nautilus,Konqueror,Thunar and so.
I have identified a package which will need a patch (or a request upstream if it is official at freedesktop) : fille-roller. The mime types are hardcoded in this soft and it does not seem to handle 'sub-class-of' : when enabling the mime type for pkg.tar.gz (sub-class-of tar.gz) fille-roller do not recognize it as tar.gz ... I am going to investigate further.
In any case, further studies must be done (be sure I will), but I think it would be great to have this idea brought and discussed on dev side :-)
Thanks again !
We could also add db.tar.gz as a recognized file type too- I haven't looked at how these things are recognized but the easy way to see if a file is a database is to look for desc and depends files inside one level of subdirectories.
On that note, is it wise for us to hardcode the .tar.gz extensions? A pacman package can be recognized by the .PKGINFO file inside rather than just the extension if that is possible. But I don't want to hijack this, I will leave it up to you. Thanks for looking into this.
If you want to test all this you can put the Override.xml file attached into you $HOME/.local/share/mime/packages/ directory.
Then run the command (as current user, no need to be root) 'update-mime-database' to update the database.
What is great is that it does not alter the whole MIME database, just the one used by your current user :-)
This is all explained here : http://freedesktop.org/wiki/Specifications/AddingMIMETutor
I have also attached freedesktop.org.xml which is where what we are talking about will one day (hopefully) be integrated.
This file can be used to see how others cope with the file type detection.
To answer Dan, we do not need to use the .tar.gz extension as long as we can identify our objects (PKGBUILD, packages, src packages, data bases ...) by examining the binary file at a defined offset. Have a look at how ELF dynamic libraries or RPM packages are detected in the freedesktop.org.xml.
For us it will work if we can warranty that the .PKGINFO file will always be at the same offset (binary speaking) in the tarball...
Lets make a little status on what we have :
* PKGBUILD : can only be identified by the file name pattern '^PKGBUILD$'.
* source tarball : can be identified by the file name pattern '*.src.tar.gz' or by a binary offset if we can warranty that the PKGBUILD file is always at the same binary position in the tarball.
* binary package : can be identified by the file name pattern '*.pkg.tar.gz' or by a binary offset if we can warranty that the .PKGINFO is always at the same binary position in the tarball.
* database tarball : I am not sure what is this tarball for, can you please give a quick recap ;-) ?
Also we have to take care about inheritance : a source tarball or binary package tarball may inherit from the application/x-compressed-tar.
Thus a well designed compression/decompression application (File-Roller is a bad example with hardcodes everywhere) can handle those files without knowing everything about them.
I hope I answered Dan ...
We need to status on which pacman objects (PKGBUILD, src tarball, pkg tarball, db tarball) we want to "freedesktopize", which type name we are going to use for this objects, from which other type they inherit (I will give you some proposal) and which criteria will be used for mime type matching according to my comments above.
Cheers,
Chicha
But even without talking about that, the tarball is compressed so I don't see how we could make any detection on the resulting package, without decompressing it first.
Given that, I am afraid the only way is to rely on the extension.