Saturday, November 22, 2008

Doxygen and Ruby...

I've been using Doxygen for a while now, and, no surprises, I find it fantastic ! The only thing that is really missing there is a decent support for Ruby... Allright, Ruby already has a documentation system, rdoc, but using only one for everything has its charms, and Doxygen is doubtlessly much more evolved than rdoc. Maybe when I have time, I'll have a look at writing it. (but that won't be before a long time...).

Update: I finally had some time to write and publish this patch. It is available on github

Tuesday, October 14, 2008

Another bzr2git example

Today, I tried to switch one of my personal repositories for debian-related scripts from bzr to git, just like I've done for pmount. The trick was that this time, I wanted to only move a part of the repository, not the full repository. I had only been working before with CVS and SVN who have the idea of modules, which is not the case for bzr or git. So I made the mistake of using a single bzr for several projects, which I realize now is not a very good idea...

In any case, I managed to drop some parts and here is how I did it; the trick was precisely to use SVN as an intermediate storage medium, using the following configurations files. First, bzr2svn.conf

[DEFAULT]
verbose = True
patch-name-format = ""

[project]
source = bzr:source
target = svn:target
start-revision = INITIAL
state-file = tailor.state

[bzr:source]
repository = /home/vincent/debian-devel/bzr/scripts

[svn:target]
repository = file:///tmp/testtai
module = biniou

and svn2git.conf:

[DEFAULT]
verbose = True
patch-name-format = ""

[project]
source = svn:source
target = git:target
start-revision = INITIAL
root-directory = /home/vincent/tmp/debian-mr-copyright-mode
state-file = tailor.state

[svn:source]
repository = file:///tmp/testtai
module = biniou/debian-mr-copyright-mode

[git:target]
git-command=/usr/bin/git

Then, all that is left to do is to run tailor on the resulting configuration files:

~ tailor -D -c bzr2svn.conf
~ tailor -D -c svn2git.conf

Sanitizing bad UTF-8

I've hit a problem recently where statsvn does not manage to generate statistics on one of my repositories. After investigation, it turned out that there are some raw latin1 sequences in the XML log file (from a conversion from latin to UTF-8 long time ago), and that makes logfile parsing fail. To sanitize this, I use the following filter:

iconv -c -f UTF-8 -t UTF-8

This way, obnoxious sequences are dropped and processing can go on. (or, at least, could go on if it was not failing just a little later with a Null pointer exception...).

Thursday, October 9, 2008

pmount switching to git

I've been neglecting pmount for such a long time I feel ashamed about it. Thanks to tailor and a neat post, I've just switched it to a git repository at git://git.debian.org/git/pmount/pmount.git to get more work done (I don't like bzr too much in the end, don't flame me, it's just a matter of personal taste...). I hope that I'll be able to reduce the amazing number of bugs that have accumulated there...

Thursday, September 18, 2008

pdfcrop vs pdfnup --trim

I make heavy use of pdfcrop (the version by Heiko Oberdiek included in texlive) for printing, as it allows to remove all the white spaces around the text before nupping and printing. However, with recent ghostscript, the bounding box detection is dreadfully slow, anything from one to ten seconds for a single page ! When you have a 60 pages article to print, it can be quite tedious...

Well, I've just discovered that the --trim option of pdfnup can do very similar things too. It removes a given amount of margins on the side, with the syntax 'left bottom right top'. Most of the time, a well-thought pdfnup --trim ... will work as well as pdfcrop while in the meantime being much faster...

Tuesday, August 19, 2008

What ctioga is missing

I haven't posted for a long while about ctioga, but that does not mean that development has stopped. It goes on, and features get added basically every single time I need them. Recent additions make it possible to tune a little more the look of the legends and add pure text lines in them.

I've however realized that now, what ctioga is missing the most is real flexibility over the coordinates. For now, all coordinate positions are either relative to the frame (such as for --inset) or to the graph (for --draw). What I really wish is a way to mix all kind of coordinates: real size (1cm), frame position and graph position. That will require quite a fair deal of work, of course, but that shouldn't be too difficult... I'll go on posting about it here.

Friday, August 1, 2008

CivCTP does not work with 2.6.25 kernels

Well, yes, I'm still playing old games like Civilization Call to Power, because I like... And I've recently had troubles getting it to play on a Debian/sid machine with a 2.6.25 kernel. I seemed to remember it was working fine before that, so I insisted, to the point that I switched back to a 2.6.18 kernel... And that worked ! I don't know what did change, but that is a weird bug indeed...

Friday, May 9, 2008

My lastest fight with udev...

Important note: This post has been modified according to a private remark from Marco d'Itri, thanks to him for his explanations !

I've been trying for a very long while to learn to write udev rules, but I've mostly been unsuccessful, or rather, successful by chance, which is hardly better, as it implies no understanding whatsoever of what I'm doing.

My game, today, was to create a symlink for a loop device (loop7) and set the device's group to cdrom (I might elaborate some time later why I need that). So, here is what I learned:

  • at least for the GROUP= directive, the latest item in the /etc/udev/rules.d directory rules
  • to test the modifications, the best thing is to generate a synthetic add using the following snippet:
    echo add > /sys/block/loop7/uevent
    
    Many thanks to Marco d'Itri for this information !

With that in mind, the following snippet worked for me, under the name 40-private-loop.rules:

KERNEL=="loop7", SYMLINK="videoloop", GROUP="cdrom"

Enjoy !

Saturday, May 3, 2008

vegastrike finally made it to testing !!

There you go, this is a celebration day, vegastrike has finally migrated to testing ! Vegastrike basically never was in testing, excepted apparently by mistake last year... Quite a fair amount of work, I'd say !

Well, now, I'll be able to package the official 0.5 release and take care of excessive dependencies.

Thursday, May 1, 2008

PDF conversion to grayscale

I had some trouble finding out how to convert a color PDF to a grayscale one. I found a post on an Ubuntu forum giving the following recipe:

pdf2ps -sDEVICE=psgray original.odf
ps2pdf original.ps new.pdf

This works, but this has the unpleasant side effect to increase the size of the PDF and to lower the quality (for a reason which escapes me). So I looked again in the magic pdfwrite parameters, and I came up with the following solution, which works on my box (though the above page suggests it shouldn't):

gs -sOutputFile=biniou.pdf -sDEVICE=pdfwrite \
  -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
  -dCompatibilityLevel=1.4 Plot.pdf < /dev/null

This works fine, does not lower the quality of the produced PDF and in the case I tried even made it smaller...

Monday, April 7, 2008

Please, pretty please, do not group patches by files, but by topic !

I'm currently working on putting back vegastrike into shape, bringing slightly more recent code (only three years after the last sourceful upload). And I'm fighting with patches (a good dozen), trying to see what does not apply anymore and what still does, why some patch was written in the first place... I have two requests to the community about that (and, please, do flame me if you think differently ;-)...):

  • Please do not group patches by file, but by topic: if a patch modifies the name of a save directory, let it be the only patch to do that, even if it modifies files touched by other patches ! It is very annoying to have to go through the patches trying to see which hunk of which patch does what
  • As an extension of the first request, please document why patches are there in the first place: a small explanation is very helpful to determine if one needs to fight to refresh the patch and understand it, or if this is a minor, long-gone problem... Of course, you can only give meaningful description if you group the patches by topic.

Great thanks to all patch writers that think about the ones that could possibly follow them !

Thursday, April 3, 2008

mk-build-deps: create a dummy package depending on a package's build-deps

When I work on a package, I often find that I want to have build-deps installed in a way that I remember why I did install them in the first place. apt-get build-dep is not a proper solution for me for two reasons:

  • It marks the packages as automatically installed (at least, last time I checked, it did), which does not play nice with aptitude, who wants to remove them immediately. Marking them manually installed would not be a solution either (since I would not remember why I did install them).
  • It does not work for package whose build-deps changed since the last upload (or that were never uploaded).

As I'm starting to work on vegastrike, who's in great need of tender care, I though time had to find a more decent solution. The answer is mk-build-deps, a small Perl script that takes a control file or a package name and uses equivs to create a dummy package depending on its build-deps. Pretty useful (for me at least). Maybe it would be worth including in the devscipts package ?

Wednesday, April 2, 2008

OOXML: Microsoft did win...

Bad news for the OpenSource/FreeSoftware community (or whatever you would wish to call it): ISO has just accepted Microsoft's Office Open XML file formats (see the suble alteration compared to a well known concurrent). Great. Even worse for me, it is apparently thanks to the French organization AFNOR. Fantastic. Now, we have two XML "office open document" formats accepted by ISO. That sounds so amazingly stupid that it's hard to believe... Just for information, the OpenDocument format, (the one from OpenOffice) has been accepted by ISO hardly more than a year ago !

Saturday, March 29, 2008

Thoughts about statsvn

Some time ago, I packaged statsvn, a pretty neat SVN repository analysis tool based on statcvs. To be truthful, I was quite amazed that no one had packaged it before, as I find it quite handy. It is currently in contrib, as it depends on statcvs that depends on libjfreechart-java that currently only works with Sun's java on AMD64 machines (at least, see the bug report).

A few comments about it: though it can work fine with remote repositories, it is highly recommended that you either take down the number of -threads, as many repositories out there do not like too many concurrent ssh accesses, or you rsync the whole repository to your local hard drive and work from a checkout of the local copy, as it will burn much less bandwidth and server time.

Of course, statistics of this kind are not to be taken too seriously, as they can be seriously biased by commit mistakes for instance, but they give the impression that work is being done, and that is pleasant ;-)...

