[Reproducible-commits] [notes] 01/01: Revert "Work around lack of python-yaml on moszumanska"

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Jan 14 18:47:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository notes.

commit 316b06978e600ce26c17c7486424e71cd15a51b3
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Jan 14 19:47:13 2015 +0100

    Revert "Work around lack of python-yaml on moszumanska"
    
    It's now available.
    
    This reverts commit f44f7a60c3e57cd7ff598763d91914f06545a9be.
---
 hooks/pre-receive | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/hooks/pre-receive b/hooks/pre-receive
index d52ca11..2ef4bba 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -5,11 +5,7 @@ from __future__ import print_function
 import os.path
 import subprocess
 import sys
-
-# not available on Aliath (yet?)
-#import yaml
-# XXX:
-import json
+import yaml
 
 def read_from_git(ref, path):
     return subprocess.check_output(
@@ -29,21 +25,11 @@ def ensure_issues_are_known(issues, packages):
                 print('ERROR: issue %s not listed in issues.yml' % issue, file=sys.stderr)
                 sys.exit(1)
 
-def yaml_load(content):
-    cmd = ['ruby', '-ryaml', '-rjson', '-e', 'print JSON.dump(YAML.load($stdin))']
-    p = subprocess.Popen(cmd, shell=False, close_fds=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-    out, err = p.communicate(content)
-    p.wait()
-    if p.returncode != 0:
-        print("%s failed with %d. Output:\n%s\n" % (cmd, p.returncode, out), file=sys.stderr)
-        sys.exit(2)
-    return json.loads(out)
-
 def main():
     for ref_line in sys.stdin:
         old_value, new_value, ref_name = ref_line.strip().split(' ', 3)
-        issues = yaml_load(read_from_git(new_value, 'issues.yml'))
-        packages = yaml_load(read_from_git(new_value, 'packages.yml'))
+        issues = yaml.load(read_from_git(new_value, 'issues.yml'))
+        packages = yaml.load(read_from_git(new_value, 'packages.yml'))
         validate_issues(issues)
         ensure_issues_are_known(issues, packages)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/notes.git



More information about the Reproducible-commits mailing list