hipl-core team mailing list archive
-
hipl-core team
-
Mailing list archive
-
Message #00130
Re: [Branch ~hipl-core/hipl/trunk] Rev 4917: Add the mailing script for commit notification.
On Thu, Aug 26, 2010 at 02:16:23PM +0000, noreply@xxxxxxxxxxxxx wrote:
>
> --- tools/mailer.sh 1970-01-01 00:00:00 +0000
> +++ tools/mailer.sh 2010-08-26 14:12:39 +0000
> @@ -0,0 +1,62 @@
> +#!/bin/sh
> +#
> +# Mailer script that notifies about commits to a BZR repo
.
> +# path to the file containing the last processed revision
> +LASTREV=/tmp/mailer_lastrev.txt
> +# buffer used to build the body of the e-mail
> +MAILBUF=/tmp/mailer_buffer.txt
This is bad design, /tmp gets deleted upon reboot. Keep the
information in a user-specific tmpfile, i.e. ~/tmp/.
Also, writing temporary files with predictable names in globally-writable
locations upons you up to all manners of race conditions and security
holes.
> +# from now on, working in the BZR repo
> +cd $REPO
You should fail here (and in other places) in case of error.
> + # create the body of the e-mail
> + > $MAILBUF
> + bzr log -r $rev | tail -n +7 >> $MAILBUF
The first line is superfluous, just redirect 'bzr log' directly.
Diego
References