[MediaWiki-commits] [Gerrit] labs/toollabs[ubuntu/precise]: Package jmail

2017-02-27 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/340276 )

Change subject: Package jmail
..


Package jmail

Bug: T158722
Change-Id: I2a2a86ecf1f0129374733f9222decf241d13e708
---
M configure.ac
M debian/changelog
M debian/control
M debian/copyright
M debian/jobutils.install
M debian/jobutils.manpages
M jobutils/bin/Makefile.am
A jobutils/bin/jmail
M jobutils/man/Makefile.am
A jobutils/man/jmail.1.in
M tox.ini
11 files changed, 124 insertions(+), 7 deletions(-)

Approvals:
  Tim Landscheidt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/configure.ac b/configure.ac
index 5a3b7d5..bc7795b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@
  jobutils/Makefile
  jobutils/bin/Makefile
  jobutils/man/Makefile
+ jobutils/man/jmail.1
  jobutils/man/job.1
  jobutils/man/jstop.1
  jobutils/man/jsub.1
diff --git a/debian/changelog b/debian/changelog
index cd131c6..bbb1283 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+toollabs (1.20~precise+1~dev) precise; urgency=medium
+
+  * Package jmail
+
+ -- Tim Landscheidt   Tue, 28 Feb 2017 03:25:32 +
+
 toollabs (1.19~precise+1) precise; urgency=medium
 
   * Remove toolwatcher
diff --git a/debian/control b/debian/control
index fa8b889..a99e382 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,8 @@
 Package: jobutils
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends},
- gridengine-client, libipc-run-perl, libstring-shellquote-perl, python
+ gridengine-client, libipc-run-perl, libstring-shellquote-perl,
+ python, python3
 Description: Set of utilities to use on wikimedia bots and tools cluster
  This package will install jstart (jsub) and jstop, the Tool Labs (more)
  user-friendly wrappers to submit jobs to the gridengine
diff --git a/debian/copyright b/debian/copyright
index f3d9372..f545288 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,6 +5,10 @@
 Copyright: 2013 Marc-André Pelletier 
 License: ISC
 
