[Collab-qa-commits] r1430 - ddpo-by-mail

Raphael Geissert atomo64-guest at alioth.debian.org
Sun Apr 19 00:46:54 UTC 2009


Author: atomo64-guest
Date: 2009-04-19 00:46:54 +0000 (Sun, 19 Apr 2009)
New Revision: 1430

Modified:
   ddpo-by-mail/ddpo-config.rb
   ddpo-by-mail/reminder-mail.rb
Log:
Avoid hard-coding the name and email of the person running the script


Modified: ddpo-by-mail/ddpo-config.rb
===================================================================
--- ddpo-by-mail/ddpo-config.rb	2009-04-19 00:24:40 UTC (rev 1429)
+++ ddpo-by-mail/ddpo-config.rb	2009-04-19 00:46:54 UTC (rev 1430)
@@ -1,3 +1,18 @@
+# "Owner" of this instance of ddpo-by-mail:
+if ENV['DEBFULLNAME']
+  OWNER = ENV['DEBFULLNAME']
+else
+  OWNER = `getent passwd $(id -un) | cut -d: -f5`
+end
+
+if ENV['DEBEMAIL']
+  OWNER_EMAIL = ENV['DEBEMAIL']
+else
+  require 'etc'
+  require 'socket'
+  OWNER_EMAIL = Etc.getlogin+'@'+Socket.gethostname
+end
+
 # Globally excluded packages
 EXC_PKGS = [
 'hurd', # only exist on hurd-i386, which isn't a testing arch, so that's OK

Modified: ddpo-by-mail/reminder-mail.rb
===================================================================
--- ddpo-by-mail/reminder-mail.rb	2009-04-19 00:24:40 UTC (rev 1429)
+++ ddpo-by-mail/reminder-mail.rb	2009-04-19 00:46:54 UTC (rev 1430)
@@ -145,7 +145,7 @@
     name = maintainers_name[email]
   end
   gtext =<<-EOF
-From: DDPOMail robot <lucas-ddpomail at debian.org>
+From: DDPOMail robot <#{OWNER_EMAIL}>
 To: "#{name}" <#{email}>
 X-Debian: ddpomail
   EOF
@@ -291,7 +291,7 @@
 Don't hesitate to reply to this mail if you have questions. The wiki
 page will be updated with useful information.
 -- 
-DDPOMail, run by Lucas Nussbaum
+DDPOMail, run by #{OWNER}
     EOF
   
   File::open("mail_#{email}.txt", 'w') do |f|




More information about the Collab-qa-commits mailing list