Add backslash to special characters to prevent regexp breaking with some files, such as libstd++
Javier Fernandez-Sanguino
11 years ago
286 | 286 | if ( f.startswith('/lib/') or f.startswith('/usr/lib/') ) and re.compile("\.so[\d.]+$"): |
287 | 287 | # For libraries that do not exist then try to use a regular expression with the |
288 | 288 | # soname |
289 | f = re.compile("\.so[\d.]+$").sub(".so.*", f) | |
289 | # In libraries, indent characters that could belong to a regular expression first | |
290 | f = re.compile("\+").sub("\+", f) | |
291 | f = re.compile(".so[\d.]+$").sub(".so.*", f) | |
292 | f = re.compile("\.").sub("\.", f) | |
290 | 293 | file_regexp = True |
291 | 294 | else: |
292 | 295 | # Do not call dpkg-query if the file simply does not exist in the file system |