Author: adsb
Date: 2009-03-04 14:24:44 +0000 (Wed, 04 Mar 2009)
New Revision: 1835
Modified:
trunk/conf.default.in
trunk/debian/changelog
trunk/debian/postinst
trunk/scripts/nmudiff.1
trunk/scripts/nmudiff.sh
Log:
Allow the specification of a particular DELAYED queue, rather
than including the "DELAYED/XX" placeholder. May be specified as
0 to remove mention of DELAYED. (Closes: #518126)
Modified: trunk/conf.default.in
===================================================================
--- trunk/conf.default.in 2009-03-04 11:03:46 UTC (rev 1834)
+++ trunk/conf.default.in 2009-03-04 14:24:44 UTC (rev 1835)
@@ -475,6 +475,11 @@
##### nmudiff
#
+# Number of days to indicate that an NMU upload has been delayed by
+# using the DELAYED upload queue. 0 indicates no delay.
+# Defaults to "XX" which adds a placeholder to the e-mail.
+# NMUDIFF_DELAY=3
+#
# Should we use mutt to edit and send the message or just a plain old
# editor?
# NMUDIFF_MUTT=yes
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2009-03-04 11:03:46 UTC (rev 1834)
+++ trunk/debian/changelog 2009-03-04 14:24:44 UTC (rev 1835)
@@ -18,6 +18,9 @@
+ Rework the arguments passed to mutt in order to avoid problems
attaching the diff with recent versions of mutt. Thanks, Adeodato
Simó. (Closes: #518127)
+ + Allow the specification of a particular DELAYED queue, rather
+ than including the "DELAYED/XX" placeholder. May be specified as
+ 0 to remove mention of DELAYED. (Closes: #518126)
* rc-alert: Modify the description of the "I" flag to reference the
squeeze-ignore tag rather than etch-ignore.
Modified: trunk/debian/postinst
===================================================================
--- trunk/debian/postinst 2009-03-04 11:03:46 UTC (rev 1834)
+++ trunk/debian/postinst 2009-03-04 14:24:44 UTC (rev 1835)
@@ -658,6 +658,13 @@
# URL to query
# DCONTROL_URL="http://qa.debian.org/cgi-bin/dcontrol"
+#### nmudiff option added in 2.10.47
+#
+# Number of days to indicate that an NMU upload has been delayed by
+# using the DELAYED upload queue. 0 indicates no delay.
+# Defaults to "XX" which adds a placeholder to the e-mail.
+# NMUDIFF_DELAY=3
+
EOF
fi
fi
Modified: trunk/scripts/nmudiff.1
===================================================================
--- trunk/scripts/nmudiff.1 2009-03-04 11:03:46 UTC (rev 1834)
+++ trunk/scripts/nmudiff.1 2009-03-04 14:24:44 UTC (rev 1835)
@@ -57,6 +57,16 @@
using the \fB\-\-from\fR option. The program will not work in this case
if an email address cannot be determined.
.TP
+\fB\-\-delay\fR \fIDELAY\fR
+Indicate in the generated mail that the NMU has been uploaded to the
+DELAYED queue, with a delay of \fIDELAY\fR days. The default value is
+\fIXX\fR which adds a placeholder to the e-mail. A value of 0 indicates
+that the upload has not been delayed. This can also be set using the
+devscripts configuration files; see below.
+.TP
+\fB\-\-no\-delay\fR, \fB\-\-nodelay\fR
+Equivalent to \fB\-\-delay 0\fR.
+.TP
\fB\-\-no\-conf\fR, \fB\-\-noconf\fR
Do not read any configuration files. This can only be used as the
first option given on the command-line.
@@ -73,6 +83,12 @@
file settings. Environment variable settings are ignored for this
purpose. The currently recognised variables are:
.TP
+.B NMUDIFF_DELAY
+If this is set to a number, e-mails generated by \fBnmudiff\fR will by
+default mention an upload to the DELAYED queue, delayed for the
+specified number of days. The value "0" indicates that the DELAYED
+queue has not been used.
+.TP
.B NMUDIFF_MUTT
Can be "yes" (default) or "no", and specifies whether to use
\fBmutt\fR to compose and send the message or not, as described
Modified: trunk/scripts/nmudiff.sh
===================================================================
--- trunk/scripts/nmudiff.sh 2009-03-04 11:03:46 UTC (rev 1834)
+++ trunk/scripts/nmudiff.sh 2009-03-04 14:24:44 UTC (rev 1835)
@@ -34,6 +34,11 @@
--no-mutt Mail the message directly, don't use mutt
--from=EMAIL Use EMAIL address for message to BTS; defaults to
value of DEBEMAIL or EMAIL
+ --delay=DELAY Indicate that the NMU has been uploaded to the
+ DELAYED queue, with a delay of DELAY days; defaults
+ to a placeholder value of "XX". If DELAY is 0 then
+ no reference is made to the DELAYED queue.
+ --no-delay Equivalent to \"--delay=0\"
--no-conf, --noconf
Don't read devscripts config files;
must be the first option given
@@ -54,10 +59,11 @@
}
# Boilerplate: set config variables
+DEFAULT_NMUDIFF_DELAY="XX"
DEFAULT_NMUDIFF_MUTT="yes"
DEFAULT_NMUDIFF_NEWREPORT="maybe"
DEFAULT_BTS_SENDMAIL_COMMAND="/usr/sbin/sendmail"
-VARS="NMUDIFF_MUTT NMUDIFF_NEWREPORT BTS_SENDMAIL_COMMAND"
+VARS="NMUDIFF_DELAY NMUDIFF_MUTT NMUDIFF_NEWREPORT BTS_SENDMAIL_COMMAND"
# Don't think it's worth including this stuff
# DEFAULT_DEVSCRIPTS_CHECK_DIRNAME_LEVEL=1
# DEFAULT_DEVSCRIPTS_CHECK_DIRNAME_REGEX='PACKAGE(-.*)?'
@@ -93,6 +99,14 @@
"") BTS_SENDMAIL_COMMAND=/usr/sbin/sendmail ;;
*) ;;
esac
+ if [ "$NMUDIFF_DELAY" = "XX" ]; then
+ # Fine
+ :
+ else
+ if ! [ "$NMUDIFF_DELAY" -ge 0 ] 2>/dev/null; then
+ NMUDIFF_DELAY=XX
+ fi
+ fi
case "$NMUDIFF_MUTT" in
yes|no) ;;
*) NMUDIFF_MUTT=yes ;;
@@ -130,6 +144,7 @@
# Removed: --long check-dirname-level:,check-dirname-regex: \
TEMP=$(getopt -s bash -o "h" \
--long sendmail:,from:,new,old,mutt,no-mutt,nomutt \
+ --long delay:,no-delay,nodelay \
--long no-conf,noconf \
--long help,version -n "$PROGNAME" -- "$@")
if [ $? != 0 ] ; then exit 1 ; fi
@@ -149,6 +164,21 @@
# ;;
# --check-dirname-regex)
# shift; CHECK_DIRNAME_REGEX="$1" ;;
+ --delay)
+ shift
+ if [ "$1" = "XX" ]; then
+ # Fine
+ NMUDIFF_DELAY="$1"
+ else
+ if ! [ "$1" -ge 0 ] 2>/dev/null; then
+ NMUDIFF_DELAY=XX
+ else
+ NMUDIFF_DELAY="$1"
+ fi
+ fi
+ ;;
+ --nodelay|--no-delay)
+ NMUDIFF_DELAY=0 ;;
--mutt)
NMUDIFF_MUTT=yes ;;
--nomutt|--no-mutt)
@@ -304,6 +334,22 @@
TMPNAM="$( tempfile )"
+if [ "$NMUDIFF_DELAY" = "XX" ]; then
+ DELAY_HEADER="
+[Replace XX with correct value]"
+fi
+
+if [ "$NMUDIFF_DELAY" = "0" ]; then
+ BODY="$(printf "%s\n%s\n" \
+"I've prepared an NMU for $SOURCE (versioned as $VERSION). The diff" \
+"is attached to this message.")"
+else
+ BODY="$(printf "%s\n%s\n%s\n" \
+"I've prepared an NMU for $SOURCE (versioned as $VERSION) and" \
+"uploaded it to DELAYED/$NMUDIFF_DELAY. Please free to tell me if I should" \
+"delay it longer.")"
+fi
+
if [ "$NMUDIFF_MUTT" = no ]; then
cat <<EOF > "$TMPNAM"
From: $FROM
@@ -315,12 +361,10 @@
X-NMUDIFF-Version: ###VERSION###
$TAGS
-
-[Replace XX with correct value]
+$DELAY_HEADER
Dear maintainer,
-I've prepared an NMU for $SOURCE (versioned as $VERSION) and uploaded it
-to DELAYED/XX. Please feel free to tell me if I should delay it longer.
+$BODY
Regards.
EOF
@@ -356,12 +400,10 @@
else # NMUDIFF_MUTT=yes
cat <<EOF > "$TMPNAM"
$TAGS
-
-[Replace XX with correct value]
+$DELAY_HEADER
Dear maintainer,
-I've prepared an NMU for $SOURCE (versioned as $VERSION) and uploaded it
-to DELAYED/XX. Please feel free to tell me if I should delay it longer.
+$BODY
Regards.
EOF
--
To unsubscribe, send mail to [email protected].