Univention Bugzilla – Bug 22482
Pruning von .svn Unterverzecihnissen
Last modified: 2012-12-12 21:09:40 CET
--- ucslint/0004-CheckUCR.py (Revision 24046) +++ ucslint/0004-CheckUCR.py (Revision 24044) @@ -94,10 +94,11 @@ if os.path.isdir( os.path.join(path, 'conffiles') ): for dirpath, dirnames, filenames in os.walk( os.path.join( path, 'conffiles' ) ): - if not '/.svn/' in dirpath and not dirpath.endswith('/.svn'): # ignore svn files - for fn in filenames: - if not fn.endswith('~'): - conffiles[ os.path.join( dirpath, fn ) ] = { 'headerfound': False, 'variables': [], 'placeholder': [], 'bcwarning': False, 'ucrwarning': False } + try: dirnames.remove('.svn') # prune svn directory + except ValueError: pass + for fn in filenames: + if not fn.endswith('~'): + conffiles[ os.path.join( dirpath, fn ) ] = { 'headerfound': False, 'variables': [], 'placeholder': [], 'bcwarning': False, 'ucrwarning': False } self.debug('found conffiles: %s' % conffiles.keys()) --- ucslint/0002-CopyPasteErrors.py (Revision 24046) +++ ucslint/0002-CopyPasteErrors.py (Revision 24044) @@ -44,8 +44,8 @@ # scan directory recursively for dir in [ 'conffiles' ]: for dirpath, dirnames, filenames in os.walk( os.path.join(path, dir) ): - if '/.svn/' in dirpath or dirpath.endswith('/.svn'): # ignore svn files - continue + try: dirnames.remove('.svn') # prune svn directory + except ValueError: pass for fn in filenames: files.append( os.path.join( dirpath, fn ) ) --- ucslint/0010-Copyright.py (Revision 24046) +++ ucslint/0010-Copyright.py (Revision 24044) @@ -47,8 +47,8 @@ # looking for python files for dirpath, dirnames, filenames in os.walk( path ): - if '.svn' in dirnames: - dirnames.remove('.svn') + try: dirnames.remove('.svn') # prune svn directory + except ValueError: pass for fn in filenames: if fn.endswith('~'): continue --- ucslint/0009-Python.py (Revision 24046) +++ ucslint/0009-Python.py (Revision 24044) @@ -34,8 +34,8 @@ py_files = [] for dirpath, dirnames, filenames in os.walk( path ): - if '/.svn/' in dirpath or dirpath.endswith('/.svn'): # ignore svn files - continue + try: dirnames.remove('.svn') # prune svn directory + except ValueError: pass for fn in filenames: if fn.endswith('~'): continue
Es wird jetzt durchgehend FilteredDirWalkGenerator() verwendet, was die .svn-Unterverzeichnisse richtig behandelt. svn34322, ucslint_3.0.0-1
(In reply to comment #1) > Es wird jetzt durchgehend FilteredDirWalkGenerator() verwendet, was die > .svn-Unterverzeichnisse richtig behandelt. > > svn34322, ucslint_3.0.0-1 Stimmt. Changelog passt, 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".