[maemo-developers] Enriching the Application Manager scripting experience

From: Marius Gedminas marius at pov.lt
Date: Fri Feb 23 16:28:37 EET 2007
Hi,

On Fri, Feb 23, 2007 at 02:56:27PM +0200, Marius Vollmer wrote:
> we need to make the .install files more capable and more extensible
> for the future, so I came up with a design that I want to run past
> you.

That's good!

> Please go here for preliminary documentation about what I am planning
> (the text is also appended below for easy commenting).
...
> I managed to sneak a bit of Lisp into the Application Manager, but I
> kept it enterprise ready by hiding it behind XML.  So while the new
> way of writing .install files looks quite verbose, it is really quite
> simple.

Now I'm worried.

> None of the documented stuff has been implemented, except the basic
> support for X-expressions and storing catalogues in X-expression form.
> 
> So, what features do you think are missing from .install files?  Now
> is a good time to add them.

The ability to add more than one repository.  E.g. I have an app in my
repo that needs some library from repositories.maemo.org.

> ### Basic syntax
> 
...
> It is important to distinguish empty lists from empty texts.  An empty
> list is written as
> 
>     <empty/>
> 
> while an empty text is written as
> 
>     <empty></empty>

According to the XML spec, these two are exactly equivalent.  -1 for
insisting for different spellings in different contexts.

> All text must be encoded in UTF-8.
...
> ### Example
> 
> The following X-expression is a installation script to install the
> maemofoo package from the Foobar repository.
> 
>     <install-instructions>
>      <update-catalogues>
>       <catalogue>
>        <tag>com.foobar.repository.automatic</tag>
>        <version>0</version>
>        <name>
>         <en_GB>Foobar Catalogue</en_GB>
>         <de_DE>Foobar Katalog</de_DE>
>        </name>
>        <uri>http://example.com/</uri>
>        <dist><automatic/></dist>
>        <components>main</components>
>       </catalogue>
>      </update-catalogues>
>      <install-packages>
>       <pkg>maemofoo</pkg>
>      </install-packages>
>     <install-instructions>

Compare this to a hyphotetical .ini-based format like the one used by
GNOME/Freedesktop .desktop files

    [install]
    repo_name = Foobar Catalogue
    repo_name[de_DE] = Foobar Katalog
    repo_deb = http://example.com/ mistral main
    repo_deb_3 = http://example.com/ bora main
    package = maemofoo

I think the XML-ish format is harder to write, harder to read, and
provides too many features that I do not see any need for.

But that's my personal opinion.

> (Yes, using a text markup language to represent data structures (let
> alone programs) gives pretty unreadable results.)

XML can be pretty readable.

> Here is another, slightly more involved example.  This one can be used
> on a memory card.  It will offer to install the listed packages and
> will use a repository on the memory card for that.  Repositories for
> "bora" and "mistral" are supplied, and they are located relatively to
> installation script.  Afterwards, it will offer to add a automatic
> repository that might be used to deliver updates.
> 
>     <install-instructions>
>      <with-temporary-catalogues>
>       <add-catalogues>
>        <catalogue>
>         <no-network>
>         <filter-dist>bora</filter-dist>
>         <uri><file-relative>.repository/bora</file-relative></uri>
>        </catalogue>
>        <catalogue>
>         <no-network>
>         <filter-dist>mistral</filter-dist>
>         <uri><file-relative>.repository/mistral</file-relative></uri>
>        </catalogue>
>       </add-catalogues>
>       <install-packages>
>        <pkg>frozen-bubble</pkg>
>        <pkg>crazy-parking</pkg>
>       </install-packages>
>      </with-temporary-repositories>
>      <add-catalogues>
>       <catalogue>
>        <name>
>         <en_GB>Foobar Games</en_GB>
>         <de_DE>Foobar Spiele</de_DE>
>        </name>
>        <uri>http://foobar.com/</uri>
>        <dist><automatic/></dist>
>        <components>main</components>
>       </catalogue>
>      </add-catalogues>      
>     <install-instructions>

Let me try...

    [install]
    temporary_file_relative_repo_deb = .repository/mistral mistral
    temporary_file_relative_repo_deb_3 = .repository/bora bora
    package = frozen-bubble crazy-parking
    repo_name = Foobar Games
    repo_name[de_DE] = Foobar Spiele
    repo_deb = http://foobar.com/ mistral main
    repo_deb_3 = http://foobar.com/ bora main

> ### Compatability with IT OS 2007.

Yup.

> The old GKeyFile format used by IT OS 2007 is still supported.  You
> can embed a X-expression in it as comments like so:
> 
>     # <install-instructions>
>     #  ...
>     # </install-instructions>

Ouch.  Comments that are not really comments.  I can't say I like it.

>     [install]
>     repo_deb_3=deb http://foobar.com/ bora main
>     package=maemofoo
>     
> If the Hildon Application Manager encounters such a file with an
> embedded X-expression, it will use that and ignore the rest.  If there
> is no X-expression, it will transform the GKeyFile according to the
> following rules.

Summary: I would prefer a straightforward extension of the current
.ini-based file format.

Marius Gedminas
-- 
A Law of Computer Programming:
        Make it possible for programmers to write in English
        and you will find that programmers cannot write in English.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20070223/94ba5fed/attachment.pgp 
More information about the maemo-developers mailing list