gpsd 2.39-3 in debian experimental

Since a few days a new revision of gpsd is available in Debian/experimental. If you're a gpsd user, please give it a try as it contains various changes to the debconf templates and the config script. Although I don't expect any problems, it is better to test it well. Also there're several updates of the template translations missing and I want to give the translators some more time before uploading the package to unstable.

The other important change in the package was to add a gpsd-dbg package which contains all debug symbols and python-dbg builds of the extensions. Hopefully it will help to debug all gpsd related issues, although until now I did not have a single bug report where they would have been necessary.

Finally my thanks go to Christian Perrier and Justin B Rye for reviewing and fixing all the descriptions and templates.

Posted
pidgin-blinklight replacement for other messengers

One of my favourite plugins for pidgin is pidgin-blinklight, which blinks my ThinkPad's ThinkLight upon the arrival of new messages. Pretty useful as it is not as annoying (especially for others around you) as playing weird sounds. Unfortunately such a plugin is not available for other messengers like psi - but you're able to specify your own sound player. So I came up with the following script, which is my default sound player in psi now.

#!/bin/bash

IBMLIGHT="/proc/acpi/ibm/light"

function light_is_on() {
    [ "on" = "`grep status ${IBMLIGHT} | awk '{print $2}'`" ]
    return $?
}

function light_off() {
    echo off > ${IBMLIGHT}
}

function light_on() {
    echo on > ${IBMLIGHT}
}

if light_is_on; then
    light_off
    sleep 0.2
    light_on
    sleep 0.1
    light_off
    sleep 0.2
    light_on
else
    light_on
    sleep 0.2
    light_off
fi

Hint: In case you want a blinking light and sound, just add something like exec /usr/bin/play $@ at the end of the script.

Posted
retrieving debconf translations from the bts

Downloading debconf translations from the bts and committing them to my packaging repository was always a task which pretty much annoyed me. Today I spent some time on writing a script which does this job for me. There is still much to improve - it is more like a prove of concept - but it works for me. With some love and probably a rewrite in Perl or Python it is a good candidate for devscripts probably.

#!/bin/bash

set -e
[ -d debian/po ] || exit 255
[ -r debian/control ] || exit 255

function get_ci_message() {
    echo "Updating debconf translation: ${2}"
    echo ""
    echo "Thanks: $(echo ${3} | sed 's, <[^<]*@[^>]*>.*,,')"
    echo "Closes: #${1}"
}

pkg_source=$(grep '^Source:' debian/control| awk '{print$2}')
for bug in $(bts select source:${pkg_source} tag:l10n tag:patch status:open); do
    #sanety check - stop if there is somethign left to commit.
    git status | grep -qE '^nothing.*to commit' || exit 255

    #cache bug files
    bts cache ${bug}

    # po files are gzip or bz2 compressed sometimes
    find ~/.devscripts_cache/bts/${bug} -type f -name '*.po.gz' -exec gunzip {} \;
    find ~/.devscripts_cache/bts/${bug} -type f -name '*.po.bz2' -exec bunzip2 {} \;

    #find the last .po file from the attachments
    pofile=$(find ~/.devscripts_cache/bts/${bug} -type f -name '*.po' |\
            sort | tail -1)
    if [ -z ${pofile} ]; then
        echo "Ignoring bug #${bug} - no po file found"
        continue
    fi

    # find the basename of the .po file, some translators use
    # packagename.xy.po, we try to work around that
    basename=$(basename ${pofile} | sed 's,.*\.\([a-z][a-z].po\),\1,')

    # sanety check if we have a filename like xy.po now
    if ! echo ${basename} | grep -qE '^[a-z][a-z].po$'; then
        echo "Ignoring bug #${bug} - ${basename} not a useful name"
        continue
    fi

    cp ${pofile} debian/po/${basename}

    #git add and commit it.
    git add debian/po/${basename}

    author=$(bts status ${bug} |\
        grep '^originator' |\
        awk -F '\t' '{print $2}')

    get_ci_message ${bug} ${basename} ${author} | git commit -F - --author="${author}"
    bts cleancache ${bug}
done

The git commit messages are prepared for usage with git-dch, which is my favourite way to write the Debian changelog.

Update: The script is using the originator information from the bug as author information for the commit now. Thanks to Santi for the comment! I could not test the changes yet, but I assume it will work well :)

Posted