Skip to content

Draft: [RFC] temp/alpine-appstream-downloader: new aport

Pablo Correa Gomez requested to merge (removed):appstream-data into master

So after going again through #1384 (closed) and working for longer in GS, I came to the conclusion that the best approach to have maintainable, long-term working AppStream data in pmOS and alpine, for both PD and GS is to have a small tool which makes sure that we are compliant with the specification. I wrote and tested such a small python script. It takes care of downloading the data from https://appstream.alpinelinux.org matching against /etc/apk/repositories, to make sure that we are always downloading the correct data.

I tried to make the program self-managed, so that it would run as a daemon and fetch data when /lib/apk/db/lock was locked and unlocked. But I wasn't able to make it work with the exclusive lock required by apk. So to fully integrate this, it would need to be called from PD polkit process (ideally I guess that when pulling updates), and from apk-polkit-rs. Hopefully calling such a simple script should be something trivial to implement, and would avoid the extra patch @minlexx is maintaining for downloading data, and making use of buggy and non-compliant external-appstream-urls from GS.

An additional benefit from having a small script is that it could be called from pmbootstrap during the process of building images, so that phosh/gnome and plasma images come with the appstream data already installed. This should make a much more pleasant experience on the first use of GS, and I guess also PD, but that I cannot tell. For the record, in my edge installation, the take this amount of space:

user@alpine-edge:~/data/Informatica/postmarketOS/pmaports$ du -hd1 /var/cache/swcatalog/icons/
3.3M    /var/cache/swcatalog/icons/alpinelinux-edge-community
1.5M    /var/cache/swcatalog/icons/alpinelinux-edge-testing
32K     /var/cache/swcatalog/icons/alpinelinux-edge-main
4.7M    /var/cache/swcatalog/icons/
user@alpine-edge:~/data/Informatica/postmarketOS/pmaports$ ls -lh /var/lib/swcatalog/xml/
total 3.8M
-rw-r--r-- 1 root root 3.5M Dec 22 23:39 alpinelinux-edge-community.xml.gz
-rw-r--r-- 1 root root 9.8K Dec 22 23:38 alpinelinux-edge-main.xml.gz
-rw-r--r-- 1 root root 287K Dec 22 23:39 alpinelinux-edge-testing.xml.gz

So please, thoughts 😄

Relates #1384 (closed)

Ah, and I forgot. Of course this shouldn't be merge here, but in alpine. Although pmOS are the main receivers of this effort, so thus the discussion here.

Edited by Pablo Correa Gomez

Merge request reports