So I have been getting used to madduck's
workflow
for topgit and debian packaging, and one thing that bugged me a bit
was all the steps required to to build. I tend to build quite a lot
when debugging, so I wrote up a quick and dirty script to
#!/bin/sh
set -x
if [ x$1 = x-k ]; then
keep=1
else
keep=0
fi
WORKROOT=/tmp
WORKDIR= mktemp -d $WORKROOT/tg-debuild-XXXX
# yes, this could be nicer
SOURCEPKG= dpkg-parsechangelog grep ^Source: sed 's/^Source:\s*//'
UPSTREAM= dpkg-parsechangelog grep ^Version: sed -e 's/^Version:\s*//' -e s/-[^-]*//
ORIG=$WORKDIR/$ SOURCEPKG _$ UPSTREAM .orig.tar.gz
pristine-tar checkout $ORIG
WORKTREE=$WORKDIR/$SOURCEPKG-$UPSTREAM
CDUP= git rev-parse --show-cdup
GDPATH=$PWD/$CDUP/.git
DEST=$PWD/$CDUP/../build-area
git archive --prefix=$WORKTREE/ --format=tar master tar xfP -
GIT_DIR=$GDPATH make -C $WORKTREE -f debian/rules tg-export
cd $WORKTREE && GIT_DIR=$GDPATH debuild
if [ $?==0 -a -d $DEST ]; then
cp $WORKDIR/*.deb $WORKDIR/*.dsc $WORKDIR/*.diff.gz $WORKDIR/*.changes $DEST
fi
if [ $keep = 0 ]; then
rm -fr $WORKDIR
fi
Git is becoming my main utility for Debian packaging, as I am using it to keep my work on packages I maintain alone or in a team by using git.debian.org facilities. I am not still using tools like TopGit to keep patches, by I also intend to do so in a near future.1. Changing into a directory that contains a repo and shows you on PS1 what branch you are standing on:
On .bashrc I have:
GITPS1='$(__git_ps1 ":%s ")'
export PS1="$ GREEN \w$ RS $ YELLOW $ GITPS1 $ RS \\$ "
But what I didn t want to lose was the code that was posted to paste.bin after in a comment someone pointed out that this trick was a bit annying if your home dir were also a git repo. This is one solution:
__maybe_git_ps1 ()
local BRANCH="$(__git_ps1 '%s')"
case "$BRANCH" in
master)
# silent
;;
'')
# not a git repo? -> silent
;;
*)
if [ -n "$1" ]; then
printf $1 $BRANCH
else
printf (%s) $BRANCH
fi
;;
esac
2. An alias I like to use on repos that are personal for quick tracking:
[alias]
Thanks damog for these tips!
log1 = log pretty=oneline abbrev-commit
The Debian Python Modules Team is discussing which DVCS to switch to from SVN. Ondrej Certik asked how to generate a list of commiters to the team s repository, so I looked at it and got this:
emilio@saturno:~/deb/python-modules$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
865 piotr
609 morph
598 kov
532 bzed
388 pox
302 arnau
253 certik
216 shlomme
212 malex
175 hertzog
140 nslater
130 kobold
123 nijel
121 kitterma
106 bernat
99 kibi
87 varun
83 stratus
81 nobse
81 netzwurm
78 azatoth
76 mca
73 dottedmag
70 jluebbe
68 zack
68 cgalisteo
61 speijnik
61 odd_bloke
60 rganesan
55 kumanna
52 werner
50 haas
48 mejo
45 ucko
43 pabs
42 stew
42 luciano
41 mithrandi
40 wardi
36 gudjon
35 jandd
34 smcv
34 brettp
32 jenner
31 davidvilla
31 aurel32
30 rousseau
30 mtaylor
28 thomasbl
26 lool
25 gaspa
25 ffm
24 adn
22 jmalonzo
21 santiago
21 appaji
18 goedson
17 toadstool
17 sto
17 awen
16 mlizaur
16 akumar
15 nacho
14 smr
14 hanska
13 tviehmann
13 norsetto
13 mbaldessari
12 stone
12 sharky
11 rainct
11 fabrizio
10 lash
9 rodrigogc
9 pcc
9 miriam
9 madduck
9 ftlerror
8 pere
8 crschmidt
7 ncommander
7 myon
7 abuss
6 jwilk
6 bdrung
6 atehwa
5 kcoyner
5 catlee
5 andyp
4 vt
4 ross
4 osrevolution
4 lamby
4 baby
3 sez
3 joss
3 geole
2 rustybear
2 edmonds
2 astraw
2 ana
1 twerner
1 tincho
1 pochu
1 danderson
As it s likely that the Python Applications Packaging Team will switch too to the same DVCS at the same time, here are the numbers for its repo:
emilio@saturno:~/deb/python-apps$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
401 nijel
288 piotr
235 gothicx
159 pochu
76 nslater
69 kumanna
68 rainct
66 gilir
63 certik
52 vdanjean
52 bzed
46 dottedmag
41 stani
39 varun
37 kitterma
36 morph
35 odd_bloke
29 pcc
29 gudjon
28 appaji
25 thomasbl
24 arnau
20 sc
20 andyp
18 jalet
15 gerardo
14 eike
14 ana
13 dfiloni
11 tklauser
10 ryanakca
10 nxvl
10 akumar
8 sez
8 baby
6 catlee
4 osrevolution
4 cody-somerville
2 mithrandi
2 cjsmo
1 nenolod
1 ffm
Here I m the 4th most committer
emilio@saturno:~/deb/pkg-gnome$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
5357 lool
2701 joss
1633 slomo
1164 kov
825 seb128
622 jordi
621 jdassen
574 manphiz
335 sjoerd
298 mlang
296 netsnipe
291 grm
255 ross
236 ari
203 pochu
198 ondrej
190 he
180 kilian
176 alanbach
170 ftlerror
148 nobse
112 marco
87 jak
84 samm
78 rfrancoise
75 oysteigi
73 jsogo
65 svena
65 otavio
55 duck
54 jcurbo
53 zorglub
53 rtp
49 wasabi
49 giskard
42 tagoh
42 kartikm
40 gpastore
34 brad
32 robtaylor
31 xaiki
30 stratus
30 daf
26 johannes
24 sander-m
21 kk
19 bubulle
16 arnau
15 dodji
12 mbanck
11 ruoso
11 fpeters
11 dedu
11 christine
10 cpm
7 ember
7 drew
7 debotux
6 tico
6 emil
6 bradsmith
5 robster
5 carlosliu
4 rotty
4 diegoe
3 biebl
2 thibaut
2 ejad
1 naoliv
1 huats
1 gilir
emilio@saturno:~/deb/pkg-gstreamer$ svn log egrep "^r[0-9]+ cut -f2 -d sed s/-guest// sort uniq -c sort -n -r
891 lool
840 slomo
99 pnormand
69 sjoerd
27 seb128
21 manphiz
8 he
7 aquette
4 elmarco
1 fabian
Conclusions:
I wanted to report a success story with
topgit which is a rather new patch queue
managment extension for git. If that sounds like
gibberish to you, this is probably not the blog entry you are looking
for.
Some time ago I decided to migrate the debian packaging of
bibutils to topgit. This is
not a very complicated package, with 7 quilt patches applied to
upstream source. Since I don't have any experience to go on, I decided
to follow Martin 'madduck' Krafft's suggestion
for workflow.
It all looks a bit complicated (madduck will be the first to agree),
but it forced me to think about which patches were intended to go
upstream and which were not. At the end of the conversion I had 4
patches that were cleanly based on upstream, and (perhaps most
importantly for lazy people like me), I could send them upstream with
tg mail. I did that, and a few days later, Chris Putnam sent me a
new upstream release incorporating all of those patches. Of course, now I have
to package this new upstream release :-).
The astute reader might complain that this is more about me developing
half-decent workflow, and Chris being a great guy, than about any
specific tool. That may be true, but one thing I have discovered
since I started using git is that tools that encourage good workflow
are very nice. Actually, before I started using git, I didn't even use
the word workflow. So I just wanted to give a public thank you to
pasky for writing topgit and to madduck for pushing it into debian,
and thinking about debian packaging with topgit.
Samba in unstable is 3.2.5 currently, while upstream published 3.2.6 a few days ago.
This is mostly because 3.2.6 has too many changes that make it unsuitable for lenny, which will have 3.2.5. As we want to keep the "update through unstable" path, we can't upload 3.2.6 to unstable.
Simultaneously, we are using experimental for 3.3.* releases. Upstream recently published 3.3.0-rc2 which I uploaded yesterday to experimental.
So, we don't have any easy way to make post-3.2.5 releases available to our users.
I briefly imagined using backports.org for this, but:
deb http://pkg-samba.alioth.debian.org/packages/ ./ deb-src http://pkg-samba.alioth.debian.org/packages/ ./The packages are signed with my own GPG key, which you need to add to "trusted" keys for APT" (be sure to read http://wiki.debian.org/SecureApt first). They are numbered the same way they would be if they were on backports.org. These packages are maintained in the Samba packaging team SVN. Please take this as a commitment to try providing up-to-date packages for lenny during its release cycle. Of course, the security support will be done on a best effort basis but should at least not be worse than upstream's (which is known to be good and very reactive). I hope that samba users will enjoy....and if some of you could join the team and help triaging bugs, that would be appreciated..:-)
Samba in unstable is 3.2.5 currently, while upstream published 3.2.6 a few days ago.
This is mostly because 3.2.6 has too many changes that make it unsuitable for lenny, which will have 3.2.5. As we want to keep the "update through unstable" path, we can't upload 3.2.6 to unstable.
Simultaneously, we are using experimental for 3.3.* releases. Upstream recently published 3.3.0-rc2 which I uploaded yesterday to experimental.
So, we don't have any easy way to make post-3.2.5 releases available to our users.
I briefly imagined using backports.org for this, but:
deb http://pkg-samba.alioth.debian.org/packages/ ./ deb-src http://pkg-samba.alioth.debian.org/packages/ ./The packages are signed with my own GPG key, which you need to add to "trusted" keys for APT" (be sure to read http://wiki.debian.org/SecureApt first). They are numbered the same way they would be if they were on backports.org. These packages are maintained in the Samba packaging team SVN. Please take this as a commitment to try providing up-to-date packages for lenny during its release cycle. Of course, the security support will be done on a best effort basis but should at least not be worse than upstream's (which is known to be good and very reactive). I hope that samba users will enjoy....and if some of you could join the team and help triaging bugs, that would be appreciated..:-)
Once again Debian is close to release. And once again we're trying to find ways to avoid doing so. Using a technique we've employed before; firmware.
It is sad to see how people complain about
how packaging Ruby gems is painful. It seems like it is the Java
packaging game all over again where any application ships its
dependencies in a lib/ directory (or in the case of Rails,
vendor/). Mac OS X applications seem to do some of the same thing
by shipping lots of libraries in their application bundle, which is
really just a directory with some magic files in it.
This is of course just like static linking, which we made away with
for most software many years ago, mostly due to the pain associated
with any kind of security updates.
Update: What I find sad is that people keep making the same mistakes
we made and corrected years ago, not that people are complaining
about those mistakes.
My home Asterisk configuration has been pretty static for a while. It works
well, and so I haven't had a need to mess around with it.
There's a couple of outstanding features I've wanted to implement for a
while though, and I've now got one of them out of the way.
All calls that come in from the local PSTN line, the Vonage ATA, and the SIP
connection to Engin, hit a menu, where the caller selects whether they want
to speak to Sarah or myself. The sole purpose of this is to determine what
to do with the call if no one answers (which voicemail box or cell phone to
send the call to). A convenient side-effect of this is that it defeats most
telemarketers.
Ages ago, I set
up caller ID announcement to my MythTV setup, so if we happened to be
watching TV or a recording when a call came in, it briefly popped up on the
TV.
Fortunately, we're not huge square-eyes, and spend more time goofing off on
our laptops, so I wanted a way to display notifications on our laptops when
calls came in as well.
I had this crazy design in my head of having a server process on my Asterisk
box, and then clients on our laptops could connect to it, and be informed of
new calls. Before I went on a coding frenzy, and did something with the
Observer pattern and more socket programming than I really wanted to, I
thought I'd check if this was solved problem. Turns out, it kind of is.
I found the Notify
application for Asterisk (which I've made a package
for Debian Etch), which blats a UDP message to particular host as part
of a dialplan. It's more intended to go in person-specific extensions, but
as the majority of calls go into the main menu and never come out before
hitting a person-specific extension, and I still wanted to know about them
for my own perverse pleasure, I added multiple calls to the Notify
application in the main menu dialplan.
The site for the application also mentioned some third-party clients for
Linux and MacOS, but I've been looking for an excuse to try and write
something that used Growl, so I wrote my own Python application, initially
on Linux, and then I essentially swapped out the pynotify code for
the equivalent Growl code, and it worked just as well on Sarah's Mac.
So it's not quite the solution that I had in mind, because it doesn't really
scale, but for our two-user home setup, it's adequate. I might still try
and write some middleware between a client for this application and an
infinite number of observers, but there's no urgency.
The dialplan for our main menu now looks something like this:
exten => s,1,Background(for) exten => s,n,AGI(mythtv-cid.agi) exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /icarus) exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /iapyx) exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds exten => s,n,Background(names/sarah) exten => s,n,Background(press-1) exten => s,n,Background(for) exten => s,n,Background(names/andrew) exten => s,n,Background(press-2) exten => s,n,WaitExtenA call comes in, hits the menu, and the caller ID info is displayed on MythTV (if something's being watched) and our two laptops (if they're awake). Unfortunately my Git-fu is atrocious, so I can't figure out how to link to a web-browseable repository that contains the source for my client, but if I figure that out, I'll update this with a link later. Update I managed to summon enough Git-fu to put the repository online. It's available at http://git.andrew.net.au/?p=asterisk-notify-client.git;a=summary Now I just have to use it properly.
A while back, I wrote about this GObject-based Object/Relational
mapper that I wrote, which is called 'GNoDbify'. It isn't complete yet,
but parts of the library work; I use it for a project that I'm supposed
to commercially support. For those who don't know what that is: an O/R
mapper builds objects out of database tuples; so I can run a 'lookup'
function on the object class and get one (or more) objects representing
data from the database, then perform some modifications on that object,
and store it back in the database; my O/R mapper does all the SQL
magic.
Last week, I've been working on another object that takes an array of
GNoDbify objects, and presents them using the GtkTreeModel interface,
for easy viewing in a GtkTreeView:
my @customers = Vpbs::Db::Customer->get_all();
my $model = GNoDbify::ListStore->new_from_array(@customers);
my $view = Gtk2::TreeView->new_with_model($model);
my $renderer = Gtk2::CellRendererText->new();
my $column = Gtk2::TreeViewColumn->new_with_attributes("Name", $renderer, "text", $model->get_column("name"));
$view->append_column($column);
And there you have it: a treeview showing all the names of all the
customers in the database. On the classical approach, one would have to
use DBI or some such to fetch data from the database, create a
GtkListStore or something similar, and then append the data one row at a
time to that. Of course that still happens here, in a manner of
speaking, but it all happens behind the scenes. It also means that in an
application which wants to show a load of data, I don't have to do the
same thing all the time.
The magic happens in the second line, and in the second-to-last line.
GNoDbify::ListStore->new_from_array is pretty much
self-explanatory, really. It takes an array of GNoDbify
objects, and returns a GNoDbify::ListStore.
The second-to-last line shows how to add a column to a GtkTreeView.
With GtkListStore and GtkTreeStore you basically define yourself what
column gets what number; however, with GNoDbify, that isn't as
easy (it depends on the implementation of the GNoDbify
subclass), so the ->get_column returns the number of a column as
represented by the model, and wants the name of the field that you want
the column of.
Everything else is really the same.
It won't stop here, though. The original plan for GNoDbify was that
it could detect changes in the database, and update the tree model
accordingly. Most of that has already been implemented in GNoDbify
(though not yet in the ListStore thing), but just needs some debugging.
The fun thing is, the above six lines of code would not have to change
at all for that.
Of course all this juicyness comes at a price. In order to generalize
this much, I had to do a lot of extra stuff; so there's some performance
loss. Especially in perl; most of GNoDbify is written in C, and
converting perl arrays to and from C arrays is a process that can only
be done by looping over the perl array (or the C array) and creating the
other side of the equation. Obviously, that's a costly approach,
performance-wise; an obvious optimization of the above example could be
to have a subroutine that returns Customer objects already in a
GtkTreeView in one API call. We'll see.
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.
There seems to be indeed a meme on the
various
use
of SSH. So far I ve not seem mine, so here it is !
If you use the -w option when connecting using SSH, and if you have the correct configuration, then two virtual network interfaces will be created on both the client and the server.
Using these interfaces with a bit of routing and resolving magic, you can establish a full connection tunneled through an SSH connection !
The best way to get me to read a blog entry you've made is to apologize about it in the next one ... So I've gone and clicked on the link to Amaya's previous entry. Getting a warning that I'm about to be presented with a page that may contain material only suitable for adults. What the hell, Amaya is an adult and so am I, so let's just confirm this. I was truly shocked to see her entry that indeed did contain the extremely dangerous word “love” in it (can't imagine what else may have triggered the filter.)
Together with Youtube's apparent tightening of their filtering (I'd not have noticed except that Illiad commented on it) it seems the Intarwebs are now being converted to a happy teletubby-land. So I'm forced append this disclaimer now: Attention please, the text you've just read may have contained strong words, opinions, sentences, punctuation characters and all kinds of dangerous information only suitable for inhabitants of a small planet somewhere in the vicinity of Betelgeuse.
Next.