Tuesday, 15 May 2007

Service Pack Maker

I seem to be improving my programming skills quite quickly now. I started to make a Java version of the "service pack" creator idea I had a while ago (see my comment on this Ubuntu Wiki page https://wiki.ubuntu.com/OfflineUpdateSpec) and it is coming on quite well. I have given it an Ubuntu spec page here: https://wiki.ubuntu.com/TransparentServicePackMaker if you are interested.

Currently there is a nice simple GUI (although the "Advanced" button should really be a tab, but it isn't implemented yet anyway), the text entered into the Name box is turned into lowercase and spaces are replaced with hyphens (so entering "Graphics Applications 1" will turn into "graphics-applications-1"), the value for the tick box about including the system's non-default packages is read, and the "include" field is parsed.

What I am quite proud of is teaching myself file input and output, so that the contents of /var/lib/apt/lists (the lists of packages available from your repositories) are read when the application starts up and dumped into a temporary file called /tmp/service-pack-temp-XXXX (where XXXX is a random number to make the file unique). Upon clicking "Create" the given "include" line is parsed as a space-separated list of packages. If any of the package names given are not found in the available repositories then a message comes up warning the user of this. If all of the packages are found then the list is given to the service pack for inclusion, where all of the duplicates are removed. This means that putting "gimp gimp gimp inkscape gimp inkscape Warbo" will give a message saying that Warbo cannot be found. removing Warbo from the line will include "gimp" and "inkscape" in the pack once, which I think is quite nice.

The tool doesn't yet output anything, which I am working on, but it looks like a working tool is near. When it is done I will probably ask in the forums for someone to redo it in Python and GTK.

1 comment:

Warbo said...

UPDATE: I've redone it in Python and GTK myself. However, I had it almost working on Debian-based systems (the generated package's scripts weren't run for some reason), but then in an attempt to make it more cross-distro I've broken it quite badly. I'll fix it if I get time (which at the moment I don't have much of)