Archive for February, 2009
Database design tools
I have been looking for database design application on Linux for a while. I even recently started searching for something compatible with Linux through Wine too. The Ubuntu and Debian package database is devoid of anything useful beyond Dia, which I hate for reasons that do not belong to this rant-free blog. There are some tools around for MySQL but it is not the SGDB I’m the most found of. I’m particularily interested in PostgreSQL
It was a revelation to me when I found 2 free (as in beer) design application on the PostgreSQL Wiki. I was even more surprised that both loaded and seemed to work out of the box in just about 30 seconds after their download. I’m not sure about the licensing terms but they certainly look safe to use for FOSS development.
I have not tried either extensively. I just believe both application needs to be linked since they seem to be hard to find. I might review one of them here some day.
Open System Architect
This has an impressive number of button, menus and and various gadgets. It is in fact pretty intimidating at first. It has the feel of a professionally developed application.
It is open-source but sadly does not seem to be actively maintained. This is something I fear I might discover after some prolongued use.
SQLPower Power*Architect
This simple looking application is in Java, which is a showstopper for some people. A good Java application isn’t something that stops me, but I admit Java applications sometimes have problem at setup time if they are not properly packaged.
This application doesn’t have that problem. It run fine when started with a canonical java -jar file.jar command.
The application does look funky a bit on my computer. The fonts are serif and heavily anti-aliased. It look clunky a bit. The screenshots on the site don’t have that problem. It might be a quirk related to my Java distribution or my some font handling problem on my Linux distribution. I need to investigate. That aside, the GUI is simple and no as scary as Open System Architect. If I could fix the font glitch, it will be sweet.
This is also open source. They have a Google Code project.
Interesting Bash snippet
This little Bash snippets scans the Debian dpkg database for packages whose configurations files have been modified.
This only touches configurations files which are packaged and made known to dpkg. Some package manually handle their configuration file in maintainer scripts. A good example of that is /etc/network/interfaces which is an important configuration file but not automatically handled by dpkg.
This is as useful as you want to make it. I use it to track changes I’ve done which could end up with a conflict during a package upgrade. If you want a more thorough tracking of configuration changes, use something like etckeeper.
Notice I took some care to use more Bash’isms, to optimize the script. I was able to optimize by just a few percents. The bulk of the time must spent calculating MD5 sums.
#!/bin/bash
for pkg in /var/lib/dpkg/info/*.conffiles; do
p1=${pkg#/var/lib/dpkg/info/}
p=${p1%%.conffiles}
IFS=$'n'
for cfsum in $(dpkg-query -W -f='${Conffiles}' $p); do
IFS=' '
c=($(eval "echo $cfsum"))
if [ -r ${c[0]} ]; then
sum=${c[1]}
cur_sum=($(eval "md5sum ${c[0]}"))
if [ $sum != ${cur_sum[0]} ]; then
echo "$p: ${c[0]}"
fi
else
echo "Can't access file: ${c[0]}." > /dev/stderr
fi
done
done
This will output something like this:
$ ./check_changed bash: /etc/bash.bashrc console-tools: /etc/console-tools/config libldap2: /etc/ldap/ldap.conf ntp: /etc/ntp.conf ...
Why patch distributed software?
I will not go over the story of the OpenSSL fiasco again. Let’s just say that a developer inserted a particular patch in Debian OpenSSL package that he shouldn’t have. The patch was flawed in ways subtile enough that it escaped review 2 years. Long story short, Debian was left in a rather immense accumulation of fecal matter.
This was bad and made a lot of people object to the fact that software are patched in Linux distributions. It is true that software developers usually are the best person to fix the bugs in their software. What is still true but perhaps less obvious, is that most software developers are not ready or able to work in close cooperation with distribution developers so that their software are perfectly packaged without bugs and in time for a distribution release.
Distribution developers need to patch software for various, good, reasons, to ensure the best quality software distribution to their users, in a timely fashion.
Today I will examine three different kind of patch and try to justify why Debian developers, or distribution developers in general, will develope them. What is very important to note is that Debian, and probably most other distributions, wants that the patch the developers produce are sent to the original developers in the software they are packaging. In the case of the Debian distribution, this is mandated by the Debian Policy Manual, in section 4.3. That way, the patch can be eventually integrated in a future release, and the patch removed for the package for that new release.
The lesser divergence from upstream, the better. The OpenSSL fiasco is certainly a proof of that.
Plain bugfixes
It is a frequent occurance that packages are patched to fix small software bug. It is often inconvenient for a software packager to wait for a new release each time a bug is reported in the software they are responsible of. In some case, that release may come after several months (years), during which the bug will stay unfixed, which may in some case make the package unusable.
Patches are often pulled from the development repository of the software, if they can be backported to the version currently in the distribution.
Debian developers will then patch software when they can, to the best of their knowledge. It is recommended that they consult with the maintainer of the software before uploading their change to the distribution.
Patch example
http://patch-tracking.debian.net/patch/series/view/nano/2.0.7-4/ja_help_freeze.patch
In the case of the nano package, the existance of the patch is documented in the changelog of the package.
Compiler fixes
Like all other package in the distribution, compilers evolve and are eventually upgraded. Debian usually test new compilers ahead of time so they can stamp out compilation bugs early.
In case compilation fails for a package with a new version of a compiler, Debian developers will sometimes prefer to patch the program instead of asking the upstream developer to build his program with a recent or possibly unreleased version of the a compiler. They will patch the program to make it work with the new compiler and transmit the patch to the original developers for their future use.
Patch example
http://patch-tracking.debian.net/patch/series/view/qtodo/0.1.2-5/20-gcc.dpatch
This patch adapts the program to a newer than the one that was probably used to develop the package.
FHS bugfixes
The Debian distribution try to closely follow the Filesystem Hierarchy Standard (FHS). This is actually mandated in the Debian Policy Manual, section 9.1 so, if a program puts a file in a wrong place, it is viewed as a important bug.
Fortunately, most developers will follow the FHS, by habit or consciously. This simplify the packaging process, most program won’t need to be changed to be compliant. Sometimes though, some developers consider that it is not improper that a global configuration file is put outside /etc, or that image files can be put in /var.
Patch example
http://patch-tracking.debian.net/patch/series/view/trac/0.10.3-1etch4/01_use_global_config
This patch tells the Trac web application to look for its configuration file in /etc instead of /usr/share.
That will be enough for today. I think I’m already beyond the “tl;dr” level for most people. I will try to find some more example of types of patch done by packagers in another blog post.
