Changing the world view with fonts

Somehow I ended up at KDE Look website today. I’ve got a bunch of stuff installed from there, but most noticably lots and lots of fonts. If you are not in the mood for searching, here is the link to Microsoft core True Type fonts and here is the link to the package with 6,760 True Type fonts. You will never need another font in your life. And there’ll be plenty left for your kids and grandkids.

After I installed all these fonts, the world looks and feels different. I’ll have to get used to it. At least in the browser.

Finding the tree version in the working directory

When using Gnu Arch, once in a while I need to verify that I am in the correct working directory. With long names, patches, and all those branches it is not always that obvious. The shortest way to find the version of the tree in the current working directory is:

tla logs -rf | head -1

Telling Gnu Arch the truth

Yet another problem (and solution) that I’ve stumbled across while using Gnu Arch. We have two branches in our archive: program--vendor--0.1 and program--local--0.1. Vendor’s version has all the source files in SomeDirectory, while our local version has all source files in somedir. Except for the name and few local changes, these two directories are practically identical.

But when we were creating branches and importing code, we weren’t very careful and ended up with these directories and files having different arch IDs. This makes comparing two source trees close to impossible, as arch thinks that directory SomeDirectory was removed together with all its content and directory somedir was added together with a bunch of files.

Telling Arch the truth is very simple. Basically, all that needs to be done is =id and *.id files under all .arch-ids/ directories in one source tree should be copied to the appropriate places in the other source tree. After that tla commit should be done.

In order to minimize the pain of manual labour, I wrote a tiny perl script to find all needed files and copy them appropriately. On the command line just specify two directories, which you know are the same, but which arch considers different. If any of the files weren’t copied, you’ll get their names in the warning. When script finishes, you’ll get the total count of copied files.

The script is here: fix_arch_ids.pl

The magic of tla cacherev

I’ve stumbled upon an annoying problem while use Gnu Arch. During the development process, one of the directories in the source tree was given bad permissions (r-xr-x-rx). With the next patch, this directory was removed altogether. That introduced a problem for tla get as it was dying with permission denied error. That happens because when tla get is executed, it gets the base-0 tree version and then applies patch-1, patch-2, … patch-N in order. Obviously, when it gets to the patch which tries to remove the directory, it fails with “permission denied” error.

The fix for this problem turned out to be very simple. tla get can be executed with user root. It won’t fail as root has enough permissions to remove the directory. But what root can also do is tla cacherev project--branch--version--patch-X. This will force arch to pack the whole tree at patch-X into the archive and use it as a unit. So, next time when someone will tla get the tree version greater or equal to patch-X, he will get it straight ahead, without all the pacthing (except for the those paches that follow patch-X).

After tla cacherev all users can execute tla get without any problems.

This technique can also be used to save some time on the tla get operation in those cases where lots of patching needs to be done.