Bug 22483 - Fehlende fileencoding Information, quoting, STDERR für interne Fehler, temporäre Dateien
Fehlende fileencoding Information, quoting, STDERR für interne Fehler, tempor...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: ucslint
UCS 3.0
All Linux
: P5 normal (vote)
: UCS 3.1
Assigned To: Philipp Hahn
Lukas Walter
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-11 09:08 CEST by Philipp Hahn
Modified: 2012-12-12 21:11 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2011-05-11 09:08:27 CEST
--- 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:
Comment 1 Philipp Hahn univentionstaff 2012-07-20 20:00:14 CEST
Eingepflegt.

svn34324, ucslint_3.0.0-1
Comment 2 Lukas Walter univentionstaff 2012-10-15 12:14:02 CEST
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.
Comment 3 Stefan Gohmann univentionstaff 2012-12-12 21:11:04 CET
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".