[AppStream] Unifying the AppStream IDs
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Jul 25 16:26:16 UTC 2016
On 25/07/16 16:17, Matthias Klumpp wrote:
> 2016-07-25 16:59 GMT+02:00 Richard Hughes <hughsient at gmail.com>:
>> What's a launcher?
>
> A .desktop file, sorry for the unclear terminology.
In the automotive app-management stuff I've been working on, we've been
calling these "entry points", where one AppStream component has 0 or
more entry points (and a desktop-application would have 1 or more).
We've mainly been using "launcher" to mean the menu-like thing that
launches entry points (.desktop files), analogous to gnome-panel or
GNOME Shell. If anything, an entry point is a launchable, not a launcher :-)
>> g_dbus_is_unique_name() suggests its not trivial:
>> https://github.com/bratsche/glib/blob/master/gio/gdbusutils.c -- it's
>> probably best just to use that function.
>
> Uhhh... But it looks pretty much like what I described above -
> alphanumerics, dots, hyphens and underscores :-)
You probably don't want g_dbus_is_unique_name(). Unique names are the
things that look like :1.23, and include colons (indeed, they must start
with one). If you want to align with D-Bus, I think you should prefer to
copy the syntax of either interface names or well-known bus names. Both
of those normally look like com.example.MyProgram; the difference
between them is that well-known bus names may contain hyphen/minus but
interface names must not.
Note that well-known bus name and interface name components must not
start with a digit, unlike unique name components (so you can't have
"org.7-zip.Archiver" or even "org.7_zip.Archiver").
The mangling I have been trying to encourage is that the owner of a
domain with leading digits or with hyphen/minus (7-zip.org is a nice
example of both) should publish apps named like org._7_zip.Archiver,
which is ugly, but ensures that the bus name, interface name and "app
ID" (whether that means AppStream or .desktop file) can be an exact
match, modulo addition or removal of a .desktop suffix.
I think Flatpak has been canonicalizing by treating hyphen/minus and
underscore as equivalent when deciding what names you can own, so a
Flatpak named com.example.My-App can own the bus name com.example.My_App.
All D-Bus names (in all their various subtly different variations) are
pure ASCII. Internationalized domain names are also ASCII on the wire
(due to DNS protocol limitations), using "Punycode"; for example
яндекс.рф (yandex.ru's Cyrillic alternate domain, according to
Wikipedia) is spelled xn--d1acpjx3f.xn--p1ai when it appears in DNS
packets, and I suppose they could use the D-Bus name
xn__p1ai.xn__d1acpjx3f if they really wanted to. (But in practice I'm
sure they'd use ru.yandex.)
> I looked at a list of TLDs for proper validation, and that list is
> massive, containing >> 1400 entries... Including things like .yahoo
> and .accenture, .airforce and .edeka.
ICANN can (unfortunately) create new TLDs at any time, so you can't
validate like that offline in any case.
--
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>
More information about the AppStream
mailing list