Package: darcs
Version: 1.0.9-1
Severity: wishlist
Tags: upstream

Hello,

while this is for sure an upstream wishlist bug, I'm reporting it here
because it'll be very useful for darcs.d.o [1].

The Debian Common Lisp Team [2] would like to receive a mail every time
a new patch (or a patch bundle) is applied to one of its darcs
repositories ([3], point 3).

Searching on the darcs BTS gave only bug #304 [4], which is not exactly
the same issue I'm reporting.

Searching on the net was far more useful, since I found a patch by
Olivier Thauvin [5] which should allow such a feature in an easy way.
However, I could not find any "official" comment about Olivier's patch,
which seems to not have been applied in the stable nor unstable darcs
repositories.

What's available ATM is a shell script by Marco Baringer [6] (included
for archive purpose), which is already used for the BESE project [7].
While I ignore the original ideas behind this script, what's funny is
that its aim is exactly the same as Olivier Thauvin's patch [5].

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://darcs.debian.org
[2] http://pkg-common-lisp.alioth.debian.org
[3] 
http://lists.alioth.debian.org/pipermail/pkg-common-lisp-devel/2008-January/000000.html
[4] http://bugs.darcs.net/issue304
[5] http://thread.gmane.org/gmane.comp.version-control.darcs.devel/4049
[6] http://alioth.debian.org/~gismo/darcs-email-changelog.sh
[7] http://common-lisp.net/project/bese/

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-rc8-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages darcs depends on:
ii  libc6                 2.7-6              GNU C Library: Shared libraries
ii  libcurl3              7.17.1-1           Multi-protocol file transfer libra
ii  libgmp3c2             2:4.2.2+dfsg-1     Multiprecision arithmetic library
ii  libkrb53              1.6.dfsg.3~beta1-2 MIT Kerberos runtime libraries
ii  libncurses5           5.6+20080105-1     Shared libraries for terminal hand
ii  zlib1g                1:1.2.3.3.dfsg-11  compression library - runtime

Versions of packages darcs recommends:
ii  postfix [mail-transport-agent 2.4.6-4    High-performance mail transport ag

-- no debconf information

#!/bin/sh
#
# Copyright (C) 2008 Edward Marco Baringer
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in
#       the documentation and/or other materials provided with the
#       distribution.
#     * Neither the name of the Edward Marco Baringer nor the names of its
#       contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# adapted for darcs.debian.org by Luca Capello <[EMAIL PROTECTED]>


PROJECT=${PROJECT:?}
REPO_NAME=${REPO_NAME:?}

REPO=${REPO:-"/darcs/$PROJECT/$REPO_NAME"}
TO=${TO:-"[EMAIL PROTECTED]"}
CHANGELOG_NEW=${CHANGELOG_NEW:-"/darcs/$PROJECT/$REPO_NAME.ChangeLog.new"}
CHANGELOG_OLD=${CHANGELOG_OLD:-"/darcs/$PROJECT/$REPO_NAME.ChangeLog.old"}
DIFF=${DIFF:-"/darcs/$PROJECT/$REPO_NAME.ChangeLog.diff"}
DIST_NAME=${DIST_NAME:-"$REPO_NAME-`date -d yesterday +%Y%m%d`"}

cd $REPO

darcs changes -s > $CHANGELOG_NEW

if [ ! -x $CHANGELOG_OLD ]; then
    touch $CHANGELOG_OLD;
fi

if ! diff -u $CHANGELOG_OLD $CHANGELOG_NEW > ${DIFF}.tmp
then
  # Mail changes.
  cat ${DIFF}.tmp | grep "^+" | sed -e 's/^+++.*//' | sed -e 's/^+//' > $DIFF
#   echo "" >> $DIFF
#   echo "An updated tarball of $REPO_NAME's source can be downloaded here:" >> $DIFF
#   echo "http://common-lisp.net/project/$PROJECT/tarballs/${DIST_NAME}.tar.gz"; >> $DIFF
  echo "" >> $DIFF
  echo "Darcsweb URL:" >> $DIFF
  echo "http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=$PROJECT/$REPO_NAME;a=summary"; >> $DIFF
  mail -s "New patches to $REPO_NAME: `date +%Y%m%d-%H%M%S`" $TO < $DIFF

  # Create tarball.
#   darcs dist --dist-name $DIST_NAME > /dev/null
#   mv ${DIST_NAME}.tar.gz /project/$PROJECT/public_html/tarballs/
#   ln -sf /project/$PROJECT/public_html/tarballs/${DIST_NAME}.tar.gz \
#          /project/$PROJECT/public_html/tarballs/$REPO_NAME-latest.tar.gz

  # Touch ChangeLog.
  touch $CHANGELOG_NEW
fi

rm ${DIFF}.tmp
cp -f $CHANGELOG_NEW $CHANGELOG_OLD

Attachment: pgpak5fmujH2T.pgp
Description: PGP signature

Reply via email to