[Git][reproducible-builds/reproducible-notes][master] use py3 and fix flake8 issues
Mattia Rizzolo
gitlab at salsa.debian.org
Tue Nov 6 10:01:39 CET 2018
Mattia Rizzolo pushed to branch master at Reproducible Builds / reproducible-notes
Commits:
49d1c0bc by Mattia Rizzolo at 2018-11-06T09:01:33Z
use py3 and fix flake8 issues
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
1 changed file:
- hooks/pre-receive
Changes:
=====================================
hooks/pre-receive
=====================================
@@ -1,23 +1,23 @@
-#!/usr/bin/python
+#!/usr/bin/python3
-from __future__ import print_function
-
-import os.path
import subprocess
import sys
import yaml
+
def read_from_git(ref, path):
return subprocess.check_output(
['git', 'show', '%s:%s' % (ref, path)],
shell=False, close_fds=True)
+
def validate_issues(issues):
for name, data in issues.iteritems():
if 'description' not in data:
print('ERROR: issue %s is missing a description' % name, file=sys.stderr)
sys.exit(1)
+
def ensure_issues_are_known(issues, packages):
for package, data in packages.iteritems():
for issue in data.get('issues', []):
@@ -25,6 +25,7 @@ def ensure_issues_are_known(issues, packages):
print('ERROR: issue %s not listed in issues.yml' % issue, file=sys.stderr)
sys.exit(1)
+
def main():
for ref_line in sys.stdin:
old_value, new_value, ref_name = ref_line.strip().split(' ', 3)
@@ -33,5 +34,6 @@ def main():
validate_issues(issues)
ensure_issues_are_known(issues, packages)
+
if __name__ == '__main__':
main()
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-notes/commit/49d1c0bc6ded847dc529243bf71dd2970e894e3a
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-notes/commit/49d1c0bc6ded847dc529243bf71dd2970e894e3a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20181106/29160c1d/attachment.html>
More information about the rb-commits
mailing list