+Files: jobutils/bin/jmail jobutils/man/jmail.1.in
+Copyright: Copyright 2017 Tim Landscheidt 
+License: GPL-3.0+
+
 Files: debian/*
 Copyright: 2013 Carl Fürstenberg 
 License: GPL-3.0+
diff --git a/debian/jobutils.install b/debian/jobutils.install
index 3b8bf2f..956f91f 100644
--- a/debian/jobutils.install
+++ b/debian/jobutils.install
@@ -1,3 +1,4 @@
+usr/bin/jmail
 usr/bin/job
 usr/bin/jstart
 usr/bin/jstop
diff --git a/debian/jobutils.manpages b/debian/jobutils.manpages
index 92a5a84..c6a457c 100644
--- a/debian/jobutils.manpages
+++ b/debian/jobutils.manpages
@@ -1,3 +1,4 @@
+debian/tmp/usr/share/man/man1/jmail.1
 debian/tmp/usr/share/man/man1/job.1
 debian/tmp/usr/share/man/man1/jstop.1
 debian/tmp/usr/share/man/man1/jsub.1
diff --git a/jobutils/bin/Makefile.am b/jobutils/bin/Makefile.am
index 764fc98..7312c92 100644
--- a/jobutils/bin/Makefile.am
+++ b/jobutils/bin/Makefile.am
@@ -1,4 +1,4 @@
-bin_SCRIPTS = job jstop jsub
+bin_SCRIPTS = jmail job jstop jsub
 
 install-exec-hook:
cd $(DESTDIR)$(bindir) && \
diff --git a/jobutils/bin/jmail b/jobutils/bin/jmail
new file mode 100755
index 000..d996f68
--- /dev/null
+++ b/jobutils/bin/jmail
@@ -0,0 +1,61 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2017  Tim Landscheidt
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+import os
+import pwd
+import shutil
+import subprocess
+import sys
+import tempfile
+
+# Both temporary files need to be created in the tool's home directory
+# on NFS so they can be accessed from any grid host.
+home_directory = pwd.getpwuid(os.getuid()).pw_dir
+with tempfile.NamedTemporaryFile(mode='w+',
+ suffix='.in',
+ prefix='jmail-',
+ dir=home_directory) as input, \
+ tempfile.NamedTemporaryFile(mode='w+',
+ suffix='.out',
+ prefix='jmail-',
+ dir=home_directory) as output:
+# Determine the full path of the program to execute.
+program = shutil.which(sys.argv[1])
+if 

[MediaWiki-commits] [Gerrit] labs/toollabs[ubuntu/precise]: Package jmail

2017-02-27 Thread Tim Landscheidt (Code Review)
Tim Landscheidt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340276 )

Change subject: Package jmail
..

Package jmail

Bug: T158722
Change-Id: I2a2a86ecf1f0129374733f9222decf241d13e708
---
M configure.ac
M debian/changelog
M debian/control
M debian/copyright
M debian/jobutils.install
M debian/jobutils.manpages
M jobutils/bin/Makefile.am
A jobutils/bin/jmail
M jobutils/man/Makefile.am
A jobutils/man/jmail.1.in
M tox.ini
11 files changed, 124 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/76/340276/1

diff --git a/configure.ac b/configure.ac
index 5a3b7d5..bc7795b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@
  jobutils/Makefile
  jobutils/bin/Makefile
  jobutils/man/Makefile
+ jobutils/man/jmail.1
  jobutils/man/job.1
  jobutils/man/jstop.1
  jobutils/man/jsub.1
diff --git a/debian/changelog b/debian/changelog
index cd131c6..bbb1283 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+toollabs (1.20~precise+1~dev) precise; urgency=medium
+
+  * Package jmail
+
+ -- Tim Landscheidt   Tue, 28 Feb 2017 03:25:32 +
+
 toollabs (1.19~precise+1) precise; urgency=medium
 
   * Remove toolwatcher
diff --git a/debian/control b/debian/control
index fa8b889..a99e382 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,8 @@
 Package: jobutils
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends},
- gridengine-client, libipc-run-perl, libstring-shellquote-perl, python
+ gridengine-client, libipc-run-perl, libstring-shellquote-perl,
+ python, python3
 Description: Set of utilities to use on wikimedia bots and tools cluster
  This package will install jstart (jsub) and jstop, the Tool Labs (more)
  user-friendly wrappers to submit jobs to the gridengine
diff --git a/debian/copyright b/debian/copyright
index f3d9372..f545288 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,6 +5,10 @@
 Copyright: 2013 Marc-André Pelletier 
 License: ISC
 
+Files: jobutils/bin/jmail jobutils/man/jmail.1.in
+Copyright: Copyright 2017 Tim Landscheidt 
+License: GPL-3.0+
+
 Files: debian/*
 Copyright: 2013 Carl Fürstenberg 
 License: GPL-3.0+
diff --git a/debian/jobutils.install b/debian/jobutils.install
index 3b8bf2f..956f91f 100644
--- a/debian/jobutils.install
+++ b/debian/jobutils.install
@@ -1,3 +1,4 @@
+usr/bin/jmail
 usr/bin/job
 usr/bin/jstart
 usr/bin/jstop
diff --git a/debian/jobutils.manpages b/debian/jobutils.manpages
index 92a5a84..c6a457c 100644
--- a/debian/jobutils.manpages
+++ b/debian/jobutils.manpages
@@ -1,3 +1,4 @@
+debian/tmp/usr/share/man/man1/jmail.1
 debian/tmp/usr/share/man/man1/job.1
 debian/tmp/usr/share/man/man1/jstop.1
 debian/tmp/usr/share/man/man1/jsub.1
diff --git a/jobutils/bin/Makefile.am b/jobutils/bin/Makefile.am
index 764fc98..7312c92 100644
--- a/jobutils/bin/Makefile.am
+++ b/jobutils/bin/Makefile.am
@@ -1,4 +1,4 @@
-bin_SCRIPTS = job jstop jsub
+bin_SCRIPTS = jmail job jstop jsub
 
 install-exec-hook:
cd $(DESTDIR)$(bindir) && \
diff --git a/jobutils/bin/jmail b/jobutils/bin/jmail
new file mode 100755
index 000..d996f68
--- /dev/null
+++ b/jobutils/bin/jmail
@@ -0,0 +1,61 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2017  Tim Landscheidt
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+import os
+import pwd
+import shutil
+import subprocess
+import sys
+import tempfile
+
+# Both temporary files need to be created in the tool's home directory
+# on NFS so they can be accessed from any grid host.
+home_directory = pwd.getpwuid(os.getuid()).pw_dir
+with tempfile.NamedTemporaryFile(mode='w+',
+ suffix='.in',
+ prefix='jmail-',
+ dir=home_directory) as input, \
+ tempfile.NamedTemporaryFile(mode='w+',
+ suffix='.out',
+ prefix='jmail-',
+ dir=home_directory) as output:
+# Determine the full path of the program to execute.
+program = shutil.which(sys.argv[1])
+if