Latest Tweets

When backporting is easier than debugging …

An old lesstif2 bug comes back…

Here it is: one more time, that awful “Attempt to copy to an unlocked clipboard!” error message whenever using the nedit text editor on a Debian GNU/Linux Squeeze 64 bit distro. How awful!

It has been long since this first issue was fired, but it’s been equally long since it finally got fixed. So, why bother? One first approach could be, seriously, to debug the lesstif2 library. As a matter of fact, that would be my way most of the time. However, no need this time to run gdb, but to create a backport.

So, the issue affecting nedit is,  obviously, due to a bug inside the lesstif2 library. Whenever selecting text inside the editor and using the “CTRL+C” short key  or the “Edit/Copy” menu facility, nothing is actually copied to the Clipboard and this error shows up on the CLI:


Therefore, we can fix this one by backporting lesstif2 to Squeeze. Let’s do it!

Trying the latest stable version of Lesstif2 without this bug

 First, we tried the latest lesstif2 sources, available from here, the usual way:

wget ...
tar xvfz lesstif2-0.95.2.tar.bz2
cd lesstif2-0.95.2/
./configure --prefix=/usr
make install

And, obviously, it worked perfectly well.

Backporting the lesstif2 package

Instead of dealing directly with the sources trying to fix the previous one whether by debugging it or by comparing their source trees (by means, you do know, of running the diff command), I decided to be pragmatic: what about backporting?  Clearly an easier solution – no need to do what has already been done, right? -.

The idea was to create a new version for the “lesstif2” packages, that is, lesstif2, lesstif2-dev and lesstif-doc. All these packages would be provided directly from the lesstif sources, once the back-porting procedure was completed.

Below, how I went all the way through debhelp, dh_make and dpkg-buildpackage in order to create these three new packages:

mv lesstif2-0.95.2.tar.bz2 lesstif2-0.95.2.orig.tar.bz2

cd lesstif2-0.95.2/

dh_make -e <myemail> -f ../lesstif2-0.95.2.orig.tar.bz2

dpkg-buildpackage -rfakeroot -uc -us

I had to make small alterations to the debian/control, debian/rules, debian/package_name.dirs and debian/package_name.install files. No need to elaborate here, it is quite trivial stuff.

After generating the packages, I got the debs ready to be installed on any Debian 64 bit Squeeze distro. They can be downloaded from HERE:

lesstif2_0.95.2-1_amd64.deb , lesstif2-dev_0.95.2-1_amd64.deb and lesstif-doc_0.95.2-1_amd64.deb