[Popcon-commits] cvs commit to popularity-contest/debian by pere

popcon-commits@lists.alioth.debian.org popcon-commits@lists.alioth.debian.org
Mon, 26 Jan 2004 00:51:34 +0100


Update of /cvsroot/popcon/popularity-contest/debian
In directory quantz:/tmp/cvs-serv17882/debian

Modified Files:
	changelog config cron.weekly postinst rules templates 
Log Message:
Remove the question asking if it is ok to edit MAILTO address,
and move the default values into /usr/share/popularity-contest.conf.


Index: changelog
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/changelog,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- changelog	25 Jan 2004 17:48:39 -0000	1.40
+++ changelog	25 Jan 2004 23:51:32 -0000	1.41
@@ -8,8 +8,9 @@
     - Drop the intro note, and show the explanation as part of the
       participate question. (Closes: #229573)
     - Update Norwegian Bokmål debconf translation.
-    - Lower the priority from high to low for the question
-      asking if it is ok to edit MAILTO address. (Closes: #229288, #229111)
+    - Remove the question asking if it is ok to edit MAILTO address,
+      and move the default values into
+      /usr/share/popularity-contest.conf. (Closes: #229288, #229111)
   * Bill Allombert
     - Update server-side scripts to current popcon.debian.org version.
 

Index: config
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/config,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- config	25 Jan 2004 11:54:12 -0000	1.5
+++ config	25 Jan 2004 23:51:32 -0000	1.6
@@ -16,10 +16,3 @@
 
 db_input medium popularity-contest/participate || [ $? -eq 30 ]
 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 low popularity-contest/update-mailto || [ $? -eq 30 ]
-    db_go || true
-fi

Index: cron.weekly
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/cron.weekly,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cron.weekly	29 Sep 2003 21:33:48 -0000	1.2
+++ cron.weekly	25 Jan 2004 23:51:32 -0000	1.3
@@ -11,6 +11,7 @@
 unset PARTICIPATE
 
 # get configuration information
+. /usr/share/popularity-contest/default.conf
 . /etc/popularity-contest.conf
 
 # don't run if MAILTO address is blank!

Index: postinst
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/postinst,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- postinst	25 Jan 2004 11:24:59 -0000	1.4
+++ postinst	25 Jan 2004 23:51:32 -0000	1.5
@@ -3,8 +3,6 @@
 # Load debconf variables
 . /usr/share/debconf/confmodule
 
-OFFICIAL_MAILTO="survey@popcon.debian.org"
-
 conffile=/etc/popularity-contest.conf
 
 set -e
@@ -14,9 +12,6 @@
     . $conffile
 fi
 
-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/  -//'''`
 fi
@@ -32,64 +27,19 @@
     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.
 		#
-		# To change this file, remove it and use:
+		# To change this file, use:
 		#        dpkg-reconfigure popularity-contest
 		#
 		# You can also edit it by hand, if you so choose.
-		
-		# MAILTO specifies the address to e-mail statistics to each week.
 		#
-		MAILTO="$MAILTO"
+		# See /usr/share/popularity-contest/default.conf for more info
+		# on the options.
 		
-		# MY_HOSTID is a secret number that the popularity-contest receiver
-		# uses to keep track of your submissions.  Whenever you send in a
-		# new entry, it overwrites the last one that had the same HOSTID.
-		#
-		# This key was generated automatically so you should normally just
-		# leave it alone.
-		#
 		MY_HOSTID="$MY_HOSTID"
-	
-		# MAILFROM is the forged sender email address you want to use in
-		# email submitted to the popularity-contest.  If this is commented
-		# out, no From: or Sender: lines will be added to the outgoing mail,
-		# and it will be your MTA's job to add them.  This is usually what
-		# you want.
-		#
-		# If your MTA is misconfigured or impossible to configure correctly,
-		# and it always generates invalid From: and/or Sender: lines, you
-		# can force different results by setting MAILFROM here.  This can
-		# cause problems with spam bouncers, so most people should leave it
-		# commented out.
-		#
-	EOF
-	if [ -z "$MAILFROM" ]; then
-		echo '#MAILFROM=root@nowhere.org' >> $conffile
-	else
-		echo "MAILFROM=$MAILFROM" >> $conffile
-	fi
-
-	
-	cat <<-EOF >> $conffile
-	
-		# PARTICIPATE can be one of "yes" or "no".
-		# If you don't want to participate in the contest, say "no"
-		# and we won't send messages.
-		#
-		# If this option is missing, the default is "no".
-		#
 		PARTICIPATE=$PARTICIPATE
 	EOF
 	# Make sure user nobody can read the file.
@@ -101,9 +51,20 @@
 	if [ ! -e $conffile ]; then
 	    generate_conffile
 	else
-            # Replace if the value changed, to avoid changing the
+	    # Replace only if the content changed, to avoid changing the
 	    # config file date when no change was done.
-	    if sed "s/^PARTICIPATE=.*$/PARTICIPATE=$PARTICIPATE/; s/^MAILTO=.*$/MAILTO=\"$MAILTO\"/" < $conffile > $conffile.new &&
+
+
+	    # Commenting out the obsolete addresses, to use the
+	    # default config from /usr/share/ on hosts where
+	    # the old default was unchanged
+
+	    if sed " \
+		s/^PARTICIPATE=.*$/PARTICIPATE=\"$PARTICIPATE\"/;   \
+		s/^\(MAILTO=\"erich-survey@debian.org\"\)$/#\1/;    \
+		s/^\(MAILTO=\"apenwarr-survey@debian.org\"\)$/#\1/; \
+		s/^\(MAILTO=\"survey@popcon.debian.org\"\)$/#\1/;   \
+		" < $conffile > $conffile.new &&
 		! cmp $conffile $conffile.new > /dev/null; then
 		mv $conffile.new $conffile
 		# Make sure user nobody can read the file.

Index: rules
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/rules,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rules	20 Oct 2003 11:59:39 -0000	1.4
+++ rules	25 Jan 2004 23:51:32 -0000	1.5
@@ -24,8 +24,10 @@
 	# Add here commands to install the package into debian/tmp.
 	install -d debian/tmp/usr/sbin/
 	install -d debian/tmp/etc/
+	install -d debian/tmp/usr/share/popularity-contest/
 	install popularity-contest debian/tmp/usr/sbin/
 	install popcon-largest-unused debian/tmp/usr/sbin/
+	install -m 644 default.conf debian/tmp/usr/share/popularity-contest/
 
 # Build architecture-independent files here.
 binary-indep: build install

Index: templates
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/templates,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- templates	25 Jan 2004 11:27:57 -0000	1.4
+++ templates	25 Jan 2004 23:51:32 -0000	1.5
@@ -19,10 +19,3 @@
  .
  (NOTE: e-mail servers add their own tracing information and your data
  won't be completely anonymous while in transit.)
-
-Template: popularity-contest/update-mailto
-Type: boolean
-Default: true
-_Description: Update mailto address to the current one?
- The mail address used to submit popularity-contest entries
- is obsolete.