[darcs-users] cron job to make daily darcs dist tarballs

Issac Trotts ijtrotts at ucdavis.edu
Tue May 25 07:45:51 UTC 2004


Hi list,

Here is a little script that others might find useful.
I put it in /etc/cron.daily/conexus_tarball (conexus 
being the name of the project I'm working on).  Its job
is to create a new tarball each day and put it up on the local
web server.

Issac


#!/bin/sh
                                                                                
# Please edit these variables as needed.
#
author=ijtrotts
author_email=ijtrotts at ucdavis.edu
program=conexus
                                                                                
# Create the distribution tarball.
#
name=$program-`date +"%D"|sed 's#/#-#g'`
cd /home/$author/$program
# darcs might change the name slightly, so I'll use the name it gives me.
tarname=`darcs dist -d $name 2>&1|sed 's/.* as //'`
name=`echo $tarname|sed 's/\.tar\.gz$//'`
                                                                                
# If it compiles, then put the tarball in a public place.
# If not, mail the author about the problem.
#
mv $name.tar.gz /tmp
cd /tmp
tar xzvf $name.tar.gz
cd $name
if make ; then
    cd ..
    dest=/var/www/$program/tarballs
    if ! [ -d $dest ] ; then
        mkdir -p $dest
    fi
    mv $name.tar.gz $dest
else
    echo "
This message is from the script /etc/cron.daily/$0.
Compilation of the latest version of $program failed, so I am not
putting up a tarball today." | \
    mail $author_email -s '$0 failed.'
    echo '$0: Tarball sanity check failed.  Bailing out.' 1>&2
fi






More information about the darcs-users mailing list