[AppStream] Appstream ID and Flatpak

Simon McVittie smcv at collabora.com
Fri Jan 12 13:37:12 UTC 2018


On Thu, 11 Jan 2018 at 22:31:40 -0700, Nate Graham wrote:
> I decided to start this work myself and have been submitting patches for
> affected apps.

Please be extra-careful about domain names (and domain-name-like constructs
like GitHub usernames) that contain U+002D HYPHEN-MINUS (hyphen, minus,
dash), or that contain a component starting with a digit.

Specifically, the change you got merged into Endless Sky is in fact using
a reversed domain name that doesn't belong to the author of Endless Sky,
and could be claimed by another GitHub user or org by registering on
GitHub as "endlesssky".

The recommendation that I recently committed to the Desktop Entry
spec and to the D-Bus Specification is to replace all hyphen/minus
with underscores, and prefix an underscore if there is a digit
immediately before a domain component. For instance, if 7-zip.org
published an archiver, they could call it org._7_zip.Archiver.
The AppStream specification is going to include the same advice when
its maintainer gets a chance.

Following that recommendation can't ever introduce a collision with someone
else's domain name, because underscores aren't valid in domain names and
so can't be registered.

Additionally, if AppStream and Flatpak are following D-Bus here, it would
be nice to follow the D-Bus convention (which is not required, but would
be as good a convention as any other if you're doing mass-bug-filing). In
D-Bus, the part of the name that corresponds to a domain name is usually
lower-case, and the part that represents the application is usually
CamelCase. I think we originally got that convention from Java, but it
was before my time.

Putting those together would lead to
<id>io.github.endless_sky.EndlessSky</id>.

> 0ad:          https://code.wildfiregames.com/D1186

This one is potentially going to run into problems if they don't want
to use "play0ad" or "zeroad" like Flathub did, because "0ad" starts with
a digit. I've left a comment.

    smcv


More information about the AppStream mailing list