coren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67884


Change subject: Tweaks to the packaging
......................................................................

Tweaks to the packaging

- Added license info (ISC)
- Added license to code
- change 'tools' to 'misctools'

Change-Id: I42f06066ecea991097e1e4cda791bfd5727ea396
---
M debian/control
M debian/copyright
A jobutils/bin/job
M jobutils/bin/jstop
M jobutils/bin/jsub
M tools/become
M tools/toolwatcher
7 files changed, 146 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/84/67884/1

diff --git a/debian/control b/debian/control
index fbe1527..7566c6a 100644
--- a/debian/control
+++ b/debian/control
@@ -1,23 +1,25 @@
 Source: toollabs
 Section: utils
 Priority: extra
-Maintainer: Petr Bena <[email protected]>
+Maintainer: Marc-André Pelletier <[email protected]>,
 Uploaders: Marc-André Pelletier <[email protected]>,
- Carl Fürstenberg <[email protected]>
+ Carl Fürstenberg <[email protected]>,
+  Petr Bena <[email protected]>
 Build-Depends: debhelper (>= 8.0.0)
 Standards-Version: 3.9.3
 #Vcs-Git: git://git.debian.org/collab-maint/toollabs.git
 #Vcs-Browser: http://git.debian.org/?p=collab-maint/toollabs.git;a=summary
 
-Package: tools
+Package: misctools
 Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Various tools
- Tools used on toollabs
+Description: Miscelaneous Labs-specific tools
+ Miscelaneous Labs-specific Tools used on Tool Labs
 
 Package: jobutils
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, gridengine-client, 
libstring-shellquote-perl
 Description: Set of utilities to use on wikimedia bots and tools cluster
- This package will install jstart (jsub) and jstop, which can be used with GE
+ 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 ee58f53..8679f69 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,8 +2,8 @@
 Upstream-Name: toollabs
 
 Files: *
-Copyright: 
-License:
+Copyright: 2013 Marc-André Pelletier <[email protected]>
+License: IRC
 
 Files: debian/*
 Copyright: 2013 Carl Fürstenberg <[email protected]>
@@ -25,3 +25,16 @@
  .
  On Debian systems, the complete text of the GNU General
  Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+License: ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/jobutils/bin/job b/jobutils/bin/job
new file mode 100755
index 0000000..f8e697e
--- /dev/null
+++ b/jobutils/bin/job
@@ -0,0 +1,62 @@
+#! /usr/bin/perl
+#
+# Copyright © 2013 Marc-André Pelletier <[email protected]>
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+my $mode;
+$mode = shift  if $#ARGV>0 and $ARGV[0] eq '-v';
+$mode = shift  if $#ARGV>0 and $ARGV[0] eq '-q';
+
+if($#ARGV != 0) {
+  print STDERR <<END
+usage: $0 <jobname>       outputs the job number
+       $0 -v <jobname>    outputs verbose (human readable) information
+       $0 -q <jobname>    quietly checks for the job status
+
+If there are multiple jobs with the same name, it is not specified which one
+will have its information returned (though running jobs take precedence)
+
+Returns 0 if no job by that name is present, 1 if it is currently running or
+suspended, and 2 if the job is queued but not running.
+
+END
+  ;
+  exit 0;
+}
+
+my $name = shift;
+
+my $jnum, $jname, $jstate, $jstart;
+
+open XML, "/usr/bin/qstat -xml|" or die "qstat: $!";
+while(<XML>) {
+  $jnum = $1 if m/<JB_job_number>(.*)<\/JB_job_number>/;
+  $jname = $1 if m/<JB_name>(.*)<\/JB_name>/;
+  $jstate = $1 if m/<state>(.*)<\/state>/;
+  $jstart = $1 if m/<JAT_start_time>(.*)<\/JAT_start_time>/;
+  if(m/<\/job_list>/ and defined $jnum) {
+    next unless $jname eq $name;
+    my $run = ($jstate =~ m/[rs]/);
+    if($mode eq '-v') {
+      print "Job '$name' has been running since $jstart as id $jnum\n" if $run;
+      print "Job '$name' is pending as id $jnum\n" unless $run;
+    } else {
+      print "$jnum\n" unless $mode eq '-q';
+    }
+    exit ($run? 1: 2);
+  }
+}
+print "No job '$name' is currently queued or running.\n" if $mode eq '-v';
+exit 0;
diff --git a/jobutils/bin/jstop b/jobutils/bin/jstop
index f0c5305..9847a4a 100755
--- a/jobutils/bin/jstop
+++ b/jobutils/bin/jstop
@@ -1,4 +1,19 @@
 #! /bin/bash
+#
+# Copyright © 2013 Marc-André Pelletier <[email protected]>
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
 
 id=$(/usr/local/bin/job "$1")
 if [ $? != 0 ]; then
diff --git a/jobutils/bin/jsub b/jobutils/bin/jsub
index f689052..7d675bb 100755
--- a/jobutils/bin/jsub
+++ b/jobutils/bin/jsub
@@ -1,4 +1,19 @@
 #!/usr/bin/perl -w
+#
+# Copyright © 2013 Marc-André Pelletier <[email protected]>
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
 
 use strict;
 use warnings;
diff --git a/tools/become b/tools/become
index eab5657..fd0e2ab 100755
--- a/tools/become
+++ b/tools/become
@@ -1,5 +1,19 @@
 #! /bin/bash
-
+#
+# Copyright © 2013 Marc-André Pelletier <[email protected]>
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
 
 if [ $# -lt 1 ]; then
   echo "usage: $(basename $0) <toolname> [command [args...]]" >&2
diff --git a/tools/toolwatcher b/tools/toolwatcher
index 4768fb9..5ce209b 100755
--- a/tools/toolwatcher
+++ b/tools/toolwatcher
@@ -1,4 +1,19 @@
 #! /bin/bash
+#
+# Copyright © 2013 Marc-André Pelletier <[email protected]>
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
 
 export HOME=/root
 while true;do

-- 
To view, visit https://gerrit.wikimedia.org/r/67884
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42f06066ecea991097e1e4cda791bfd5727ea396
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: coren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to