Tuesday, March 25, 2008

Flashing a Sony DVD burner

I'm the happy owner of a Sony DRU-800A DVD burner, and I wanted to upgrade the firmware, as I had some little burning problems I hoped the upgrade would fix. Of course, Sony's website provides only Win32 flashers. They run under wine, but they don't actually do anything. Apparently, the way these win32 ioctls are implemented rely on the old hdc=scsi deprecated kernel interface. The trick is that we need a 2.4 kernel to get it working properly. So here are the steps I took:

  1. Get a bootable sarge with a 2.4 kernel, and boot it with hdc=scsi(hdc is the device name of your burner). You might need to compile the kernel yourself for it to work properly. In any case, you should see something like that in the output of dmesg
    scsi0 : SCSI host adapter emulation for IDE ATAPI devices
      Vendor: PLEXTOR   Model: DVD-ROM PX-130A   Rev: 1.02
      Type:   CD-ROM                             ANSI SCSI revision: 02
    Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
    sr0: scsi3-mmc drive: 0x/50x cd/rw xa/form2 cdda tray
    
  2. Make sure wine is installed, the sarge version worked fine for me (more recent versions compiled by hand did not).
  3. Make sure there is an appropriate /etc/fstab entry for the SCSI CDROM device. I have something like:
    /dev/sr0        /media/dvd              auto    defaults        
    
  4. Make sure there is an appropriate device symlink in /root/.wine/dosdevices. With the above fstab entry, the following would work:
    ln -s /media/dvd d:
    
  5. Run the flasher as root (giving write permissions for all SCSI devices to a normal user does not work)
  6. Reboot (to your normal system), and check you firmware version number with
    wodim -scanbus
    

