external_tools.py 6.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.

EXTERNAL_TOOLS = {
21 22 23
    'abootimg': {
        'debian': 'abootimg',
    },
24
    'apktool': {
25
        'debian': 'apktool',
26
    },
27 28 29
    'db_dump': {
        'debian': 'db-util',
    },
30 31 32
    'bsdtar': {
        'debian': 'libarchive-tools',
        'arch': 'libarchive',
33
        'fedora': 'bsdtar',
34 35
        'FreeBSD': 'libarchive',
    },
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    'bzip2': {
        'debian': 'bzip2',
        'arch': 'bzip2',
    },
    'cbfstool': {
    },
    'cd-iccdump': {
        'debian': 'colord',
        'arch': 'colord',
        'FreeBSD': 'colord',
    },
    'cmp': {
        'debian': 'diffutils',
        'arch': 'diffutils',
    },
51 52 53 54
    'compare': {
        'debian': 'imagemagick',
        'arch': 'imagemagick',
    },
55 56 57 58 59 60 61 62
    'cpio': {
        'debian': 'cpio',
        'arch': 'cpio',
    },
    'diff': {
        'debian': 'diffutils',
        'arch': 'diffutils',
    },
63 64
    'docx2txt': {
        'debian': 'docx2txt',
65
        'arch': 'docx2txt',
66
    },
67 68 69 70
    'enjarify': {
        'debian': 'enjarify',
        'arch': 'enjarify',
    },
71 72
    'fdtdump': {
        'debian': 'device-tree-compiler',
73
        'arch': 'dtc',
74
    },
75 76 77 78 79 80 81 82 83 84 85 86
    'file': {
        'debian': 'file',
        'arch': 'file',
    },
    'find': {
        'debian': 'findutils',
        'arch': 'findutils',
    },
    'getfacl': {
        'debian': 'acl',
        'arch': 'acl',
    },
87 88
    'gifbuild': {
        'debian': 'giflib-tools',
89
        'arch': 'giflib',
90
    },
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
    'ghc': {
        'debian': 'ghc',
        'arch': 'ghc',
        'FreeBSD': 'ghc',
    },
    'gpg': {
        'debian': 'gnupg',
        'arch': 'gnupg',
        'FreeBSD': 'gnupg',
    },
    'gzip': {
        'debian': 'gzip',
        'arch': 'gzip',
    },
    'identify': {
        'debian': 'imagemagick',
        'arch': 'imagemagick',
    },
    'img2txt': {
        'debian': 'caca-utils',
        'arch': 'libcaca',
        'FreeBSD': 'libcaca',
    },
    'isoinfo': {
        'debian': 'genisoimage',
116
        'arch': 'cdrtools',
117 118 119 120 121 122 123 124
        'FreeBSD': 'cdrtools',
    },
    'javap': {
        'debian': 'default-jdk-headless | default-jdk | java-sdk',
        'arch': 'java-environment',
    },
    'js-beautify': {
        'debian': 'jsbeautifier',
125
        'arch': 'python-jsbeautifier',
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
    },
    'llvm-bcanalyzer': {
        'debian': 'llvm',
        'arch': 'llvm',
    },
    'llvm-config': {
        'debian': 'llvm',
        'arch': 'llvm',
    },
    'llvm-dis': {
        'debian': 'llvm',
        'arch': 'llvm',
    },
    'ls': {
        'debian': 'coreutils',
        'arch': 'coreutils',
    },
    'lsattr': {
        'debian': 'e2fsprogs',
        'arch': 'e2fsprogs',
        'FreeBSD': 'e2fsprogs',
    },
Xavier Briand's avatar
Xavier Briand committed
148
    'lz4': {
149
        'debian': 'lz4 | liblz4-tool',
Xavier Briand's avatar
Xavier Briand committed
150 151
        'FreeBSD': 'lz4',
    },
152 153 154 155 156 157 158 159 160 161 162 163 164
    'msgunfmt': {
        'debian': 'gettext',
        'arch': 'gettext',
        'FreeBSD': 'gettext-tools',
    },
    'convert': {
        'debian': 'imagemagick',
        'arch': 'imagemagick',
    },
    'nm': {
        'debian': 'binutils-multiarch',
        'arch': 'binutils',
    },
165 166 167 168
    'objcopy': {
        'debian': 'binutils-multiarch',
        'arch': 'binutils',
    },
169 170 171 172
    'objdump': {
        'debian': 'binutils-multiarch',
        'arch': 'binutils',
    },
173 174 175
    'ocamlobjinfo': {
        'debian': 'ocaml-nox',
    },
176 177
    'odt2txt': {
        'debian': 'odt2txt',
178
        'arch': 'odt2txt',
179
    },
180 181 182
    'oggDump': {
        'debian': 'oggvideotools',
    },
183 184
    'pgpdump': {
        'debian': 'pgpdump',
185
        'arch': 'pgpdump',
186
    },
187 188 189 190 191 192 193
    'pdftotext': {
        'debian': 'poppler-utils',
        'arch': 'poppler',
        'FreeBSD': 'poppler-utils',
    },
    'pedump': {
        'debian': 'mono-utils',
194
        'arch': 'mono',
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
        'FreeBSD': 'mono',
    },
    'ppudump': {
        'debian': 'fp-utils',
        'arch': 'fpc',
        'FreeBSD': 'fpc',
    },
    'ps2ascii': {
        'debian': 'ghostscript',
        'arch': 'ghostscript',
        'FreeBSD': 'ghostscript9-base',
    },
    'readelf': {
        'debian': 'binutils-multiarch',
        'arch': 'binutils',
    },
    'rpm2cpio': {
        'debian': 'rpm2cpio',
        'arch': 'rpmextract',
        'FreeBSD': 'rpm2cpio',
    },
216 217
    'Rscript': {
        'debian': 'r-base-core',
218
        'arch': 'r',
219
    },
220 221 222 223 224 225
    'showttf': {
        'debian': 'fontforge-extras',
    },
    'sng': {
        'debian': 'sng',
    },
226 227
    'ssconvert': {
        'debian': 'gnumeric',
228
        'arch': 'gnumeric',
229
    },
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
    'ssh-keygen': {
        'debian': 'openssh-client',
        'arch': 'openssh',
    },
    'stat': {
        'debian': 'coreutils',
        'arch': 'coreutils',
    },
    'sqlite3': {
        'debian': 'sqlite3',
        'arch': 'sqlite',
        'FreeBSD': 'sqlite3',
    },
    'tar': {
        'debian': 'tar',
        'arch': 'tar',
    },
247 248
    'tcpdump': {
        'debian': 'tcpdump',
249
        'arch': 'tcpdump',
250
    },
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
    'unsquashfs': {
        'debian': 'squashfs-tools',
        'arch': 'squashfs-tools',
        'FreeBSD': 'squashfs-tools',
    },
    'xxd': {
        'debian': 'xxd | vim-common',
        'arch': 'vim',
        'FreeBSD': 'vim | vim-lite',
    },
    'xz': {
        'debian': 'xz-utils',
        'arch': 'xz',
    },
    'zipinfo': {
        'debian': 'unzip',
        'arch': 'unzip',
        'FreeBSD': 'unzip',
    },
270
    'procyon': {
271 272
        'debian': 'procyon-decompiler',
    },
273
    'dumpxsb': {
274
        'debian': 'xmlbeans',
Chris Lamb's avatar
Chris Lamb committed
275
    },
276
}
277 278 279 280 281

# May be populated at runtime by remapped names like
# readelf -> arm-none-eabi-readelf, etc
# diff -> gdiff, etc
REMAPPED_TOOL_NAMES = {}
282 283 284 285 286 287 288 289 290 291 292 293 294 295

# GNU programs whose names differ on some non-GNU systems such as FreeBSD etc
# AND where the CLI or output of the programs differ from the non-GNU system
# versions. In these cases, add them here and make sure you wrap uses of them
# in get_tool_name() to pick up the alternate names.
#
# If we only use POSIX CLI options and the output is identical to the system
# version (so that our tests don't break) then it's unnecessary to add it here.
GNU_TOOL_NAMES = {
    'diff',
    'readelf',
    'objcopy',
    'objdump',
}