[Popcon-commits] cvs commit to popularity-contest/debian by pere
popcon-commits@lists.alioth.debian.org
popcon-commits@lists.alioth.debian.org
Thu, 22 Jan 2004 00:29:43 +0100
Update of /cvsroot/popcon/popularity-contest/debian
In directory quantz:/tmp/cvs-serv13044/debian
Modified Files:
changelog config postinst templates
Log Message:
Ask if the submit address should be changed on upgrades and
reconfigures. This should activate the new address
survey@popcon.debian.org on old installations.
Index: changelog
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/changelog,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- changelog 21 Jan 2004 22:46:42 -0000 1.23
+++ changelog 21 Jan 2004 23:29:41 -0000 1.24
@@ -11,6 +11,9 @@
value is taken from the current config file, and only that
variable is modified if the user using debconf change the value.
- Collect and report the content of /etc/debian_version.
+ - Ask if the submit address should be changed on upgrades and
+ reconfigures. This should activate the new address
+ survey@popcon.debian.org on old installations.
* Bill Allombert
- control: change exim to exim4. (Closes: #228575)
Index: config
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/config,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -d -r1.1.1.2 -r1.2
--- config 7 Sep 2003 17:28:23 -0000 1.1.1.2
+++ config 21 Jan 2004 23:29:41 -0000 1.2
@@ -20,3 +20,9 @@
db_input medium popularity-contest/participate || true
db_go || true
+# Ask if the old addresses should be changed to the new address.
+if [ "$MAILTO" = "erich-survey@debian.org" -o \
+ "$MAILTO" = "apenwarr-survey@debian.org" ]; then
+ db_input high popularity-contest/update-mailto
+ db_go || true
+fi
Index: postinst
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/postinst,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- postinst 21 Jan 2004 21:06:31 -0000 1.2
+++ postinst 21 Jan 2004 23:29:41 -0000 1.3
@@ -3,6 +3,8 @@
# Load debconf variables
. /usr/share/debconf/confmodule
+OFFICIAL_MAILTO="survey@popcon.debian.org"
+
conffile=/etc/popularity-contest.conf
set -e
@@ -12,8 +14,8 @@
. $conffile
fi
-if [ -z "$MAILTO" -o "$MAILTO" = "erich-survey@debian.org" ]; then
- MAILTO="apenwarr-survey@debian.org"
+if [ -z "$MAILTO" ] ; then
+ MAILTO="$OFFICIAL_MAILTO"
fi
if [ -z "$MY_HOSTID" ]; then
MY_HOSTID=`dd if=/dev/urandom bs=1k count=1 2>/dev/null | md5sum|sed 's/ -//'''`
@@ -30,6 +32,14 @@
PARTICIPATE="no"
fi
+if [ "$MAILTO" = "erich-survey@debian.org" -o \
+ "$MAILTO" = "apenwarr-survey@debian.org" ]; then
+ db_get popularity-contest/update-mailto || true
+ if [ "true" = "$RET" ] ; then
+ MAILTO="$OFFICIAL_MAILTO"
+ fi
+fi
+
generate_conffile() {
cat <<-EOF >$conffile
# Config file for Debian's popularity-contest package.
@@ -91,7 +101,7 @@
else
# Replace if the value changed, to avoid changing the
# config file date when no change was done.
- if sed "s/^PARTICIPATE=.*$/PARTICIPATE=$PARTICIPATE/" < $conffile > $conffile.new &&
+ if sed "s/^PARTICIPATE=.*$/PARTICIPATE=$PARTICIPATE/; s/^MAILTO=.*$/MAILTO=\"$MAILTO\"/" < $conffile > $conffile.new &&
! cmp $conffile $conffile.new > /dev/null; then
mv $conffile.new $conffile
else
Index: templates
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/templates,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -d -r1.1.1.2 -r1.2
--- templates 7 Sep 2003 17:28:23 -0000 1.1.1.2
+++ templates 21 Jan 2004 23:29:41 -0000 1.2
@@ -24,3 +24,10 @@
_Description: Do you want to participate?
If you choose to participate, popularity-contest will run once every week
automatically, e-mailing statistics to the Debian developers.
+
+Template: popularity-contest/update-mailto
+Type: boolean
+Default: true
+_Description: Update mailto address to the current one?
+ The mail address used to submit popularity-contenst entries
+ is obsolete.