This did work fine for the aforementioned DVD burner. It did not get my DVD reader to get flashed, though. But it's worth a try, and once the sarge boot is setup, you won't lose too much time.

As a conclusion, rush to get a sarge boot before lenny goes out and sarge is removed from the debian mirrors !

Saturday, March 22, 2008

Improvements for the machine-readable debian/copyright emacs mode

Since the last post, I have significantly improved debian-mr-copyright-mode, that now provides an interactive function, debian-mr-copyright-scan-files that shows which files are covered by which clause of the debian/copyright file. I've also significantly improved my understanding of font lock and emacs lisp in general...

As a demonstration, the attached picture represents the results of debian-mr-copyright-scan-files on the monsterz source package (Sam's original example). The output clearly shows that some files are not covered yet...

You can get the emacs mode there. Its is starting to be good, but of course, many more improvements are still planned - in particular, quotes for files probably don't work yet. By the way, imenu now works. A debian package should probably come soon.

Saturday, March 15, 2008

Emacs mode for machine-readable copyrights

I've been thinking that something that might help a wider adoption of the machine-readable copyright format is a proper emacs major mode for it. Well, at least, it does for me... So I started to write one. It is loosely based on debian-control-mode, although there is hardly any code left from it now. It only features syntax highlighting for now (including warning for licenses which were not on the wiki page at the time of the writing, or were marked as needing more discussions) but, after all, this is only my first emacs major mode...

The code can either be downloaded there, or from my bzr repository, in the debian-mr-copyright-mode directory

bzr branch http://people.debian.org/~fourmond/bzr/scripts

No debian package for that for now, as anyways it really should integrate dpkg-dev when it has matured somehow. Hope this helps !

Sunday, March 9, 2008

ctioga's non-linear axes

Much as been done on ctioga since the last release, not even two weeks ago: small bug fixes, tangents improvements, the rebirth of a --subplot option, a saner framework for plot styles... But the most significant improvement in my opinion is the possibility to make non-linear axes: you just need to provide a two-ways transformation between the standard coordinates and the axis coordinates, and ctioga does the rest:

ctioga -N --xpdf --math --math-xrange 2:8 \
  'sin(x)' --xaxis bottom --new-axis biniou top \
  --axis-function biniou 1/x 1/x \
  --lines-color biniou Gray --no-title

As you can see, I did profit to add the possibility of background lines corresponding to the axes' major ticks. The only real trick that is left is to find a decent way to partition the target segment so that they ticks are "natural" (not 0.34759, for instance) and reasonably equally spaced. I thought other plotting programs had dealt with this, but in fact, that doesn't seem to be the case: I'll have to do that myself.

Wednesday, March 5, 2008

Uniform probability does not apply to real life !

I've always been puzzled that, quite often, a package is totally silent for a long while (say a month or two), and suddenly, you get two or three bug reports the very same day, distant from any release or transition to testing. I've seen that mostly with libqt4-ruby and pmount. This seems to be rather general: it really looks like events of our lives don't even remotely follow uniform probabilities.

I've had a recent confirmation with ctioga, a project of my own. I just need to decide to release a new version to realize just afterwards that I've got many more features to add (not less than 20 significants commits since the release a week ago !)... Life is not linear ! (and I won't complain).

Wednesday, February 27, 2008

Today's dirty command-line trick: progress statistics for dd

Who has already been using dd for endless data transfer without really knowing what is happening ? That is rather annoying. Sure, when the target is a normal file, you can always use

watch ls -l target

But, that won't tell you the rate of transfer, and it won't work if the target is a special file (device, pipe, ...). Fortunately, dd accepts the USR1 signal to print out some small statistics... Well, combining that with the watch tricks gives this:

watch killall -USR1 dd

And there you go, dd is now regularly printing out statistics. Pretty neat, isn't it ?

Wednesday, February 20, 2008

pdfnup and page size

I use a combination of pdftk and pdfnup, from the pdfjam package to arrange (PDF) graphs produced by ctioga into an array for printing. However, I find that a simple

pdfnup --nup 3x3 concatenated_graphs.pdf

does not produce an A4 output (even with --paper a4paper), but a PDF who has the same size as individual graphs. Painful. It did take me long to realize it is a feature of pdfnup, who asks pdfTeX to have the paper size adjusted to that of the input when the layout is symmetric and no orientation has been provided. To disable that, and get a real A4 paper, specify the orientation:

pdfnup --orient portrait --nup 3x3 concatenated_graphs.pdf

Sunday, February 17, 2008

Virgin Megastore France doesn't like Iceweasel

I wanted to have a look at the French Virgin Megastore website, and I got the attached image. It says:

The version of your browser does not allow browsing this site under Linux. You must install Firefox.

Well, I don't want to know how they are detecting the "correctness" of the browser (after all, this is Iceweasel, so it is Firefox), or why they are so stupid as to forbid browsing if the "correct" navigator is not used, but, well, they've just lost a customer.

Wednesday, February 13, 2008

How to shut wine audio output

As I've mentioned before, I play to Morrowind (III) using Wine. Fine. Thanks to a nice guy on the AppDB Forum, I found out that what was causing Morrowind to segfault was simply that I had not set any audio device in my configuration... So I did with winecfg, and it worked, and I was quite delighted.

So far, nothing fantastic. It so happens that I hate to play any game with the game's music/sounds/voices, as I prefer to be quietly listening to music of my taste (I have delicate ears). As in any other game, you can switch them off in Morrowind, which is what I immediately did. However, it happens that some sounds - so far, only the sound corresponding to a shield blocking an attack (a graceful and delicate sound as you imagine) - go through even with all sound volumes are turned down to 0. It is annoying to the point I had to stop using the computer for listening music and falling back to my old CD player. Painful ! Or at least so it was until today, when I finally took my courage and found out how to fool wine into believing it is playing sounds when in fact it is not. First step, create a null ALSA output device, by adding the following to your .asoundrc:

# Null audio output
pcm.null {
  type null               # Null PCM
}

Then, you need to have wine use it (and only this one). For this, a quick look at the Useful Registry Keys showed that I had to add the following to my .wine/user.ref configuration file:

[Software\\Wine\\Alsa Driver] 1202930020
"DevicePCM1"="null"
"AutoScanCards"="N"
"DeviceCount"="1"

Just make sure wine is using ALSA output, and that's all ! Morrowind plays, without sound and does not segfault ! I'll be able to listen to my music again...

Note I'm unsure about the value 1202930020. The best is to add the key Software\Wine\Alsa Driver using regedit and then edit the configuration file -- or even do everything with regedit.

Friday, February 8, 2008

Microsoft advertises embedded windows under "Embedded Debian" !

[embedded-debian-microsoft.png] Few days ago, I was looking at my gmail mails. As usual, there was a couple of ads on the right hand side of the screen (they never really bothered me before). But that day, there was something quite different: an advertisement for Microsoft under the term "Embedded Debian" ! Well, I can understand that Microsoft wants to advertise for the keywords "Embedded Debian". After all, if they do provide good embedded OS services, that is only fair. But to do so with a title "Embedded Debian" does not really qualify as fair use of the Debian trademark !

The trouble is that this is something hard to prove, as it appears seldom and apparently randomly. When I google for the terms Embedded Debian, I come up around every second time with nearly the same ad, but taking to www.microsoftembedded-de2.com. This domain does not appear to be connected to Microsoft anyhow (see its whois entry). Some other people tried and never saw the ad, as I did when I looked from another computer (a Windows one, funnily). The www.windowsembeddedsolutions.com link which is depicted above did only show up in my gmail account so far. However, that domain is owned by Microsoft, so they can't deny this comes from them. Why, are we scaring them so much ??

Wednesday, February 6, 2008

Wine versus Vista for gaming

Another day starting well: apparently Wine is a better alternative than Vista for gaming (admittedly, this guy only tested four different games, but Wine was the clear winner). Great !

As for me, I finally got Morrowind working under Wine, which is one of the reasons why I haven't been that active for Debian recently.

Tuesday, February 5, 2008

gs saved the day again !

Some time ago, I was delighted at the power of Ghostscript. Well, it saved the day again, with an article that didn't want to get printed. Quite naively, I always thought that doing first pdf2ps (or pdftops, based on Xpdf, that often produces smaller and nicer postscript) and then ps2pdf was a good way to deal with unfriendly PDF files. But, in real, nothing is better than working without intermediates. The following produces a pretty neat PDF file:

gs -sOutputFile=output.pdf -sDEVICE=pdfwrite \
  -dCompatibilityLevel=1.4 input.pdf < /dev/null

As side benefits, as this command also embeds postscript fonts, the output looks better in xpdf, and it is decently smaller !

Friday, January 25, 2008

Creating and booting an ia32 debian system from an amd64 one

I've recently gone back to use wine to play "old" Windows games. Unfortunately, Morrowind, the one I'd like to play - really great one, if I daresay, is not working on my computer, though it should, according to its AppDB page. I tweaked wine's configuration, but no success so far. I decided it would be worth to try from within a real IA32 environment, just to check if that could be a bug linked to this. So, today's game is to create an IA32 debian system from my own, set it up and boot it.

First thing, create a i386 chroot using debootstrap:

debootstrap --arch=i386 sid /chroots http://ftp.fr.debian.org/debian

The target, here /chroots must be the root directory of a given device -- else booting won't work. Then, you must set up a proper /etc/fstab file, so it actually can mount things once you've decided to boot it.

Then, for fun, I've decided to cross-compile the kernel I would be using, so, after download/extracting recent kernel source, this is what I did. First, spawn the configuration tool:

make xconfig ARCH=i386
make -j2 ARCH=i386 

Then, I copied the kernel images using

cp arch/i386/boot/bzImage /chroots/boot/vmlinux
cp arch/i386/boot/compressed/vmlinux.bin /chroots/boot

The latter is important for the kexec kernel call. I also copied the kernel sources from the current system to the chroot, so as to be able to build kernel modules in the target system. Then, I did use the kexec utility to boot my new kernel:

telinit 1
kexec -l /chroots/boot/vmlinux.bin --append=root=0342
kexec -e

And there you go !! Then, you probably need to setup new users and also configure the network (try to copy from your current config).

So I did all this, to finally realize that it didn't work any better with a full ia32 system... Pity !

Thursday, January 24, 2008

A very annoying sound bug - and a workaround

Quite some time ago, I posted a bug report against ALSA because my sound would lock from time to time. No error message from any program using the sound, but they simply hang, and nothing is to be heard. I tracked the problem down to a blocking call to a semaphore operation, for all programs that were concerned. The thing was that I could not find a way to recover from this situation until the computer was rebooted, which, admittedly, is very painful. However, I found a way to do so today: you can actually kill semaphores by hand using ipcrm. If that happens, have a look in your /proc/sysvipc/sem file:

~ cat /proc/sysvipc/sem 
       key      semid perms      nsems   uid   gid  cuid  cgid      otime      ctime
   5678293     163840   660          1  1000    29  1000  1000 1201199302 1201198890

The only semaphore listed here is the one we're interested about. Kill it with the following command-line (probably only works as root):

~ ipcrm -S 5678293

And then, magic ! Sound works again !

Monday, January 21, 2008

The real limitation of Qt...

I've been posting here quite often that I like using this wonderful GUI library that is Qt. I've always found it really comfortable to work with. But it looks like I've finally hit a limitation:

[  5%] QT Wrapped File
/home/vincent/Prog/UltimateRipper/src/genericcombo.hh:26: Error: Template classes not supported by Q_OBJECT
make[2]: *** [moc_genericcombo.cxx] Error 1
make[1]: *** [CMakeFiles/ur.dir/all] Error 2
make: *** [all] Error 2

I knew that it is technically delicate to deal with that... I hope they had found a solution. Well, pity. After all, there must be a very good reason why they wrote so much code for QVariant, to provide an alternative to templates. Pity ! I'll have to go on with this class without specific signals/slots.

Tuesday, January 8, 2008

A bzr repository for my debian-related works

I'm always scripting quite a lot, and I always store them in SVN in my personal backed-up server. However, it is not very convenient for sharing, as it is not always on and completely locked anyway. So I thought I could rather use a bzr repository on people.debian.org. I did set it up yesterday. There probably will be several branches in the future, but there currently is only one:

bzr branch http://people.debian.org/~fourmond/bzr/scripts

It currently contains one script, rdebsums that runs debsums on one package and on all its dependencies. It is the answer to a wishlist bug I submitted long ago against debsums. Enjoy !

Saturday, January 5, 2008

Find all package from a repository that install a file somewhere

As I'm trying to provide a much cleaner way to wrap java programs into scripts for Debian, I need to know how many of the package maintained by the Debian Java Team install scripts in /usr/bin/. I first thought that the way to go was to use apt-file for doing so, running apt-file show on each package found in the repository. Bad idea: it takes, say, 10 seconds to run apt-file show on my machine. Mutliply that by around 600 binary packages, it takes some time.

So, I wrote a script based on the same idea (using Contents files, see apt-file(1)) that does the both the lookup of all binary packages produced by source trees present in the current directory and looking up a pattern in the Contents file. You can download it here. Typical uses:

  • find all binary packages generated from source tree in the current directory:
    find-packages
    
  • find all of them that install a file in /usr/bin:
    find-packages usr/bin ~/.apt-file/ftp.fr.debian.org_debian_dists_unstable_Contents-amd64.gz
    
    The file ~/.apt-file/ftp.fr.debian.org_..._Contents-amd64.gz or a similar one can be found in apt-file's cache.

Meanwhile, out of nearly 600 packages, there are only 61 binaries out of 35 packages. Java packages are mostly libraries, then.

Friday, January 4, 2008

Tioga and text sizes

Tioga is powerful, as I undoubtedly mentioned here already. But, so far, it had a dreadful drawback: it was not possible to know the (TeX) text size other than by guesswork. This has now changed: starting from revision 453, it can find out and provide the information. All you need to do is to give a 'measure' => 'name' argument to show_text, and you can get information about the text size using get_text_size('name'). I used this new feature in figures.rb for a small demonstration:

    def text_size
      t.stroke_rect(0,0,1,1)
      t.rescale(0.5)

      equation = '\int_{-\infty}^{\infty} \! e^{-x^{2}}\, \! dx = \sqrt{\pi}'
      text = "\\fbox{$\\displaystyle #{equation}$}"

      nb = 5
      nb.times do |i|
        scale = 0.5 + i * 0.2
        angle = i * 37
        x = (i+1)/(nb+1.0)
        y = x
        color = [1.0 - i * 0.2, i*0.2, 0]
        t.show_text('text' => text, 'color' => color, 'x' => x, 
                    'y' => x,
                    'alignment' => ALIGNED_AT_MIDHEIGHT,
                    'scale' => scale , 'measure' => "box#{i}", 
                    'angle' => angle )
        size = t.get_text_size("box#{i}")
        w = size['width']
        h = size['height']
        t.stroke_color = color
        t.stroke_rect(x - w/2, x - h/2, w, h)
      end
    end

This works really simply: Tioga uses a wrapper TeX function that displays the size of the text on pdflatex output. If Tioga detects that a size was requested, it fills in the information, gives it back to the program via get_text_size and runs pdflatex a second time use the information. For the first call, dummy values are given by get_text_size. It seems that the last showstopper of Tioga has finally fallen today !

Thursday, January 3, 2008

Team work...

I don't know how it feels for you, but that starts to look like team work:

a7xpg (0.11.dfsg1-3) unstable; urgency=low

  [ Barry deFreese ]
  * Add watch file

  [ Jon Dowland ]
  * Add Homepage: control field to source stanza

  [ Peter De Wachter ]
  * Don't abort if the audio device couldn't be opened. (Closes: #448786)
  * Fixed link command, patch from Arthur Loiret. (Closes: #458277)

  [ Miriam Ruiz ]
  * Added XS-DM-Upload-Allowed tag to control to allow uploads from Debian
    Maintainers.

  [ Vincent Fourmond ]
  * Added myself to Uploaders
  * Fixed Vcs* fields and remove stale Homepage fields

 -- Vincent Fourmond   Thu, 03 Jan 2008 14:14:15 +0100

The Debian Games Team is pretty dynamic, I'd say.

lighttpd + debarchiver + dput: very good combination for local archives

I've grown pretty much accustomed to cowbuilder. In fact, I nearly build all my packages this way. I seldom have lots of coding/testing to do on my packages, so I don't want to clutter my machine with loads of unneeded build-depends... Especially when it comes to java packages. And the thing is that the current version of batik does not build with versions 1.5 and 1.6 of Sun's Java: an earlier one is apparently necessary (I don't have time to dig into this yet). So, I need a cowbuilder with sun-j2sdk1.4. As the latter is not on public archives, cowbuilder will not find it and fail. Hence, the need for a private personal archive. I found the combination of lighttpd, debarchiver and dput very convenient to setup and keep a personal archive. It is the combination that needs the less configuration, and just works !

First, install lighttpd, dput and debarchiver. I used /var/local/debian as my local repository root, so I made sure the directory existed and that I had write access on it with my normal user. Then, configuration of debarchiver; you only need to modify two lines in /etc/debarchiver.conf:

$destdir = "/var/local/debian/dists";
$inputdir = "/var/local/debian/incoming";

Running debarchiver as a normal user once creates the directories, so you don't need to bother about that yourself. You probably should also modify the line containing @mailtos if you want dak-like email notices. I used the folllowing:

@mailtos = ('root@localhost');

Next step is to make dput aware of this local repository. Here is the relevant part of my $HOME/.dput.cf:

[local]
fqdn = localhost
incoming = /var/local/debian/incoming
method = local
run_dinstall = 0
post_upload_command = debarchiver -x

The -x is very important as is asks debarchiver to rebuild the package index, so your packages are available immediately. The last bit now is to make lighttpd serve the repository. I simply symlinked /var/local/debian into /var/www, and now I use that in my sources.list:

deb http://localhost/debian unstable main contrib non-free

And everything works perfectly well ! Very easy to install and configure.

Wednesday, January 2, 2008

(pre-)Introducing jardeps

Since I've joined the Debian Java Team, I've been working on a script to get as much information for packaging as we could get from jar files, such as their possible dependencies and so on. I've come up with a pretty neat tool, jardeps, based on jclassinfo, that can provide quite some information about java archives:

  • list classes/methods the archive provides
  • look for dependencies in other jars (still very rough, or way too slow)
  • and, what I've been working on recently, a way to spot differences in the interface/dependencies between two version of a package, a sort of debdiff for Java classes

I won't post the code yet, but I'll introduce it on the Java mailing lists as soon as jclassinfo makes it through the NEW queue (which it probably should have done today had I been more careful about copyright notices).