coren has submitted this change and it was merged.

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


Tweaks to the packaging

- Added license info (ISC)
- Added license to code
- change 'tools' to 'misctools'
- added missing job(1) command

Change-Id: I42f06066ecea991097e1e4cda791bfd5727ea396
---
M debian/changelog
M debian/control
M debian/copyright
A jobutils/bin/job
M jobutils/bin/jstop
M jobutils/bin/jsub
M tools/become
M tools/toolwatcher
8 files changed, 159 insertions(+), 15 deletions(-)

Approvals:
  coren: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
index 324817b..50a2849 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+toollabs (1.0.1) unstable; urgency=low
+
+  * Added copyright information
+  * Minor tweaks to control files
+  * Added missing job(1) command
+
+ -- Marc-André Pelletier <[email protected]>  Mon, 10 Jun 2013 17:12:45 
-0400
+
 toollabs (1.0) unstable; urgency=low
 
   * Initial Release.
diff --git a/debian/control b/debian/control
index fbe1527..ab22176 100644
--- a/debian/control
+++ b/debian/control
@@ -1,23 +1,25 @@
 Source: toollabs
 Section: utils
 Priority: extra
-Maintainer: Petr Bena <[email protected]>
-Uploaders: Marc-André Pelletier <[email protected]>,
- Carl Fürstenberg <[email protected]>
+Maintainer: Marc-André Pelletier <[email protected]>,
+Uploaders: Marc-André Pelletier <[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
+Vcs-Git: https://gerrit.wikimedia.org/r/labs/toollabs
+Vcs-Browser: https://git.wikimedia.org/summary/labs%2Ftoollabs
 
-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..f3d9372 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: ISC
 
 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..fb7fc95 100755
--- a/jobutils/bin/jstop
+++ b/jobutils/bin/jstop
@@ -1,6 +1,21 @@
 #! /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")
+id=$(/usr/bin/job "$1")
 if [ $? != 0 ]; then
   qdel $id
 else
diff --git a/jobutils/bin/jsub b/jobutils/bin/jsub
index f689052..52bf917 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;
@@ -169,7 +184,7 @@
 die "\[$now\] $prog: not an executable file\n" unless -f $prog and -x $prog;
 
 if($once) {
-  my $running = system "/usr/local/bin/job", '-q', $jobname;
+  my $running = system "/usr/bin/job", '-q', $jobname;
   die "\[$now\] unable to get job status\n" if $running & 127;
   $running >>= 8;
   die "\[$now\] there is a job named '$jobname' already active\n" unless 
$running==0;
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: merged
Gerrit-Change-Id: I42f06066ecea991097e1e4cda791bfd5727ea396
Gerrit-PatchSet: 3
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: coren <[email protected]>
Gerrit-Reviewer: AzaToth <[email protected]>
Gerrit-Reviewer: coren <[email protected]>

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

Reply via email to