Monday, April 27, 2009

Some mistakes in shell programming

I've been seeing too many mistakes recently related to shell programming, due to some implemented features in GNU Bash (that are really cool if it were the only available shell on the planet). Let me tell you that it's really bad, because if those are used in some critical code to detect some implemented features, they can lead to serious problems in the build stage of the application, as I've seen with GNU autoconf generated configure scripts.

I'm posting this because I've spent a while detecting why libusb didn't have a symbol required by a dependent application; surprisingly that was due to the first mistake I'm explaining below in a configure script.

One of the most famous that you are probably aware of is the == operator used in conditionals. Remember that GNU Bash is the only shell that accepts the following:

if [ "$foo" == "$blah" ]; then
...
fi

and another one that I've just seen coming from the xorg detection block in GNU configure scripts (didn't see it until now):

BLAH="goo foo boob"
BLAH+="baobab anotherone"

This is a great mistake! those two examples (surely there will be many more) are relaying in GNU Bash for correct operation! think about it, relaying in such specific features won't do any good for all us.

Wednesday, April 22, 2009

Real Madrid's Pepe vs Getafe

Couldn't resist to add a post about the soccer match that yesterday I watched on TV: Real Madrid vs Getafe. Both are from Madrid, Spain; Getafe is a modest team that never won something important in the first division. Anyway in my opinion, Getafe played good and was better than Real Madrid. In minute 87, Pepe attacked Casquero from Getafe (with two kicks) and was injured with Penalty. Not enough for Pepe still punched Alvin.

Don't miss the attached picture and video, this is one of most amazing that I've seen in long time (source http://www.marca.com).

Saturday, April 18, 2009

XBPS starting up

Today I discovered that VMWare Workstation is able to record videos in realtime of a running VM, and just to test it I recorded a video showing up the Linux distribution that I'm building through the XBPS package manager, built from scratch.

To remind you, the distribution probably will be called LSXL aka "LeyreSaraXtraemeLaura" Linux, not very original but will work for now until I found something better. Also this video doesn't show many things, but probably will provide more videos showing some XBPS implemented features. To watch it correctly it's better to click in the video and using the HD version in youtube.

Friday, April 17, 2009

libarchive-2.7.0 and openssl requirement

So libarchive 2.7.0 was released today, and after updating the package I noticed that the library required libcrypto, WTF? with XBPS that means it's not good, because libarchive is one of the few packages required to build the xbps-base-chroot meta-pkg. The configure script looks for some OpenSSL headers/functions and if they are found, OpenSSL is linked automagically.

I want to avoid having extra dependencies for a core library as libarchive is, even more if the feature that this dependency requires is rarely used (such as in my case)... so I made a simple patch that adds an option (--without-openssl) and reported it in http://code.google.com/p/libarchive/issues/detail?id=22

I hope that the developers do understand this and commit it just in time for the next version!

Wednesday, April 1, 2009

Testing out bootchart with XBPS



I wanted to try out bootchart with the system I'm building through XBPS, just for curiosity; the results are not too bad: 25 seconds for a basic text system that starts network through dhcpcd, and some services like sshd, metalog, cron, portmap, mountd, nfsd, nfs locking, dbus and HAL. This can be improved if network is started graphically (via NetworkManager), and some services are not run by default, like setting the time via NTP; but for now I'm not too worried. For the record this is running in a VM with VMWare in Windows.

The GNU/Linux system I'm building uses sysvinit and BSD style initscripts, by using some portions from Archlinux rc scripts and the NetBSD's rc.d framework. It will be interesting to run bootchart again when I have a fully GNOME desktop, just for comparision with other distributions.