X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm.macros;h=8537d8ad108432d4f03296fda34e258d6f2af89c;hb=4334275f2a234f077151f1d0090f635b46cb7e72;hp=a52fcbb5cbc5829af64cf6222adc3691677e09a3;hpb=9639d726090cf14615a8a62e36838e9e0413c5db;p=packages%2Frpm-build-macros.git diff --git a/rpm.macros b/rpm.macros index a52fcbb..8537d8a 100644 --- a/rpm.macros +++ b/rpm.macros @@ -1859,7 +1859,7 @@ io.open("/etc/shells", "w"):write(s)\ # # Requirements: # BuildRequires: python -# BuildRequires: rpmbuild(macros) >= 1.469 +# BuildRequires: rpmbuild(macros) >= 1.602 %py_lint() \ __py_lint() { \ @@ -1867,7 +1867,7 @@ find "$@" -type f -name '*.py' | python -c ' \ import sys \ import compiler \ \ -err = 0\ +found = err = 0\ for f in sys.stdin: \ fd = open(f.strip()) \ c = fd.read() \ @@ -1878,7 +1878,10 @@ for f in sys.stdin: \ print "py_lint: %s: %s" % (f.strip(), e) \ err = err + 1\ \ -if err: \ +if not found:\ + print >> sys.stderr, "\\npy_lint: ERROR: No files processed.\\n" \ + sys.exit(1) \ +elif err: \ print >> sys.stderr, "\\npy_lint: ERROR: Syntax errors in %d files.\\n" % err \ sys.exit(1) \ else: \