[Sugar-devel] Changing bundle_id and version scheme for Etoys
C. Scott Ananian
cscott at laptop.org
Tue Jul 27 18:21:42 EDT 2010
On Tue, Jul 27, 2010 at 5:14 PM, Bernie Innocenti <bernie at codewiz.org> wrote:
> The bundle base name (e.g Record) should be unique by itself, because
> you can't have two directories named "Record.activity" in your
> activities directory.
This is, IMO, a bug. The directory should really be named after the bundle id.
The bundle ID is not a dbus name, it just conforms to the character
rules for dbus names. To quote
http://wiki.laptop.org/go/Activity_bundles :
---------- begin quote ----------
This is the activity bundle identifier. It is required. The name
should conform to the D-Bus spec - in particular, hyphens are not
allowed (although this wasn't enforced in earlier builds, see Trac
6226). It is recommended that Java package naming conventions are used
when chosing bundle identifiers, to ensure uniqueness. Briefly, your
name should begin with the reversed domain name of an organization you
belong to.
The reversed domain name part is supposed to be rooted in some actual
DNS-rooted namespace. You don't need to own this domain; you just need
to have a reasonable claim on some unique name at that domain. There
are several ways to derive one:
If your email address is yourname at somemailhost.com, then you could use
com.somemailhost.yourname.YourActivity.
You could set up a web page on a free hosting service with information
about your activity, and use a name derived from its URL. For example,
if you create a page at http://www.geocities.com/xotumusica for your
activity, then com.geocities.www.xotumusica is a reasonable bundle_id.
If nothing else is available, even
org.laptop.wiki.YourActivityPageTitle is probably a reasonable
bundle_id, provided that you create the YourActivityPageTitle page.
Remember, bundle_ids should be unique, so you should double check that
the YourActivityPageTitle page doesn't already exist (and then create
it) before using this as your bundle_id.
-------- end quote ----
This is a nicely decentralized mechanism for choosing identifiers
which are guaranteed by construction never to conflict.
> Even if it were possible to install org.sugarlabs.Record and
> com.microsoft.Record in parallel, having two different activities with
> the same name would be confusing and almost never what the user
> expected.
You're neglecting localization issues here.
> Perhaps there's still something we could do to simplify the design
> without breaking backwards compatibility: if an activity doesn't specify
> a bundle_id, its dbus name could be derived from the bundle name by
> pre-pending "org.sugarlabs." (or org.laptop., it doesn't matter) to it.
If sugarlabs is willing to maintain a mechanism for ensuring
uniqueness, feel free to prepend org.sugarlabs to whatever activities
you have "registered".
> For all other purposes, the bundle_id is just a string which could
> contain anything. The bundle_id "org.tuxpaint.sugar-is-lame" worked
> flawlessly for all this time.
Yes, this identifier is childish, but conforms precisely to the rules
outlined above, which ensure its uniqueness.
--scott
--
( http://cscott.net/ )
More information about the Sugar-devel
mailing list