[condor-job-hooks] Packaging updates

rrati rrati at fedoraproject.org
Mon Jan 16 18:45:34 UTC 2012


commit 80118e5471e622185919d33c7ea88ba243e31e71
Author: Robert Rati <rrati at redhat.com>
Date:   Mon Jan 16 12:44:11 2012 -0600

    Packaging updates

 .gitignore                                         |    1 +
 ...ctly-parse-windows-commandline-in-run_cmd.patch |   79 +++
 ...Added-comment-on-new-_cmdline2list-method.patch |   24 +
 0003-Updated-spec-to-1.5-2.patch                   |   57 ++
 ...in-read_condor_config.-If-multiple-params.patch |   43 ++
 0005-Updated-spec-to-1.5-3.patch                   |   43 ++
 ...er-to-read_condor_config-to-disallow-look.patch |  140 +++++
 0007-Fixed-typo.patch                              |   25 +
 ...-message-raised-from-read_condor_config-i.patch |   30 +
 0009-Updated-spec-to-1.5-4.patch                   |   37 ++
 0010-Added-VERSION-file.patch                      |   20 +
 0011-Packaing-improvements.patch                   |  611 ++++++++++++++++++++
 0012-Renamed-INSTALL-CONFIG.patch                  |   87 +++
 0013-Updated-spec-to-1.5-5.patch                   |   27 +
 condor-job-hooks.spec                              |   55 ++-
 sources                                            |    2 +-
 16 files changed, 1273 insertions(+), 8 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3cbf0fb..9d93d1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ condor-job-hooks-1.0-12.tar.gz
 /condor-job-hooks-1.4-7.tar.gz
 /condor-job-hooks-1.5-3.tar.gz
 /condor-job-hooks-1.5-4.tar.gz
