Commit 428bbfaa authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Fix a file(1)-related regression where .changes files that contained non-ASCII...

Fix a file(1)-related regression where .changes files that contained non-ASCII text were not identified as such, therefore resulting in seemingly arbitrary packages on (for example) tests.reproducible-builds.org not actually comparing the files themselves. The non-ASCII parts could have been in the Maintainer or in the upload changelog. (Closes: #291)
parent b0fb9c56
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -237,7 +237,13 @@ class DotChangesFile(DebControlFile):

    # .changes files can be identified "data" if they contain non-printable
    # characters (Re: reproducible-builds/diffoscope#286)
    FILE_TYPE_RE = re.compile(r"^(ASCII text|UTF-8 Unicode text|data)")
    #
    # In addition, different versions of file(1) can emit "UTF-8 Unicode text"
    # or "UTF-8 Unicode text" for .changes files that use non-ASCII characters,
    # so we have to look for both. (Re: reproducible-builds/diffoscope#291)
    FILE_TYPE_RE = re.compile(
        r"^(ASCII text|UTF-8 Unicode text|data|Unicode text, UTF-8 text)"
    )

    @classmethod
    def recognizes(cls, file):