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

popcon-commits at lists.alioth.debian.org popcon-commits@lists.alioth.debian.org
Tue Jul 5 11:55:16 UTC 2005


Update of /cvsroot/popcon/popularity-contest/debian
In directory haydn:/tmp/cvs-serv22404/debian

Modified Files:
	changelog control cron.weekly 
Log Message:
   * Add support for reporting using http POST. (Closes: #239097)
   * New script /usr/share/popularity-contest/popcon-upload
   * New CGI /usr/share/doc/popularity-contest/popcon.cgi
   * Uploading using content-type text/plain, content-encoding x-gzip.
   * debian/cron.weekly:
     - do not run sendmail if it is not available.  This will make it
       possible to downgrade mail-transport-agent from Depend to
       Recommends if we move to HTTP.
     - try to run /usr/share/popularity-contest/popcon-upload if
       USEHTTP is enabled, disabled by default.
   * Code done by Bill Allombert.  Patch based on code from Ubuntu,
     though reimplemented in perl to avoid python dependency.  The
     ubuntu versions are included in the source package as
     popcon-submit-ubuntu.cgi and popcon-upload-ubuntu.
   * Added simple FAQ entry about the http POST feature.
   * Depend on ${misc:Depends} instead of debconf, to get the updated
     debconf dependency.
   * Added low priority debconf question asking if http should be used.
   * Added 30 second timeout in the http upload script.
   * Rewrite the participation template text, to only talk about
     submissions and not emails, to make it neutral to the submission
     method used.
   * TODO:
       + Improve the http debconf template text.
   * Rewrite popularity-contest to use dpkg-awk if dpkg-query is
     missing, to make it compatible with dpkg versions before 1.10.
     Drop versioned dependency on dpkg.  This make a backport to woody
     trivial.
   * Send compressed MIME emails when recommended package
     mime-construct is installed. (Closes: #149425)
   * Do not send email if http POST method was successfull.
   * Translations (Done by Christian Perrier)
     - Updated French from Christian Perrier

Index: changelog
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/changelog,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- changelog	4 Jul 2005 21:48:19 -0000	1.199
+++ changelog	5 Jul 2005 11:55:14 -0000	1.200
@@ -28,6 +28,9 @@
     missing, to make it compatible with dpkg versions before 1.10.
     Drop versioned dependency on dpkg.  This make a backport to woody
     trivial.
+  * Send compressed MIME emails when recommended package
+    mime-construct is installed. (Closes: #149425)
+  * Do not send email if http POST method was successfull.
   * Translations (Done by Christian Perrier)
     - Updated French from Christian Perrier
 

Index: control
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/control,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- control	4 Jul 2005 21:51:03 -0000	1.13
+++ control	5 Jul 2005 11:55:14 -0000	1.14
@@ -9,7 +9,7 @@
 Package: popularity-contest
 Architecture: all
 Depends: ${misc:Depends}, exim4 | mail-transport-agent, ${perl:Depends}
-Recommends: cron
+Recommends: cron, mime-construct
 Suggests: anacron
 Provides: popcon
 Description: Vote for your favourite packages automatically

Index: cron.weekly
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/debian/cron.weekly,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cron.weekly	4 Jul 2005 21:39:27 -0000	1.9
+++ cron.weekly	5 Jul 2005 11:55:14 -0000	1.10
@@ -47,29 +47,62 @@
 
 run_popcon > $POPCON
 
-# try to email the popularity contest data
-
-if [ -x "`which sendmail 2>/dev/null`" ]; then
-    (
-	if [ -n "$MAILFROM" ]; then
-		echo "From: <$MAILFROM>"
-		echo "Sender: <$MAILFROM>"
-	fi
-	echo "To: $MAILTO"
-	echo "Subject: popularity-contest submission"
-	echo
-	cat $POPCON
-    ) | do_sendmail
-else
-	logger -t popcon "unable to submit report using sendmail."
-fi
+SUBMITTED=
 
 # try to post the report through http POST
 if [ "$SUBMITURL" ] && [ "yes" = "$USEHTTP" ]; then
 	if setsid /usr/share/popularity-contest/popcon-upload \
 	    -u $SUBMITURL -f $POPCON 2>/dev/null ; then
-		:
+		SUBMITTED=yes
 	else
 		logger -t popcon "unable to submit report using http."
 	fi
+fi
+
+# try to email the popularity contest data
+
+if [ yes != "SUBMITTED" ] && [ -x "`which sendmail 2>/dev/null`" ]; then
+	# Sending compressed emails are disabled as the receiving end
+	# isn't implemented yet.
+	if false && [ -x "`which mime-construct 2>/dev/null`" ]; then
+        	# Make compresssed email
+		if [ -n "$MAILFROM" ]; then
+			gzip -9 < $POPCON | mime-construct \
+			    --type application/x-popcon-compressed \
+			    --encoding base64 --file - \
+			    --subject "popularity-contest submission" \
+			    --to "$MAILTO" \
+			    --header "From: <$MAILFROM>" \
+			    --header "Sender: <$MAILFROM>" \
+			    --output | do_sendmail
+		else
+			gzip -9 < $POPCON | mime-construct \
+			    --type application/x-popcon-compressed \
+			    --encoding base64 --file - \
+			    --subject "popularity-contest submission" \
+			    --to "$MAILTO" \
+			    --output | do_sendmail
+		fi
+	else
+            # Not able to make compressed email, send uncompressed
+	    (
+		if [ -n "$MAILFROM" ]; then
+		    	echo "From: <$MAILFROM>"
+			echo "Sender: <$MAILFROM>"
+		fi
+		echo "To: $MAILTO"
+		echo "Subject: popularity-contest submission"
+		echo "MIME-Version: 1.0"
+		echo "Content-Type: text/plain"
+		echo
+		cat $POPCON
+	    ) | do_sendmail
+	fi
+	SUBMITTED=yes
+else
+	logger -t popcon "unable to submit report using sendmail."
+fi
+
+if [ "yes" != "$SUBMITTED" ] ; then
+	logger -t popcon "unable to submit report."
 fi





More information about the Popcon-commits mailing list