+/condor-job-hooks-1.5.tar.gz
diff --git a/0001-Correctly-parse-windows-commandline-in-run_cmd.patch b/0001-Correctly-parse-windows-commandline-in-run_cmd.patch
new file mode 100644
index 0000000..80fe694
--- /dev/null
+++ b/0001-Correctly-parse-windows-commandline-in-run_cmd.patch
@@ -0,0 +1,79 @@
+From 429b651f636b9ca9edae8761242c40d65bd40b25 Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Fri, 11 Mar 2011 12:02:57 -0600
+Subject: [PATCH 01/13] Correctly parse windows commandline in run_cmd
+
+---
+ module/osutil.py |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 51 insertions(+), 1 deletions(-)
+
+diff --git a/module/osutil.py b/module/osutil.py
+index ba68214..549394b 100644
+--- a/module/osutil.py
++++ b/module/osutil.py
+@@ -59,7 +59,10 @@ def run_cmd(cmd, environ={}, inter=False):
+          std_err = None
+    elif use_popen2 == False:
+       try:
+-         cmd_list = shlex.split(cmd)
++         if os.name == 'nt' or os.name == 'ce':
++            cmd_list = _cmdline2list(cmd)
++         else:
++            cmd_list = shlex.split(cmd)
+          obj = Popen(cmd_list, stdout=PIPE, stderr=PIPE, env=env)
+          (std_out, std_err) = obj.communicate()
+          retcode = obj.returncode
+@@ -181,3 +184,50 @@ def tarball_extract(filename):
+    for file in tarball.getnames():
+       tarball.extract(file)
+    tarball.close()
++
++
++def _cmdline2list(cmdline):
++   """Build an argv list from a Microsoft shell style cmdline str
++      following the MS C runtime rules."""
++
++   whitespace = ' \t'
++   # count of preceding '\'
++   bs_count = 0
++   in_quotes = False
++   arg = []
++   argv = []
++
++   for ch in cmdline:
++      if ch in whitespace and not in_quotes:
++         if arg:
++            # finalize arg and reset
++            argv.append(''.join(arg))
++            arg = []
++         bs_count = 0
++      elif ch == '\\':
++         arg.append(ch)
++         bs_count += 1
++      elif ch == '"':
++         if not bs_count % 2:
++            # Even number of '\' followed by a '"'. Place one
++            # '\' for every pair and treat '"' as a delimiter
++            if bs_count:
++               del arg[-(bs_count / 2):]
++            in_quotes = not in_quotes
++         else:
++            # Odd number of '\' followed by a '"'. Place one '\'
++            # for every pair and treat '"' as an escape sequence
++            # by the remaining '\'
++            del arg[-(bs_count / 2 + 1):]
++            arg.append(ch)
++         bs_count = 0
++      else:
++         # regular char
++         arg.append(ch)
++         bs_count = 0
++
++   # A single trailing '"' delimiter yields an empty arg
++   if arg or in_quotes:
++      argv.append(''.join(arg))
++
++   return argv
+-- 
+1.7.6.5
+
diff --git a/0002-Added-comment-on-new-_cmdline2list-method.patch b/0002-Added-comment-on-new-_cmdline2list-method.patch
new file mode 100644
index 0000000..cc87528
--- /dev/null
+++ b/0002-Added-comment-on-new-_cmdline2list-method.patch
@@ -0,0 +1,24 @@
+From 2173ec43ca39b99476682884fac209c1b9de165f Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Fri, 11 Mar 2011 14:09:33 -0600
+Subject: [PATCH 02/13] Added comment on new _cmdline2list method
+
+---
+ module/osutil.py |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/module/osutil.py b/module/osutil.py
+index 549394b..d2e6ee1 100644
+--- a/module/osutil.py
++++ b/module/osutil.py
+@@ -186,6 +186,7 @@ def tarball_extract(filename):
+    tarball.close()
+ 
+ 
++# This method comes from the jython code base.
+ def _cmdline2list(cmdline):
+    """Build an argv list from a Microsoft shell style cmdline str
+       following the MS C runtime rules."""
+-- 
+1.7.6.5
+
diff --git a/0003-Updated-spec-to-1.5-2.patch b/0003-Updated-spec-to-1.5-2.patch
new file mode 100644
index 0000000..44768ad
--- /dev/null
+++ b/0003-Updated-spec-to-1.5-2.patch
@@ -0,0 +1,57 @@
+From c3140f14931357b7961b24a684dc9d55cb02e5bb Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Mon, 14 Mar 2011 10:42:18 -0500
+Subject: [PATCH 03/13] Updated spec to 1.5-2
+
+---
+ Makefile              |    2 +-
+ condor-job-hooks.spec |    7 +++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a2ab8a1..32550ad 100644
+--- a/Makefile
++++ b/Makefile
+@@ -5,7 +5,7 @@ RPMBUILD_DIRS := BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
+ NAME := condor-job-hooks
+ SPEC := ${NAME}.spec
+ VERSION := $(shell grep -i version: "${SPEC}" | awk '{print $$2}')
+-RELEASE := $(shell grep -i 'define rel' "${SPEC}" | awk '{print $$3}')
++RELEASE := $(shell grep -i 'global rel' "${SPEC}" | awk '{print $$3}')
+ SOURCE := ${NAME}-${VERSION}-${RELEASE}.tar.gz
+ DIR := ${NAME}-${VERSION}
+ 
+diff --git a/condor-job-hooks.spec b/condor-job-hooks.spec
+index 89d3186..ddcc15d 100644
+--- a/condor-job-hooks.spec
++++ b/condor-job-hooks.spec
+@@ -1,6 +1,6 @@
+ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+ %{!?is_fedora: %define is_fedora %(/bin/sh -c "if [ -e /etc/fedora-release ];then echo '1'; fi")}
+-%define rel 1
++%global rel 2
+ 
+ Summary: Condor Job Hooks
+ Name: condor-job-hooks
+@@ -14,7 +14,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+ BuildArch: noarch
+ Requires: python >= 2.3
+ Requires: condor >= 7.0.2-4
+-Requires: python-condorutils >= 1.5
++Requires: python-condorutils = %{version}-%{rel}%{?dist}
+ 
+ %description
+ This package provides Condor job hooks that communicate with a translation
+@@ -79,6 +79,9 @@ rm -rf %{buildroot}
+ %{python_sitelib}/condorutils/workfetch.py*
+ 
+ %changelog
++* Mon Mar 14 2011  <rrati at redhat> - 1.5-2
++- Fixed issue with run_cmd parsing args on windows
++
+ * Tue Feb  8 2011  <rrati at redhat> - 1.5-1
+ - Append the PATH from the environment of the caller to the predefined path in
+   run_cmd
+-- 
+1.7.6.5
+
diff --git a/0004-Fixed-bugs-in-read_condor_config.-If-multiple-params.patch b/0004-Fixed-bugs-in-read_condor_config.-If-multiple-params.patch
new file mode 100644
index 0000000..40e58dd
--- /dev/null
+++ b/0004-Fixed-bugs-in-read_condor_config.-If-multiple-params.patch
@@ -0,0 +1,43 @@
+From 030e38c5e417339e147c39af53828ba08fb8355e Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Wed, 27 Apr 2011 09:55:38 -0500
+Subject: [PATCH 04/13] Fixed bugs in read_condor_config. If multiple params
+ are passed in, but no subsystem was provided, then
+ only the last param was looked up.  If multiple
+ params are passed in and a subsystem is provided,
+ then only the last param would attempt to lookup the
+ param name without a subsystem.
+
+---
+ module/readconfig.py |   15 ++++++++++-----
+ 1 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/module/readconfig.py b/module/readconfig.py
+index c7c6fbc..42da2da 100644
+--- a/module/readconfig.py
++++ b/module/readconfig.py
+@@ -41,11 +41,16 @@ def read_condor_config(subsys, attr_list, environ={}):
+                found = True
+                config[attr.lower()] = value.strip()
+ 
+-   if found == False:
+-      (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ)
+-      if rcode == 0:
+-         found = True
+-         config[attr.lower()] = value.strip()
++      if found == False:
++         # Try the param name by itself
++         (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ)
++         if rcode == 0:
++            found = True
++            config[attr.lower()] = value.strip()
++         else:
++            # The param wasn't found so break out so that an execption can
++            # be raised
++            break
+ 
+    if found == False:
+       # Config value not found.  Raise an exception
+-- 
+1.7.6.5
+
diff --git a/0005-Updated-spec-to-1.5-3.patch b/0005-Updated-spec-to-1.5-3.patch
new file mode 100644
index 0000000..8d84a6a
--- /dev/null
+++ b/0005-Updated-spec-to-1.5-3.patch
@@ -0,0 +1,43 @@
+From 6b3f7e2efc20bdd1845ba5e43c0c4ac4143bddcd Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Wed, 27 Apr 2011 10:03:22 -0500
+Subject: [PATCH 05/13] Updated spec to 1.5-3
+
+---
+ condor-job-hooks.spec |    7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/condor-job-hooks.spec b/condor-job-hooks.spec
+index ddcc15d..1b3a3c9 100644
+--- a/condor-job-hooks.spec
++++ b/condor-job-hooks.spec
+@@ -1,6 +1,6 @@
+ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+ %{!?is_fedora: %define is_fedora %(/bin/sh -c "if [ -e /etc/fedora-release ];then echo '1'; fi")}
+-%global rel 2
++%global rel 3
+ 
+ Summary: Condor Job Hooks
+ Name: condor-job-hooks
+@@ -14,7 +14,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+ BuildArch: noarch
+ Requires: python >= 2.3
+ Requires: condor >= 7.0.2-4
+-Requires: python-condorutils = %{version}-%{rel}%{?dist}
++Requires: python-condorutils = %{version}-%{release}
+ 
+ %description
+ This package provides Condor job hooks that communicate with a translation
+@@ -79,6 +79,9 @@ rm -rf %{buildroot}
+ %{python_sitelib}/condorutils/workfetch.py*
+ 
+ %changelog
++* Wed Apr 27 2011  <rrati at redhat> - 1.5-3
++- Fixed param lookup issues in read_condor_config
++
+ * Mon Mar 14 2011  <rrati at redhat> - 1.5-2
+ - Fixed issue with run_cmd parsing args on windows
+ 
+-- 
+1.7.6.5
+
diff --git a/0006-Add-parameter-to-read_condor_config-to-disallow-look.patch b/0006-Add-parameter-to-read_condor_config-to-disallow-look.patch
new file mode 100644
index 0000000..b6486a6
--- /dev/null
+++ b/0006-Add-parameter-to-read_condor_config-to-disallow-look.patch
@@ -0,0 +1,140 @@
+From c1024859939b6d29ff7d18e022c0c163ed80c1fe Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Thu, 21 Jul 2011 12:39:38 -0500
+Subject: [PATCH 06/13] Add parameter to read_condor_config to disallow lookup
+ of param only.  The param defaults to true, and if
+ set to false then subsys.param must exist. Updated
+ hooks to used the new parameter
+
+---
+ hooks/hook_evict_claim.py       |    2 +-
+ hooks/hook_fetch_work.py        |    2 +-
+ hooks/hook_job_exit.py          |    2 +-
+ hooks/hook_prepare_job.py       |    2 +-
+ hooks/hook_reply_fetch.py       |    2 +-
+ hooks/hook_update_job_status.py |    2 +-
+ module/readconfig.py            |   23 ++++++++++++++---------
+ 7 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/hooks/hook_evict_claim.py b/hooks/hook_evict_claim.py
+index 61bd567..eb3883f 100755
+--- a/hooks/hook_evict_claim.py
++++ b/hooks/hook_evict_claim.py
+@@ -32,7 +32,7 @@ def main(argv=None):
+    log_name = os.path.basename(argv[0])
+ 
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          print >> sys.stderr, 'Warning: %s' % error.msg
+diff --git a/hooks/hook_fetch_work.py b/hooks/hook_fetch_work.py
+index 102ea60..8fb73e8 100755
+--- a/hooks/hook_fetch_work.py
++++ b/hooks/hook_fetch_work.py
+@@ -33,7 +33,7 @@ def main(argv=None):
+    log_name = os.path.basename(argv[0])
+ 
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          print >> sys.stderr, 'Warning: %s' % error.msg
+diff --git a/hooks/hook_job_exit.py b/hooks/hook_job_exit.py
+index ebc28af..9637c02 100755
+--- a/hooks/hook_job_exit.py
++++ b/hooks/hook_job_exit.py
+@@ -36,7 +36,7 @@ def main(argv=None):
+    if use_syslog == True:
+       syslog.openlog(os.path.basename(argv[0]))
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          if use_syslog == True:
+diff --git a/hooks/hook_prepare_job.py b/hooks/hook_prepare_job.py
+index 1a2e2b0..30a3303 100755
+--- a/hooks/hook_prepare_job.py
++++ b/hooks/hook_prepare_job.py
+@@ -36,7 +36,7 @@ def main(argv=None):
+    if use_syslog == True:
+       syslog.openlog(os.path.basename(argv[0]))
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          if use_syslog == True:
+diff --git a/hooks/hook_reply_fetch.py b/hooks/hook_reply_fetch.py
+index 867de9d..4458fd5 100755
+--- a/hooks/hook_reply_fetch.py
++++ b/hooks/hook_reply_fetch.py
+@@ -33,7 +33,7 @@ def main(argv=None):
+    log_name = os.path.basename(argv[0])
+ 
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT', 'LOG'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          print >> sys.stderr, 'Warning: %s' % error.msg
+diff --git a/hooks/hook_update_job_status.py b/hooks/hook_update_job_status.py
+index bfcd976..4f014cf 100755
+--- a/hooks/hook_update_job_status.py
++++ b/hooks/hook_update_job_status.py
+@@ -36,7 +36,7 @@ def main(argv=None):
+    if use_syslog == True:
+       syslog.openlog(os.path.basename(argv[0]))
+    try:
+-      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'])
++      config = read_condor_config('JOB_HOOKS', ['IP', 'PORT'], permit_param_only = False)
+    except ConfigError, error:
+       try:
+          if use_syslog == True:
+diff --git a/module/readconfig.py b/module/readconfig.py
+index 42da2da..d4cb908 100644
+--- a/module/readconfig.py
++++ b/module/readconfig.py
+@@ -22,7 +22,7 @@ class ConfigError(Exception):
+       self.msg = msg
+ 
+ 
+-def read_condor_config(subsys, attr_list, environ={}):
++def read_condor_config(subsys, attr_list, environ={}, permit_param_only=True):
+    """ Uses condor_config_val to look up values in condor's configuration.
+        First looks for subsys_param, then for the newer subsys.param.
+        Returns map(param, value)"""
+@@ -42,14 +42,19 @@ def read_condor_config(subsys, attr_list, environ={}):
+                config[attr.lower()] = value.strip()
+ 
+       if found == False:
+-         # Try the param name by itself
+-         (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ)
+-         if rcode == 0:
+-            found = True
+-            config[attr.lower()] = value.strip()
+-         else:
+-            # The param wasn't found so break out so that an execption can
+-            # be raised
++         if permit_param_only == True:
++            # Try the param name by itself
++            (rcode, value, stderr) = run_cmd('condor_config_val ' + attr, environ=environ)
++            if rcode == 0:
++               found = True
++               config[attr.lower()] = value.strip()
++            else:
++               # The param wasn't found so break out so that an execption can
++               # be raised
++               break
++         else
++            # Lookup of param by itself isn't allowed, so break so an exception
++            # can be raised
+             break
+ 
+    if found == False:
+-- 
+1.7.6.5
+
diff --git a/0007-Fixed-typo.patch b/0007-Fixed-typo.patch
new file mode 100644
index 0000000..9e410ce
--- /dev/null
+++ b/0007-Fixed-typo.patch
@@ -0,0 +1,25 @@
+From 852f60032a0defc31076307dbedb27696b775a51 Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Thu, 21 Jul 2011 12:41:14 -0500
+Subject: [PATCH 07/13] Fixed typo
+
+---
+ module/readconfig.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/module/readconfig.py b/module/readconfig.py
+index d4cb908..e9f5665 100644
+--- a/module/readconfig.py
++++ b/module/readconfig.py
+@@ -52,7 +52,7 @@ def read_condor_config(subsys, attr_list, environ={}, permit_param_only=True):
+                # The param wasn't found so break out so that an execption can
+                # be raised
+                break
+-         else
++         else:
+             # Lookup of param by itself isn't allowed, so break so an exception
+             # can be raised
+             break
+-- 
+1.7.6.5
+
diff --git a/0008-Fixed-error-message-raised-from-read_condor_config-i.patch b/0008-Fixed-error-message-raised-from-read_condor_config-i.patch
new file mode 100644
index 0000000..a920082
--- /dev/null
+++ b/0008-Fixed-error-message-raised-from-read_condor_config-i.patch
@@ -0,0 +1,30 @@
+From d110a079999c6ddf540025a8e9f9e683426ccb4a Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Thu, 21 Jul 2011 16:16:54 -0500
+Subject: [PATCH 08/13] Fixed error message raised from read_condor_config if
+ a param with a subsystem is not found.  Message now
+ includes the subsystem
+
+---
+ module/readconfig.py |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/module/readconfig.py b/module/readconfig.py
+index e9f5665..9c0f80d 100644
+--- a/module/readconfig.py
++++ b/module/readconfig.py
+@@ -59,7 +59,10 @@ def read_condor_config(subsys, attr_list, environ={}, permit_param_only=True):
+ 
+    if found == False:
+       # Config value not found.  Raise an exception
+-      raise ConfigError('"%s" is not defined' % attr)
++      if subsys != '':
++         raise ConfigError('"%s_%s" is not defined' % (subsys, attr))
++      else:
++         raise ConfigError('"%s" is not defined' % attr)
+    return config
+ 
+ 
+-- 
+1.7.6.5
+
diff --git a/0009-Updated-spec-to-1.5-4.patch b/0009-Updated-spec-to-1.5-4.patch
new file mode 100644
index 0000000..fa84bd2
--- /dev/null
+++ b/0009-Updated-spec-to-1.5-4.patch
@@ -0,0 +1,37 @@
+From 653bc7fb6c31cb349be3fbd55f60d6063b14a2b1 Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Fri, 22 Jul 2011 12:30:22 -0500
+Subject: [PATCH 09/13] Updated spec to 1.5-4
+
+---
+ condor-job-hooks.spec |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/condor-job-hooks.spec b/condor-job-hooks.spec
+index 1b3a3c9..cb0d623 100644
+--- a/condor-job-hooks.spec
++++ b/condor-job-hooks.spec
+@@ -1,6 +1,6 @@
+ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+ %{!?is_fedora: %define is_fedora %(/bin/sh -c "if [ -e /etc/fedora-release ];then echo '1'; fi")}
+-%global rel 3
++%global rel 4
+ 
+ Summary: Condor Job Hooks
+ Name: condor-job-hooks
+@@ -79,6 +79,12 @@ rm -rf %{buildroot}
+ %{python_sitelib}/condorutils/workfetch.py*
+ 
+ %changelog
++* Wed Jul 22 2011  <rrati at redhat> - 1.5-4
++- Added optional arg to read_condor_config to control lookup of param without
++  subsystem
++- Fixed error message raised from read_condor_config if a param with a
++  subsystem is not found
++
+ * Wed Apr 27 2011  <rrati at redhat> - 1.5-3
+ - Fixed param lookup issues in read_condor_config
+ 
+-- 
+1.7.6.5
+
diff --git a/0010-Added-VERSION-file.patch b/0010-Added-VERSION-file.patch
new file mode 100644
index 0000000..170ecf9
--- /dev/null
+++ b/0010-Added-VERSION-file.patch
@@ -0,0 +1,20 @@
+From 58d05cda2c76560c0e8b1b26299b03b09c1021fd Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Mon, 16 Jan 2012 11:38:30 -0600
+Subject: [PATCH 10/13] Added VERSION file
+
+---
+ VERSION |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+ create mode 100644 VERSION
+
+diff --git a/VERSION b/VERSION
+new file mode 100644
+index 0000000..c239c60
+--- /dev/null
++++ b/VERSION
+@@ -0,0 +1 @@
++1.5
+-- 
+1.7.6.5
+
diff --git a/0011-Packaing-improvements.patch b/0011-Packaing-improvements.patch
new file mode 100644
index 0000000..7548a2d
--- /dev/null
+++ b/0011-Packaing-improvements.patch
@@ -0,0 +1,611 @@
+From a40ff2fd8387a6ee017e0dc2b9444ded073bc01e Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Mon, 16 Jan 2012 12:02:11 -0600
+Subject: [PATCH 11/13] Packaing improvements
+
+---
+ Makefile                 |  101 ++++++++++++++-----
+ condor-job-hooks.spec    |  226 -------------------------------------------
+ condor-job-hooks.spec.in |  239 ++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 313 insertions(+), 253 deletions(-)
+ delete mode 100644 condor-job-hooks.spec
+ create mode 100644 condor-job-hooks.spec.in
+
+diff --git a/Makefile b/Makefile
+index 32550ad..d5b4fa9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,39 +1,86 @@
+-.PHONY: build condor-job-hooks
++NAME := condor-job-hooks
++
++.PHONY: build ${NAME}
+ 
+ RPMBUILD_DIRS := BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
++null :=
++space := ${null} ${null}
+ 
+-NAME := condor-job-hooks
+ SPEC := ${NAME}.spec
+-VERSION := $(shell grep -i version: "${SPEC}" | awk '{print $$2}')
+-RELEASE := $(shell grep -i 'global rel' "${SPEC}" | awk '{print $$3}')
+-SOURCE := ${NAME}-${VERSION}-${RELEASE}.tar.gz
+-DIR := ${NAME}-${VERSION}
++VER = $(shell cat "VERSION")
++ORIG_VER := $(call VER)
++ORIG_MAJOR := $(shell cat "VERSION" | cut -d '.' -f 1)
++ORIG_MINOR := $(shell cat "VERSION" | cut -d '.' -f 2)
++ORIG_PATCH := $(shell cat "VERSION" | cut -d '.' -f 3)
++PREFIX := ${NAME}-${ORIG_VER}
++SOURCE := ${PREFIX}.tar.gz
++RELEASE ?= 1
++PATCH_NUM := 0
+ 
+-build: condor-job-hooks
++bump_and_commit_version = \
++  $(eval NEW_VER := $(1).$(2).$(3)) \
++  sed -i "s/${ORIG_VER}/${NEW_VER}/" VERSION; \
++  git commit -m "bumping VERSION from ${ORIG_VER} to ${NEW_VER}" VERSION; \
++  git tag ${NEW_VER}; \
++  git push origin master ${new_ver}
+ 
+-condor-job-hooks: SPECS/${SPEC} SOURCES/${SOURCE}
+-	mkdir -p BUILD RPMS SRPMS
++create_patch_lines = \
++Patch${PATCH_NUM}: ${file} \
++$(eval APPLY_LINES += %patch${PATCH_NUM} -p1)\
++$(eval PATCH_NUM := $(shell expr ${PATCH_NUM} + 1))
++
++build: ${NAME}
++
++${NAME}: rpmdirs gen_patches SPECS/${SPEC} SOURCES/${SOURCE}
+ 	rpmbuild --define="_topdir ${PWD}" -ba SPECS/${SPEC}
+ 
+-SPECS/${SPEC}: ${SPEC}
+-	mkdir -p SPECS
++bump_major: VERSION
++	$(eval MAJOR := $(shell expr ${ORIG_MAJOR} + 1))
++	$(call bump_and_commit_version,${MAJOR},0,0)
++
++bump_minor: VERSION
++	$(eval MINOR := $(shell expr ${ORIG_MINOR} + 1))
++	$(call bump_and_commit_version,${ORIG_MAJOR},${MINOR},0)
++
++bump_patch: VERSION
++	$(eval PATCH := $(shell expr ${ORIG_PATCH} + 1))
++	$(call bump_and_commit_version,${ORIG_MAJOR},${ORIG_MINOR},${PATCH})
++
++SPECS/${SPEC}: rpmdirs ${SPEC}.in
++	sed "s/#VERSION#/${ORIG_VER}/" ${SPEC}.in > ${SPEC}
++	sed -i "s/#RELEASE#/${RELEASE}/" ${SPEC}
++	$(eval PATCH_FILES := $(sort $(shell ls SOURCES/*.patch)))
++	$(eval PATCH_LINES := $(strip $(foreach file,$(notdir ${PATCH_FILES}),$(create_patch_lines))))
++	$(eval PATCH_LINES := $(subst patch${space},patch\n, ${PATCH_LINES}))
++	$(eval APPLY_LINES := $(subst -p1${space},-p1\n, ${APPLY_LINES}))
++	echo "${PATCH_LINES}"
++	sed -i 's/#PATCHES#/${PATCH_LINES}/' ${SPEC}
++	sed -i 's/#APPLY_PATCHES#/${APPLY_LINES}/' ${SPEC}
+ 	cp -f ${SPEC} SPECS
+ 
+-SOURCES/${SOURCE}: module/__init__.py module/log.py module/osutil.py \
+-                   module/readconfig.py module/socketutil.py \
+-                   module/workfetch.py hooks/hook_evict_claim.py \
+-                   hooks/hook_fetch_work.py hooks/hook_job_exit.py \
+-                   hooks/hook_prepare_job.py hooks/hook_reply_fetch.py \
+-                   hooks/hook_update_job_status.py
+-	mkdir -p SOURCES
+-	rm -rf ${DIR}
+-	mkdir ${DIR}
+-	cp -Rf hooks ${DIR}
+-	cp -Rf module ${DIR}
+-	cp -f LICENSE-2.0.txt ${DIR}
+-	cp -f INSTALL ${DIR}
+-	tar -cf ${SOURCE} ${DIR}
+-	mv "${SOURCE}" SOURCES
++SOURCES/${SOURCE}: rpmdirs pristine
++	cp ${SOURCE} SOURCES
++
++pristine:
++	@git archive --format=tar ${ORIG_VER} --prefix=${PREFIX}/ | gzip -9nv > ${SOURCE} 2> /dev/null
++
++upload_pristine: pristine
++ifndef FH_USERNAME
++	@echo "Please set FH_USERNAME" 
++else
++	scp ${SOURCE} ${FH_USERNAME}@fedorahosted.org:grid
++endif
++
++gen_patches: rpmdirs
++ifdef SIMPLE_GIT_PATCH_NAMES
++	$(eval SIMPLE_NAMES := --numbered-files)
++else
++	$(eval SIMPLE_NAMES := )
++endif
++	git format-patch ${SIMPLE_NAMES} -o SOURCES ${ORIG_VER}
++
++rpmdirs:
++	mkdir -p ${RPMBUILD_DIRS}
+ 
+ clean:
+-	rm -rf ${RPMBUILD_DIRS} ${DIR}
++	rm -rf ${RPMBUILD_DIRS} ${PREFIX} ${SOURCE} ${SPEC}
+diff --git a/condor-job-hooks.spec b/condor-job-hooks.spec
+deleted file mode 100644
+index cb0d623..0000000
+--- a/condor-job-hooks.spec
++++ /dev/null
+@@ -1,226 +0,0 @@
+-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+-%{!?is_fedora: %define is_fedora %(/bin/sh -c "if [ -e /etc/fedora-release ];then echo '1'; fi")}
+-%global rel 4
+-
+-Summary: Condor Job Hooks
+-Name: condor-job-hooks
+-Version: 1.5
+-Release: %{rel}%{?dist}
+-License: ASL 2.0
+-Group: Applications/System
+-URL: http://git.fedorahosted.org/git/grid/job_hooks.git
+-Source0: %{name}-%{version}-%{rel}.tar.gz
+-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+-BuildArch: noarch
+-Requires: python >= 2.3
+-Requires: condor >= 7.0.2-4
+-Requires: python-condorutils = %{version}-%{release}
+-
+-%description
+-This package provides Condor job hooks that communicate with a translation
+-daemon which interfaces with job delivery protocols outside of condor's
+-native job delivery protocol.
+-
+-%package -n python-condorutils
+-Summary: Common functions/utilities for condor job hooks
+-Group: Applications/System
+-BuildRequires: python-devel >= 2.3
+-Requires: python >= 2.3
+-Obsoletes: condor-job-hooks-common
+-Obsoletes: python-condor-job-hooks-common
+-
+-%description -n python-condorutils
+-Common functions and utilities used by condor features.
+-
+-%prep
+-%setup -q
+-
+-%build
+-
+-%install
+-rm -rf %{buildroot}
+-mkdir -p %{buildroot}/%_libexecdir/condor/hooks
+-mkdir -p %{buildroot}/%{python_sitelib}/condorutils
+-mkdir -p %{buildroot}/%_sysconfdir/condor
+-cp -f hooks/hook*.py %{buildroot}/%_libexecdir/condor/hooks
+-rm -f %{buildroot}/%_libexecdir/condor/hooks/hook_evict_claim.*
+-cp -f module/*.py %{buildroot}/%{python_sitelib}/condorutils
+-
+-%post
+-%if 0%{?is_fedora} == 0
+-if [[ -f /etc/opt/grid/job-hooks.conf ]]; then
+-   mv -f /etc/opt/grid/job-hooks.conf /etc/condor
+-   rmdir --ignore-fail-on-non-empty -p /etc/opt/grid
+-fi
+-%endif
+-exit 0
+-
+-%clean
+-rm -rf %{buildroot}
+-
+-%files
+-%defattr(-,root,root,-)
+-%doc LICENSE-2.0.txt INSTALL
+-%defattr(0755,root,root,-)
+-%_libexecdir/condor/hooks/hook_fetch_work.py*
+-%_libexecdir/condor/hooks/hook_job_exit.py*
+-%_libexecdir/condor/hooks/hook_prepare_job.py*
+-%_libexecdir/condor/hooks/hook_reply_fetch.py*
+-%_libexecdir/condor/hooks/hook_update_job_status.py*
+-
+-%files -n python-condorutils
+-%defattr(-,root,root,-)
+-%doc LICENSE-2.0.txt
+-%{python_sitelib}/condorutils/__init__.py*
+-%{python_sitelib}/condorutils/log.py*
+-%{python_sitelib}/condorutils/osutil.py*
+-%{python_sitelib}/condorutils/readconfig.py*
+-%{python_sitelib}/condorutils/socketutil.py*
+-%{python_sitelib}/condorutils/workfetch.py*
+-
+-%changelog
+-* Wed Jul 22 2011  <rrati at redhat> - 1.5-4
+-- Added optional arg to read_condor_config to control lookup of param without
+-  subsystem
+-- Fixed error message raised from read_condor_config if a param with a
+-  subsystem is not found
+-
+-* Wed Apr 27 2011  <rrati at redhat> - 1.5-3
+-- Fixed param lookup issues in read_condor_config
+-
+-* Mon Mar 14 2011  <rrati at redhat> - 1.5-2
+-- Fixed issue with run_cmd parsing args on windows
+-
+-* Tue Feb  8 2011  <rrati at redhat> - 1.5-1
+-- Append the PATH from the environment of the caller to the predefined path in
+-  run_cmd
+-- Changed the workings of read_condor_config
+-- Updated hooks to use new read_condor_config
+-
+-* Mon Jan  3 2011  <rrati at redhat> - 1.4-7
+-- Update source URL
+-
+-* Wed Nov 10 2010  <rrati at redhat> - 1.4-6
+-- If zip does not include permissions info, do not explicitly set and leave
+-  to umask
+-
+-* Mon Aug 23 2010  <rrati at redhat> - 1.4-5
+-- Fixed typo in status hook
+-
+-* Thu Aug 12 2010  <rrati at redhat> - 1.4-4
+-- update, exit, and status hooks all log to syslog
+-
+-* Mon Aug 02 2010  <rrati at redhat> - 1.4-3
+-- Fixed issue with run_cmd causing a deadlock when commands returned
+-  a large amount of data on python2.3
+-
+-* Fri Jul 23 2010  <rrati at redhat> - 1.4-2
+-- Fixed output of run_cmd on python2.3 when using popen2
+-- Fixed resetting of environment variables when run on python2.3
+-
+-* Mon Jun 28 2010  <rrati at redhat> - 1.4-1
+-- Updated dependecy versions
+-
+-* Fri Jun 11 2010  <rrati at redhat> - 1.4-0.6
+-- The prepare hook only logs on non-windows machines
+-
+-* Fri Jun 11 2010  <rrati at redhat> - 1.4-0.5
+-- Additional logging
+-- Prepare hook will log to syslog
+-
+-* Thu Jun 03 2010  <rrati at redhat> - 1.4-0.4
+-- Fix setting of PATH on non-Unix machines in run_cmd
+-- Better handle errors when running commands in run_cmd
+- 
+-* Wed Apr 14 2010  <rrati at redhat> - 1.4-0.3
+-- Added optional environ param to read_condor_config
+-
+-* Wed Apr 14 2010  <rrati at redhat> - 1.4-0.2
+-- Fixed issue setting/reseting environment variables when popen2 is used.
+-  Any params set by the caller were not getting reset by the time run_cmd
+-  was exiting, so the environment was permanently modified.
+-
+-* Thu Apr  8 2010  <rrati at redhat> - 1.4-0.1
+-- Added option param to run_cmd (inter).  This will allow commands to be
+-  run that require user interaction
+-- Fixed setting of environment before executing the command.  PATH is
+-  always overriden and defined as a trusted set of directories.
+-- Updated usage of run_cmd
+-
+-* Mon Mar 29 2010  <rrati at redhat> - 1.3-0.1
+-- Changed Exception names
+-- Changed log_messages to log
+-- Renamed python module to condorutils
+-- Removed functions.py and moved to separate modules
+-- Improved error handling for when calling close_socket and pickle.loads
+-- log_messages no long takes an exception, but a list of strings to print
+-
+-* Thu Mar 11 2010  <rrati at redhat> - 1.2-0.2
+-- Added importing of logging module into common functions
+-
+-* Tue Mar 09 2010  <rrati at redhat> - 1.2-0.1
+-- Changed log_messages to use native logging module rather than syslog
+-- Changed general_execption to GeneralError
+-- Exception no longer takes a level
+-- log_messages now requires a level passed to it
+-- Changed run_cmd to return 3 values rather than a list of 3 values
+-- Fixed read_config_config to be able to handle 1 word params (ie LOG)
+-- log_messages takes an optional 3rd arg that specifies the name of a
+-  logging subsystem to use.  If none is given, the base logger is used
+-
+-* Thu Mar 04 2010  <rrati at redhat> - 1.1-0.1
+-- run_cmd takes an optional 3rd arg that specifies environment vars to set
+-
+-* Mon Jan 26 2010  <rrati at redhat> - 1.0-14
+-- Fixed handling of multiple args using Popen in run_cmd
+-- Added comments to a few methods
+-- Fixed type in run_cmd when using the popen2 module
+-
+-* Fri Sep 11 2009  <rrati at redhat> - 1.0-13
+-- Use popen2 module instead of subprocess on python versions that don't
+-  have the subprocess module (BZ522467)
+-
+-* Tue Aug 18 2009  <rrati at redhat> - 1.0-12
+-- Job hooks use JOB_HOOK as keyword instead of LL_HOOK
+-- Fixed version numbering
+-
+-* Tue Aug 18 2009  <rrati at redhat> - 1.0-11
+-- Split documentation into two files, one for carod and one for
+-  the job-hooks
+-
+-* Mon Aug 17 2009  <rrati at redhat> - 1.0-10
+-- Minor cleanup in common functions
+-
+-* Mon Jul 27 2009  <rrati at redhat> - 1.0-9
+-- Renamed condor-job-hooks-common to python-condor-job-hooks-common to
+-  conform to packaging guidelines since the package installs in
+-  python sitelib.
+-
+-* Mon Jul 27 2009  <rrati at redhat> - 1.0-8
+-- Fix rpmlint/packaging issues
+-
+-* Wed Jun 24 2009  <rrati at redhat> - 1.0-7
+-- Hooks will first look for their configuration in condor's configuration
+-  files, then fall back to their config file
+-- The config file has moved from /etc/opt/grid to /etc/condor
+-
+-* Tue Jun  2 2009  <rrati at redhat> - 1.0-6
+-- Fixed an exception condition in the prepare hook that wasn't handled
+-  correctly
+-
+-* Fri Feb 13 2009  <rrati at redhat> - 1.0-5
+-- Change source tarball name
+-
+-* Fri Dec  5 2008  <rrati at redhat> - 1.0-4
+-- Cleaned up socket close code to provide cleaner shutdown
+-
+-* Wed Dec  3 2008  <rrati at redhat> - 1.0-3
+-- Fixed python dependency issue with RHEL4
+-- Fixed issues running on python 2.3
+-
+-* Fri Nov  4 2008  <rrati at redhat> - 1.0-2
+-- Add changelog
+-- Fix rpmlint issues
+-
+-* Fri Nov  4 2008  <rrati at redhat> - 1.0-1
+-- Initial packaging
+diff --git a/condor-job-hooks.spec.in b/condor-job-hooks.spec.in
+new file mode 100644
+index 0000000..490b3ef
+--- /dev/null
++++ b/condor-job-hooks.spec.in
+@@ -0,0 +1,239 @@
++%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
++
++%if (0%{?fedora} == 0 && 0%{?rhel} <= 5)
++%global building_for_el5 1
++%else
++%global building_for_el5 0
++%endif
++
++Summary: Condor Job Hooks
++Name: condor-job-hooks
++Version: #VERSION#
++Release: #RELEASE#%{?dist}
++License: ASL 2.0
++Group: Applications/System
++URL: http://git.fedorahosted.org/git/grid/job_hooks.git
++Source0: https://fedorahosted.org/releases/g/r/grid/%{name}-%{version}.tar.gz
++#PATCHES#
++BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-XXXXXX)
++BuildArch: noarch
++Requires: python >= 2.3
++Requires: condor >= 7.0.2-4
++Requires: python-condorutils = %{version}-%{release}
++
++%description
++This package provides Condor job hooks that communicate with a translation
++daemon which interfaces with job delivery protocols outside of condor's
++native job delivery protocol.
++
++%package -n python-condorutils
++Summary: Common functions/utilities for condor job hooks
++Group: Applications/System
++BuildRequires: python-devel >= 2.3
++Requires: python >= 2.3
++Obsoletes: condor-job-hooks-common
++Obsoletes: python-condor-job-hooks-common
++
++%description -n python-condorutils
++Common functions and utilities used by condor features.
++
++%prep
++%setup -q
++
++#APPLY_PATCHES#
++
++%build
++
++%install
++rm -rf %{buildroot}
++mkdir -p %{buildroot}/%_libexecdir/condor/hooks
++mkdir -p %{buildroot}/%{python_sitelib}/condorutils
++mkdir -p %{buildroot}/%_sysconfdir/condor
++cp -f hooks/hook*.py %{buildroot}/%_libexecdir/condor/hooks
++rm -f %{buildroot}/%_libexecdir/condor/hooks/hook_evict_claim.*
++cp -f module/*.py %{buildroot}/%{python_sitelib}/condorutils
++
++%post
++%if 0%{?fedora} == 0
++if [[ -f /etc/opt/grid/job-hooks.conf ]]; then
++   mv -f /etc/opt/grid/job-hooks.conf /etc/condor
++   rmdir --ignore-fail-on-non-empty -p /etc/opt/grid
++fi
++%endif
++exit 0
++
++%if %{building_for_el5}
++%clean
++rm -rf %{buildroot}
++%endif
++
++%files
++%if %{building_for_el5}
++%defattr(-,root,root,-)
++%endif
++%doc LICENSE-2.0.txt INSTALL
++%defattr(0755,root,root,-)
++%_libexecdir/condor/hooks/hook_fetch_work.py*
++%_libexecdir/condor/hooks/hook_job_exit.py*
++%_libexecdir/condor/hooks/hook_prepare_job.py*
++%_libexecdir/condor/hooks/hook_reply_fetch.py*
++%_libexecdir/condor/hooks/hook_update_job_status.py*
++
++%files -n python-condorutils
++%if %{building_for_el5}
++%defattr(-,root,root,-)
++%endif
++%doc LICENSE-2.0.txt
++%{python_sitelib}/condorutils/__init__.py*
++%{python_sitelib}/condorutils/log.py*
++%{python_sitelib}/condorutils/osutil.py*
++%{python_sitelib}/condorutils/readconfig.py*
++%{python_sitelib}/condorutils/socketutil.py*
++%{python_sitelib}/condorutils/workfetch.py*
++
++%changelog
++* Wed Jul 22 2011  <rrati at redhat> - 1.5-4
++- Added optional arg to read_condor_config to control lookup of param without
++  subsystem
++- Fixed error message raised from read_condor_config if a param with a
++  subsystem is not found
++
++* Wed Apr 27 2011  <rrati at redhat> - 1.5-3
++- Fixed param lookup issues in read_condor_config
++
++* Mon Mar 14 2011  <rrati at redhat> - 1.5-2
++- Fixed issue with run_cmd parsing args on windows
++
++* Tue Feb  8 2011  <rrati at redhat> - 1.5-1
++- Append the PATH from the environment of the caller to the predefined path in
++  run_cmd
++- Changed the workings of read_condor_config
++- Updated hooks to use new read_condor_config
++
++* Mon Jan  3 2011  <rrati at redhat> - 1.4-7
++- Update source URL
++
++* Wed Nov 10 2010  <rrati at redhat> - 1.4-6
++- If zip does not include permissions info, do not explicitly set and leave
++  to umask
++
++* Mon Aug 23 2010  <rrati at redhat> - 1.4-5
++- Fixed typo in status hook
++
++* Thu Aug 12 2010  <rrati at redhat> - 1.4-4
++- update, exit, and status hooks all log to syslog
++
++* Mon Aug 02 2010  <rrati at redhat> - 1.4-3
++- Fixed issue with run_cmd causing a deadlock when commands returned
++  a large amount of data on python2.3
++
++* Fri Jul 23 2010  <rrati at redhat> - 1.4-2
++- Fixed output of run_cmd on python2.3 when using popen2
++- Fixed resetting of environment variables when run on python2.3
++
++* Mon Jun 28 2010  <rrati at redhat> - 1.4-1
++- Updated dependecy versions
++
++* Fri Jun 11 2010  <rrati at redhat> - 1.4-0.6
++- The prepare hook only logs on non-windows machines
++
++* Fri Jun 11 2010  <rrati at redhat> - 1.4-0.5
++- Additional logging
++- Prepare hook will log to syslog
++
++* Thu Jun 03 2010  <rrati at redhat> - 1.4-0.4
++- Fix setting of PATH on non-Unix machines in run_cmd
++- Better handle errors when running commands in run_cmd
++ 
++* Wed Apr 14 2010  <rrati at redhat> - 1.4-0.3
++- Added optional environ param to read_condor_config
++
++* Wed Apr 14 2010  <rrati at redhat> - 1.4-0.2
++- Fixed issue setting/reseting environment variables when popen2 is used.
++  Any params set by the caller were not getting reset by the time run_cmd
++  was exiting, so the environment was permanently modified.
++
++* Thu Apr  8 2010  <rrati at redhat> - 1.4-0.1
++- Added option param to run_cmd (inter).  This will allow commands to be
++  run that require user interaction
++- Fixed setting of environment before executing the command.  PATH is
++  always overriden and defined as a trusted set of directories.
++- Updated usage of run_cmd
++
++* Mon Mar 29 2010  <rrati at redhat> - 1.3-0.1
++- Changed Exception names
++- Changed log_messages to log
++- Renamed python module to condorutils
++- Removed functions.py and moved to separate modules
++- Improved error handling for when calling close_socket and pickle.loads
++- log_messages no long takes an exception, but a list of strings to print
++
++* Thu Mar 11 2010  <rrati at redhat> - 1.2-0.2
++- Added importing of logging module into common functions
++
++* Tue Mar 09 2010  <rrati at redhat> - 1.2-0.1
++- Changed log_messages to use native logging module rather than syslog
++- Changed general_execption to GeneralError
++- Exception no longer takes a level
++- log_messages now requires a level passed to it
++- Changed run_cmd to return 3 values rather than a list of 3 values
++- Fixed read_config_config to be able to handle 1 word params (ie LOG)
++- log_messages takes an optional 3rd arg that specifies the name of a
++  logging subsystem to use.  If none is given, the base logger is used
++
++* Thu Mar 04 2010  <rrati at redhat> - 1.1-0.1
++- run_cmd takes an optional 3rd arg that specifies environment vars to set
++
++* Mon Jan 26 2010  <rrati at redhat> - 1.0-14
++- Fixed handling of multiple args using Popen in run_cmd
++- Added comments to a few methods
++- Fixed type in run_cmd when using the popen2 module
++
++* Fri Sep 11 2009  <rrati at redhat> - 1.0-13
++- Use popen2 module instead of subprocess on python versions that don't
++  have the subprocess module (BZ522467)
++
++* Tue Aug 18 2009  <rrati at redhat> - 1.0-12
++- Job hooks use JOB_HOOK as keyword instead of LL_HOOK
++- Fixed version numbering
++
++* Tue Aug 18 2009  <rrati at redhat> - 1.0-11
++- Split documentation into two files, one for carod and one for
++  the job-hooks
++
++* Mon Aug 17 2009  <rrati at redhat> - 1.0-10
++- Minor cleanup in common functions
++
++* Mon Jul 27 2009  <rrati at redhat> - 1.0-9
++- Renamed condor-job-hooks-common to python-condor-job-hooks-common to
++  conform to packaging guidelines since the package installs in
++  python sitelib.
++
++* Mon Jul 27 2009  <rrati at redhat> - 1.0-8
++- Fix rpmlint/packaging issues
++
++* Wed Jun 24 2009  <rrati at redhat> - 1.0-7
++- Hooks will first look for their configuration in condor's configuration
++  files, then fall back to their config file
++- The config file has moved from /etc/opt/grid to /etc/condor
++
++* Tue Jun  2 2009  <rrati at redhat> - 1.0-6
++- Fixed an exception condition in the prepare hook that wasn't handled
++  correctly
++
++* Fri Feb 13 2009  <rrati at redhat> - 1.0-5
++- Change source tarball name
++
++* Fri Dec  5 2008  <rrati at redhat> - 1.0-4
++- Cleaned up socket close code to provide cleaner shutdown
++
++* Wed Dec  3 2008  <rrati at redhat> - 1.0-3
++- Fixed python dependency issue with RHEL4
++- Fixed issues running on python 2.3
++
++* Fri Nov  4 2008  <rrati at redhat> - 1.0-2
++- Add changelog
++- Fix rpmlint issues
++
++* Fri Nov  4 2008  <rrati at redhat> - 1.0-1
++- Initial packaging
+-- 
+1.7.6.5
+
diff --git a/0012-Renamed-INSTALL-CONFIG.patch b/0012-Renamed-INSTALL-CONFIG.patch
new file mode 100644
index 0000000..3384c5f
--- /dev/null
+++ b/0012-Renamed-INSTALL-CONFIG.patch
@@ -0,0 +1,87 @@
+From 51fbbf8ca02f2dbaa5207edb9e22e3d6701b5fa4 Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Mon, 16 Jan 2012 12:10:01 -0600
+Subject: [PATCH 12/13] Renamed INSTALL->CONFIG
+
+---
+ CONFIG                   |   23 +++++++++++++++++++++++
+ INSTALL                  |   23 -----------------------
+ condor-job-hooks.spec.in |    2 +-
+ 3 files changed, 24 insertions(+), 24 deletions(-)
+ create mode 100644 CONFIG
+ delete mode 100644 INSTALL
+
+diff --git a/CONFIG b/CONFIG
+new file mode 100644
+index 0000000..4199502
+--- /dev/null
++++ b/CONFIG
+@@ -0,0 +1,23 @@
++The Condor job hooks will first look for their configuration in condor's
++configuration files.  The following parameters can be placed in a condor
++configuration file to configure the job hooks:
++
++JOB_HOOKS_IP:
++   Type: IP Address
++   Desc: The IP address of a translation daemon
++
++JOB_HOOKS_PORT:
++   Type: Integer
++   Desc: The port on JOB_HOOKS_IP the translation daemon is listening
++         for connections
++
++JOB_HOOKS_LOG:
++   Type: String
++   Desc: The location of the log file for the job-hooks to use for logging
++
++MAX_JOB_HOOKS_LOG:
++   Type: Interger
++   Desc: The maximum size of the job-hooks log before rotating
++
++If the configuration is not found in condor's configuration files, then
++the job hooks will look in /etc/condor/job-hooks.conf.
+diff --git a/INSTALL b/INSTALL
+deleted file mode 100644
+index 4199502..0000000
+--- a/INSTALL
++++ /dev/null
+@@ -1,23 +0,0 @@
+-The Condor job hooks will first look for their configuration in condor's
+-configuration files.  The following parameters can be placed in a condor
+-configuration file to configure the job hooks:
+-
+-JOB_HOOKS_IP:
+-   Type: IP Address
+-   Desc: The IP address of a translation daemon
+-
+-JOB_HOOKS_PORT:
+-   Type: Integer
+-   Desc: The port on JOB_HOOKS_IP the translation daemon is listening
+-         for connections
+-
+-JOB_HOOKS_LOG:
+-   Type: String
+-   Desc: The location of the log file for the job-hooks to use for logging
+-
+-MAX_JOB_HOOKS_LOG:
+-   Type: Interger
+-   Desc: The maximum size of the job-hooks log before rotating
+-
+-If the configuration is not found in condor's configuration files, then
+-the job hooks will look in /etc/condor/job-hooks.conf.
+diff --git a/condor-job-hooks.spec.in b/condor-job-hooks.spec.in
+index 490b3ef..8b7738e 100644
+--- a/condor-job-hooks.spec.in
++++ b/condor-job-hooks.spec.in
+@@ -71,7 +71,7 @@ rm -rf %{buildroot}
+ %if %{building_for_el5}
+ %defattr(-,root,root,-)
+ %endif
+-%doc LICENSE-2.0.txt INSTALL
++%doc LICENSE-2.0.txt CONFIG
+ %defattr(0755,root,root,-)
+ %_libexecdir/condor/hooks/hook_fetch_work.py*
+ %_libexecdir/condor/hooks/hook_job_exit.py*
+-- 
+1.7.6.5
+
diff --git a/0013-Updated-spec-to-1.5-5.patch b/0013-Updated-spec-to-1.5-5.patch
new file mode 100644
index 0000000..cd3a7a7
--- /dev/null
+++ b/0013-Updated-spec-to-1.5-5.patch
@@ -0,0 +1,27 @@
+From 744d0b477123331a1f01ddb004ea4d9ebc6aa0c5 Mon Sep 17 00:00:00 2001
+From: Robert Rati <rrati at redhat.com>
+Date: Mon, 16 Jan 2012 12:17:18 -0600
+Subject: [PATCH 13/13] Updated spec to 1.5-5
+
+---
+ condor-job-hooks.spec.in |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/condor-job-hooks.spec.in b/condor-job-hooks.spec.in
+index 8b7738e..8d23e3e 100644
+--- a/condor-job-hooks.spec.in
++++ b/condor-job-hooks.spec.in
+@@ -92,6 +92,10 @@ rm -rf %{buildroot}
+ %{python_sitelib}/condorutils/workfetch.py*
+ 
+ %changelog
++* Mon Jan 16 2012  <rrati at redhat> - 1.5-5
++- Packaging improvements
++- Renamed INSTALL file to CONFIG
++
+ * Wed Jul 22 2011  <rrati at redhat> - 1.5-4
+ - Added optional arg to read_condor_config to control lookup of param without
+   subsystem
+-- 
+1.7.6.5
+
diff --git a/condor-job-hooks.spec b/condor-job-hooks.spec
index 0d7791b..152fb93 100644
--- a/condor-job-hooks.spec
+++ b/condor-job-hooks.spec
@@ -1,16 +1,33 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?is_fedora: %define is_fedora %(/bin/sh -c "if [ -e /etc/fedora-release ];then echo '1'; fi")}
-%global rel 4
+
+%if (0%{?fedora} == 0 && 0%{?rhel} <= 5)
+%global building_for_el5 1
+%else
+%global building_for_el5 0
+%endif
 
 Summary: Condor Job Hooks
 Name: condor-job-hooks
 Version: 1.5
-Release: %{rel}%{?dist}.1
+Release: 5%{?dist}
 License: ASL 2.0
 Group: Applications/System
 URL: http://git.fedorahosted.org/git/grid/job_hooks.git
-Source0: %{name}-%{version}-%{rel}.tar.gz
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Source0: https://fedorahosted.org/releases/g/r/grid/%{name}-%{version}.tar.gz
+Patch0: 0001-Correctly-parse-windows-commandline-in-run_cmd.patch
+Patch1: 0002-Added-comment-on-new-_cmdline2list-method.patch
+Patch2: 0003-Updated-spec-to-1.5-2.patch
+Patch3: 0004-Fixed-bugs-in-read_condor_config.-If-multiple-params.patch
+Patch4: 0005-Updated-spec-to-1.5-3.patch
+Patch5: 0006-Add-parameter-to-read_condor_config-to-disallow-look.patch
+Patch6: 0007-Fixed-typo.patch
+Patch7: 0008-Fixed-error-message-raised-from-read_condor_config-i.patch
+Patch8: 0009-Updated-spec-to-1.5-4.patch
+Patch9: 0010-Added-VERSION-file.patch
+Patch10: 0011-Packaing-improvements.patch
+Patch11: 0012-Renamed-INSTALL-CONFIG.patch
+Patch12: 0013-Updated-spec-to-1.5-5.patch
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-XXXXXX)
 BuildArch: noarch
 Requires: python >= 2.3
 Requires: condor >= 7.0.2-4
@@ -35,6 +52,20 @@ Common functions and utilities used by condor features.
 %prep
 %setup -q
 
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+
 %build
 
 %install
@@ -47,7 +78,7 @@ rm -f %{buildroot}/%_libexecdir/condor/hooks/hook_evict_claim.*
 cp -f module/*.py %{buildroot}/%{python_sitelib}/condorutils
 
 %post
-%if 0%{?is_fedora} == 0
+%if 0%{?fedora} == 0
 if [[ -f /etc/opt/grid/job-hooks.conf ]]; then
    mv -f /etc/opt/grid/job-hooks.conf /etc/condor
    rmdir --ignore-fail-on-non-empty -p /etc/opt/grid
@@ -55,12 +86,16 @@ fi
 %endif
 exit 0
 
+%if %{building_for_el5}
 %clean
 rm -rf %{buildroot}
+%endif
 
 %files
+%if %{building_for_el5}
 %defattr(-,root,root,-)
-%doc LICENSE-2.0.txt INSTALL
+%endif
+%doc LICENSE-2.0.txt CONFIG
 %defattr(0755,root,root,-)
 %_libexecdir/condor/hooks/hook_fetch_work.py*
 %_libexecdir/condor/hooks/hook_job_exit.py*
@@ -69,7 +104,9 @@ rm -rf %{buildroot}
 %_libexecdir/condor/hooks/hook_update_job_status.py*
 
 %files -n python-condorutils
+%if %{building_for_el5}
 %defattr(-,root,root,-)
+%endif
 %doc LICENSE-2.0.txt
 %{python_sitelib}/condorutils/__init__.py*
 %{python_sitelib}/condorutils/log.py*
@@ -79,6 +116,10 @@ rm -rf %{buildroot}
 %{python_sitelib}/condorutils/workfetch.py*
 
 %changelog
+* Mon Jan 16 2012  <rrati at redhat> - 1.5-5
+- Packaging improvements
+- Renamed INSTALL file to CONFIG
+
 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5-4.1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
diff --git a/sources b/sources
index 8c0bb2e..9d418f8 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f373e79e617dc5beb8ee6a01bba378e4  condor-job-hooks-1.5-4.tar.gz
+962f8f764b1bd7a339244555800d194d  condor-job-hooks-1.5.tar.gz


More information about the scm-commits mailing list