Updated package for the puzzle collection

EdorFaus edorfaus at xepher.net
Mon Sep 28 20:28:29 CEST 2009


EdorFaus wrote:
> On Tuesday 22 September 2009 19:46:50 Steven ** wrote:
>> Perhaps you could do both?  By default, install a wrapper script.  But
>> also provide a second ipk that creates all the .desktop files for each
>> game.

I ended up doing this, but in reverse: by default, install all the
.desktop files, but if a launcher is installed, remove them
automatically (until launcher is removed). See below for details.

I've also created a simple launcher - my thanks to MiPal on opkg.org,
who showed me (with an example) that it wasn't very difficult to make
such things with Elementary, and thus pointed me in the right direction
for making one. It will be packaged separately, once I find the time to
do it properly, and will work with the new version of the base package.

>> I only play 3 or 4 of the 24 games anyways...
> 
> I don't play all of them either. Maybe we could come up with some system for 
> the .desktop files that would let the user "disable" some, without having them 
> return when the package is upgraded (like they would if they were deleted)?

I've now created such a system. Does the following sound usable?
(I'm working on finishing the packaging and setting up a public svn repo
for it, and will post the new version of the package once that's ready.)

The package no longer contains the .desktop files directly, but instead
installs a script that generates and removes them, which is called
automatically by postinst/prerm. This is based on an included file
containing information on all of the games, that can also be used by a
launcher to make its own list of games (like my launcher above does).

This script looks for a "has-launcher" file in a specific shared
location, and if it exists, removes all the .desktop files instead of
installing them (thus removing all the icons except the launcher).
This makes it relatively simple for a launcher package to get rid of the
other icons, just include that file and call the script to update them 
in postinst and postrm (to get them back when removing the launcher).
(There will be an example of this, is the package for my launcher.)

This script can also be called manually, with parameters for disabling
and enabling individual desktop icons (regardless of having a launcher
or not), without having them just return when the package is updated.
This means that people who only play a few games can have just those
icons on the desktop, without a separate launcher.
It's also possible to have a launcher, but still keep some of the icons
on the desktop - which could be useful if you play a few games often,
but still play the others sometimes.

To do this, it keeps a config file in /etc/sgt-puzzles.conf that it 
edits when the user changes something.


Soo... What do you think? Too horrible to ship? Or maybe even usable?


Oh, and, for simplicity I'm thinking it's best to use the MIT license 
for this code (the part in the base puzzles package anyway), since the 
games are under the MIT license - but IANAL, so I don't know if there 
are any (significant) negative consequences of this... Does anyone know?

--
EdorFaus



More information about the community mailing list