[ARVADOS] updated: f69d1a2009372ac539eec3bf77d92a55e6b9cd3c

git at public.curoverse.com git at public.curoverse.com
Tue Sep 23 08:31:09 EDT 2014


Summary of changes:
 sdk/python/setup.py    | 10 +++++-----
 services/fuse/setup.py | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

       via  f69d1a2009372ac539eec3bf77d92a55e6b9cd3c (commit)
      from  d1d36072ccb3147249bedf2d542e936e1d1665bc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f69d1a2009372ac539eec3bf77d92a55e6b9cd3c
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Sep 23 08:33:01 2014 -0400

    Fixup: Handle case of running inside an unrelated git repo.
    
    `git log` will return empty output in this case.

diff --git a/sdk/python/setup.py b/sdk/python/setup.py
index 7c94c75..5ae4e64 100644
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -10,14 +10,14 @@ README = os.path.join(SETUP_DIR, 'README.rst')
 
 cmd_opts = {'egg_info': {}}
 try:
-    git_tag = subprocess.check_output(
+    git_tags = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ci %h', SETUP_DIR])
-except (OSError, subprocess.CalledProcessError):
+         '--format=format:%ci %h', SETUP_DIR]).split()
+    assert len(git_tags) == 4
+except (AssertionError, OSError, subprocess.CalledProcessError):
     pass
 else:
-    git_tags = git_tag.split()
-    del git_tags[-2]   # Remove timezone
+    del git_tags[2]    # Remove timezone
     for ii in [0, 1]:  # Remove non-digits from other datetime fields
         git_tags[ii] = ''.join(c for c in git_tags[ii] if c.isdigit())
     cmd_opts['egg_info']['tag_build'] = '.{}{}.{}'.format(*git_tags)
diff --git a/services/fuse/setup.py b/services/fuse/setup.py
index 596e356..3ea28cb 100644
--- a/services/fuse/setup.py
+++ b/services/fuse/setup.py
@@ -10,14 +10,14 @@ README = os.path.join(SETUP_DIR, 'README.rst')
 
 cmd_opts = {'egg_info': {}}
 try:
-    git_tag = subprocess.check_output(
+    git_tags = subprocess.check_output(
         ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ci %h', SETUP_DIR])
-except (OSError, subprocess.CalledProcessError):
+         '--format=format:%ci %h', SETUP_DIR]).split()
+    assert len(git_tags) == 4
+except (AssertionError, OSError, subprocess.CalledProcessError):
     pass
 else:
-    git_tags = git_tag.split()
-    del git_tags[-2]   # Remove timezone
+    del git_tags[2]    # Remove timezone
     for ii in [0, 1]:  # Remove non-digits from other datetime fields
         git_tags[ii] = ''.join(c for c in git_tags[ii] if c.isdigit())
     cmd_opts['egg_info']['tag_build'] = '.{}{}.{}'.format(*git_tags)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list