Univention Bugzilla – Bug 22483
Fehlende fileencoding Information, quoting, STDERR für interne Fehler, temporäre Dateien
Last modified: 2012-12-12 21:11:04 CET
--- ucslint/__init__.py (Revision 24046) +++ ucslint/__init__.py (Revision 24044) @@ -1,4 +1,4 @@ -#!/usr/bin/python +# -*- coding: utf-8 -*- # # Univention Tools # modules init --- ucslint-sort-output.py (Revision 24046) +++ ucslint-sort-output.py (Revision 24044) @@ -1,6 +1,8 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- # -import sys, os, re +import sys +import re if len(sys.argv) < 2: print 'ucslint-sort-output.py <filename>' --- bin/ucslint (Revision 24046) +++ bin/ucslint (Revision 24044) @@ -1,4 +1,4 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # # Univention ucslint @@ -31,7 +31,10 @@ # <http://www.gnu.org/licenses/>. # # -import os, sys, imp, optparse +import os +import sys +import imp +import optparse try: import univention.ucslint.base as uub except ImportError: @@ -136,10 +139,6 @@ raise Exception('msgid contains invalid characters: %s' % msgid) return '%d' % int(msgid) - -def usage(): - print 'ucslint [-d] [<path>]' - if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option( '-d', '--debug', action = 'store', type = 'int', @@ -181,15 +180,15 @@ pkgpath = args[0] if not os.path.exists( pkgpath ): - print "ERROR: directory %s does not exist!" % pkgpath + print >>sys.stderr, "ERROR: directory %s does not exist!" % pkgpath sys.exit(1) if not os.path.isdir( pkgpath ): - print "ERROR: %s is no directory!" % pkgpath + print >>sys.stderr, "ERROR: %s is no directory!" % pkgpath sys.exit(1) if not os.path.isdir( os.path.join(pkgpath, 'debian') ): - print "ERROR: %s/debian does not exist or is not a directory!" % pkgpath + print >>sys.stderr, "ERROR: %s/debian does not exist or is not a directory!" % pkgpath sys.exit(1) plugindirs = [ '~/.ucslint', '/usr/lib/python2.4/site-packages/univention/ucslint', '/usr/lib/pymodules/python2.6/univention/ucslint' ] @@ -225,4 +224,3 @@ if exitcode_cnt: sys.exit(1) sys.exit(0) - --- testucslint.sh (Revision 24046) +++ testucslint.sh (Revision 24044) @@ -1,42 +1,41 @@ -#!/bin/sh +#!/bin/bash # -RETVAL=0 +# Run ucslint on test framework +# +declare -i RETVAL=0 if [ "$1" = "--update" ] ; then update="1" fi TMPFN=$(mktemp) +trap "rm -f '$TMPFN'" EXIT for dir in testframework/* ; do if [ -d "$dir" ] ; then - echo "---------------------------------------------------------------" - echo "Testing $dir" - echo "---------------------------------------------------------------" + echo -n "Testing $dir " - DIRNAME=$(basename $dir) + DIRNAME=$(basename "$dir") MODULE="${DIRNAME:0:4}" - ./ucslint.py -p "ucslint" -m $MODULE "${dir}" > $TMPFN - ./ucslint-sort-output.py $TMPFN > ${dir}.test + PYTHONPATH=. \ + bin/ucslint -p "ucslint" -m "$MODULE" "${dir}" >"$TMPFN" + ./ucslint-sort-output.py "$TMPFN" >"${dir}.test" - diff "${dir}.correct" "${dir}.test" > /dev/null - RET="$?" - echo -n "Testresult: " - if [ ! "$RET" = "0" ] ; then - RETVAL=1 - echo "FAILED" - else - echo "OK" + if diff "${dir}.correct" "${dir}.test" >/dev/null 2>&1 + then + echo "OK" + else + echo "FAILED" + RETVAL+=1 fi if [ -n "$update" ] ; then echo "USING TESTRESULT AS NEW TEST TEMPLATE" cp "${dir}.test" "${dir}.correct" fi - - echo fi done exit $RETVAL +# vim:set ts=4 sw=4 et:
Eingepflegt. svn34324, ucslint_3.0.0-1
Im Zuge von svnn34324 gab es nur kleine cleanup Änderungen. Die bin ich durchgegangen und konnte keine Probleme fest stellen, das Verhalten bleibt im Wesentlichen (abgesehen von differenziertem Exception Handling) unverändert. Changelog nicht nötig da funktional keine Änderung, Verified.
UCS 3.1-0 has been released: http://forum.univention.de/viewtopic.php?f=54&t=2125 If this error occurs again, please use "Clone This Bug".