diffoscope.1 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
  2. .TH DIFFOSCOPE "1" "September 2018" "diffoscope 100" "User Commands"
  3. .SH NAME
  4. diffoscope \- in-depth comparison of files, archives, and directories
  5. .
  6. .nr rst2man-indent-level 0
  7. .
  8. .de1 rstReportMargin
  9. \\$1 \\n[an-margin]
  10. level \\n[rst2man-indent-level]
  11. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  12. -
  13. \\n[rst2man-indent0]
  14. \\n[rst2man-indent1]
  15. \\n[rst2man-indent2]
  16. ..
  17. .de1 INDENT
  18. .\" .rstReportMargin pre:
  19. . RS \\$1
  20. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  21. . nr rst2man-indent-level +1
  22. .\" .rstReportMargin post:
  23. ..
  24. .de UNINDENT
  25. . RE
  26. .\" indent \\n[an-margin]
  27. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .nr rst2man-indent-level -1
  29. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  30. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  31. ..
  32. .SH SYNOPSIS
  33. .nf
  34. \fBdiffoscope\fR \-\-help
  35. \fBdiffoscope\fR [OPTIONS] [\-\-json \fIoutput_diff\fR] \fIpath1\fR \fIpath2\fR
  36. \fBdiffoscope\fR [OPTIONS] \fIdiff\fR
  37. \fBdiffoscope\fR [OPTIONS] < \fIdiff\fR
  38. .fi
  39. .\" Man page generated from reStructuredText.
  40. .
  41. .SH DESCRIPTION
  42. .sp
  43. diffoscope will try to get to the bottom of what makes files or
  44. directories different. It will recursively unpack archives of many kinds
  45. and transform various binary formats into more human readable form to
  46. compare them. It can compare two tarballs, ISO images, or PDF just as
  47. easily.
  48. .sp
  49. It can be scripted through error codes, and a report can be produced
  50. with the detected differences. The report can be text or HTML.
  51. When no type of report has been selected, diffoscope defaults
  52. to write a text report on the standard output.
  53. .sp
  54. diffoscope was initially started by the "reproducible builds" Debian
  55. project and now being developed as part of the (wider) \fI\%???Reproducible
  56. Builds??? initiative\fP\&. It is meant
  57. to be able to quickly understand why two builds of the same package
  58. produce different outputs. diffoscope was previously named debbindiff.
  59. .sp
  60. See the \fBCOMMAND\-LINE EXAMPLES\fP section further below to get you
  61. started, as well as more detailed explanations of all the command\-line
  62. options. The same information is also available in
  63. \fB/usr/share/doc/diffoscope/README.rst\fP or similar.
  64. .\" the below hack gets rid of the python "usage" message in favour of the
  65. .\" the synopsis we manually defined in doc/$(PACKAGE).h2m.0
  66. .SS positional arguments:
  67. .TP
  68. path1
  69. First file or directory to compare. If omitted, tries
  70. to read a diffoscope diff from stdin.
  71. .TP
  72. path2
  73. Second file or directory to compare. If omitted, no
  74. comparison is done but instead we read a diffoscope
  75. diff from path1 and will output this in the formats
  76. specified by the rest of the command line.
  77. .SS "optional arguments:"
  78. .TP
  79. \fB\-\-debug\fR
  80. Display debug messages
  81. .TP
  82. \fB\-\-debugger\fR
  83. Open the Python debugger in case of crashes
  84. .TP
  85. \fB\-\-status\-fd\fR FD
  86. Send machine\-readable status to file descriptor FD
  87. .TP
  88. \fB\-\-progress\fR, \fB\-\-no\-progress\fR
  89. Show an approximate progress bar. Default: yes if
  90. stdin is a tty, otherwise no.
  91. .TP
  92. \fB\-\-no\-default\-limits\fR
  93. Disable most default output limits and diff
  94. calculation limits.
  95. .SS "output types:"
  96. .TP
  97. \fB\-\-text\fR OUTPUT_FILE
  98. Write plain text output to given file (use \- for
  99. stdout)
  100. .TP
  101. \fB\-\-text\-color\fR WHEN
  102. When to output color diff. WHEN is one of {never,
  103. auto, always}. Default: auto, meaning yes if the
  104. output is a terminal, otherwise no.
  105. .TP
  106. \fB\-\-output\-empty\fR
  107. If there was no difference, then output an empty diff
  108. for each output type that was specified. In \fB\-\-text\fR
  109. output, an empty file is written.
  110. .TP
  111. \fB\-\-html\fR OUTPUT_FILE
  112. Write HTML report to given file (use \- for stdout)
  113. .TP
  114. \fB\-\-html\-dir\fR OUTPUT_DIR
  115. Write multi\-file HTML report to given directory
  116. .TP
  117. \fB\-\-css\fR URL
  118. Link to an extra CSS for the HTML report
  119. .TP
  120. \fB\-\-jquery\fR URL
  121. URL link to jQuery, for \fB\-\-html\fR and \fB\-\-html\-dir\fR output.
  122. If this is a non\-existent relative URL, diffoscope
  123. will create a symlink to a system installation. (Paths
  124. searched: \fI\,/usr/share/javascript/jquery/jquery.js\/\fP.) If
  125. not given, \fB\-\-html\fR output will not use JS but \fB\-\-htmldir\fR will if it can be found; give "disable" to disable
  126. JS on all outputs.
  127. .TP
  128. \fB\-\-json\fR OUTPUT_FILE
  129. Write JSON text output to given file (use \- for
  130. stdout)
  131. .TP
  132. \fB\-\-markdown\fR OUTPUT_FILE
  133. Write Markdown text output to given file (use \- for
  134. stdout)
  135. .TP
  136. \fB\-\-restructured\-text\fR OUTPUT_FILE
  137. Write RsT text output to given file (use \- for stdout)
  138. .TP
  139. \fB\-\-profile\fR OUTPUT_FILE
  140. Write profiling info to given file (use \- for stdout)
  141. .SS "output limits:"
  142. .TP
  143. \fB\-\-max\-text\-report\-size\fR BYTES
  144. Maximum bytes written in \fB\-\-text\fR report. (0 to disable,
  145. default: 0)
  146. .TP
  147. \fB\-\-max\-report\-size\fR BYTES
  148. Maximum bytes of a report in a given format, across
  149. all of its pages. Note that some formats, such as
  150. \fB\-\-html\fR, may be restricted by even smaller limits such
  151. as \fB\-\-max\-page\-size\fR. (0 to disable, default: 41943040)
  152. .TP
  153. \fB\-\-max\-diff\-block\-lines\fR LINES
  154. Maximum number of lines output per unified\-diff block,
  155. across all pages. (0 to disable, default: 1024)
  156. .TP
  157. \fB\-\-max\-page\-size\fR BYTES
  158. Maximum bytes of the top\-level (\fB\-\-html\-dir\fR) or sole
  159. (\fB\-\-html\fR) page. (default: 409600, remains in effect
  160. even with \fB\-\-no\-default\-limits\fR)
  161. .TP
  162. \fB\-\-max\-page\-size\-child\fR BYTES
  163. In \fB\-\-html\-dir\fR output, this is the maximum bytes of
  164. each child page (default: 204800, remains in effect
  165. even with \fB\-\-no\-default\-limits\fR)
  166. .TP
  167. \fB\-\-max\-page\-diff\-block\-lines\fR LINES
  168. Maximum number of lines output per unified\-diff block
  169. on the top\-level (\fB\-\-html\-dir\fR) or sole (\fB\-\-html\fR) page,
  170. before spilling it into child pages (\fB\-\-html\-dir\fR) or
  171. skipping the rest of the diff block. Child pages are
  172. limited instead by \fB\-\-max\-page\-size\-child\fR. (default:
  173. 128, remains in effect even with \fB\-\-no\-default\-limits\fR)
  174. .SS "diff calculation:"
  175. .TP
  176. \fB\-\-new\-file\fR
  177. Treat absent files as empty
  178. .TP
  179. \fB\-\-exclude\fR GLOB_PATTERN
  180. Exclude files that match GLOB_PATTERN. Use this option
  181. to ignore files based on their names.
  182. .TP
  183. \fB\-\-exclude\-command\fR REGEX_PATTERN
  184. Exclude commands that match REGEX_PATTERN. For example
  185. \&'^readelf.*\es\-\-debug\-dump=info' can take a long time
  186. and differences here are likely secondary differences
  187. caused by something represented elsewhere. Use this
  188. option to disable commands that use a lot of
  189. resources.
  190. .TP
  191. \fB\-\-exclude\-directory\-metadata\fR, \fB\-\-no\-exclude\-directory\-metadata\fR
  192. Exclude directory metadata. Useful if comparing files
  193. whose filesystem\-level metadata is not intended to be
  194. distributed to other systems. This is true for most
  195. distributions package builders, but not true for the
  196. output of commands such as `make install`. Metadata of
  197. archive members remain un\-excluded. Use this option to
  198. ignore permissions, timestamps, xattrs etc. Default:
  199. False if comparing two directories, else True. Note
  200. that "file" metadata actually a property of its
  201. containing directory, and is not relevant when
  202. distributing the file across systems.
  203. .TP
  204. \fB\-\-fuzzy\-threshold\fR FUZZY_THRESHOLD
  205. Threshold for fuzzy\-matching (0 to disable, 60 is
  206. default, 400 is high fuzziness)
  207. .TP
  208. \fB\-\-tool\-prefix\-binutils\fR PREFIX
  209. Prefix for binutils program names, e.g.
  210. "aarch64\-linux\-gnu\-" for a foreign\-arch binary or "g"
  211. if you're on a non\-GNU system.
  212. .TP
  213. \fB\-\-max\-diff\-input\-lines\fR LINES
  214. Maximum number of lines fed to diff(1) (0 to disable,
  215. default: 4194304)
  216. .TP
  217. \fB\-\-max\-container\-depth\fR DEPTH
  218. Maximum depth to recurse into containers. (Cannot be
  219. disabled for security reasons, default: 50)
  220. .TP
  221. \fB\-\-max\-diff\-block\-lines\-saved\fR LINES
  222. Maximum number of lines saved per diff block. Most
  223. users should not need this, unless you run out of
  224. memory. This truncates diff(1) output before emitting
  225. it in a report, and affects all types of output,
  226. including \fB\-\-text\fR and \fB\-\-json\fR. (0 to disable, default:
  227. 0)
  228. .TP
  229. \fB\-\-force\-details\fR
  230. Force recursing into the depths of file formats even
  231. if files have the same content, only really useful for
  232. debugging diffoscope. Default: False
  233. .SS "information commands:"
  234. .TP
  235. \fB\-\-help\fR, \fB\-h\fR
  236. Show this help and exit
  237. .TP
  238. \fB\-\-version\fR
  239. Show program's version number and exit
  240. .TP
  241. \fB\-\-list\-tools\fR [DISTRO]
  242. Show external tools required and exit. DISTRO can be
  243. one of {arch, debian, FreeBSD}. If specified, the
  244. output will list packages in that distribution that
  245. satisfy these dependencies.
  246. .TP
  247. \fB\-\-list\-debian\-substvars\fR
  248. List packages needed for Debian in 'substvar' format.
  249. .PP
  250. File renaming detection based on fuzzy\-matching is currently disabled. It can
  251. be enabled by installing the "tlsh" module available at
  252. https://github.com/trendmicro/tlsh
  253. .SS "file formats supported:"
  254. .IP
  255. Android APK files, Android boot images, Berkeley DB database files, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, Dalvik .dex files, Device Tree Compiler blob files, ELF binaries, FreeDesktop Fontconfig cache files, FreePascal files (.ppu), GHC Haskell .hi files, GIF image files, GNU R Rscript files (.rds), GNU R database files (.rdb), Gettext message catalogues, Git repositories, Gnumeric spreadsheets, Gzipped files, ISO 9660 CD images, JPEG images, JSON files, Java .class files, JavaScript files, LLVM IR bitcode files, LZ4 compressed files, MacOS binaries, Microsoft Windows icon files, Microsoft Word .docx files, Mono 'Portable Executable' files, Ogg Vorbis audio files, OpenOffice .odt files, OpenSSH public keys, OpenWRT package archives (.ipk), PDF documents, PGP signed/encrypted messages, PNG images, PostScript documents, Rust object files (.deflate), SQLite databases, SquashFS filesystems, TrueType font files, XML binary schemas (.xsb), XML files, XZ compressed files, ar(1) archives, bzip2 archives, character/block devices, cpio archives, directories, ext2/ext3/ext4/btrfs filesystems, statically\-linked binaries, symlinks, tape archives (.tar), tcpdump capture files (.pcap), text files, text files, text files and text files.
  256. .SH "EXIT STATUS"
  257. .sp
  258. Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
  259. .SH "COMMAND-LINE EXAMPLES"
  260. .sp
  261. To compare two files in\-depth and produce an HTML report, run something like:
  262. .INDENT 0.0
  263. .INDENT 3.5
  264. .sp
  265. .nf
  266. .ft C
  267. $ diffoscope \-\-html output.html build1.changes build2.changes
  268. .ft P
  269. .fi
  270. .UNINDENT
  271. .UNINDENT
  272. .sp
  273. diffoscope will exit with 0 if there\(aqs no differences and 1 if there
  274. are.
  275. .sp
  276. \fIdiffoscope\fP can also compare non\-existent files:
  277. .INDENT 0.0
  278. .INDENT 3.5
  279. .sp
  280. .nf
  281. .ft C
  282. $ diffoscope /nonexistent archive.zip
  283. .ft P
  284. .fi
  285. .UNINDENT
  286. .UNINDENT
  287. .sp
  288. To get all possible options, run:
  289. .INDENT 0.0
  290. .INDENT 3.5
  291. .sp
  292. .nf
  293. .ft C
  294. $ diffoscope \-\-help
  295. .ft P
  296. .fi
  297. .UNINDENT
  298. .UNINDENT
  299. .sp
  300. If you have enough RAM, you can improve performance by running:
  301. .INDENT 0.0
  302. .INDENT 3.5
  303. .sp
  304. .nf
  305. .ft C
  306. $ TMPDIR=/run/shm diffoscope very\-big\-input\-0/ very\-big\-input\-1/
  307. .ft P
  308. .fi
  309. .UNINDENT
  310. .UNINDENT
  311. .sp
  312. By default this allowed to use up half of RAM; for more add something like:
  313. .INDENT 0.0
  314. .INDENT 3.5
  315. .sp
  316. .nf
  317. .ft C
  318. tmpfs /run/shm tmpfs size=80% 0 0
  319. .ft P
  320. .fi
  321. .UNINDENT
  322. .UNINDENT
  323. .sp
  324. to your \fB/etc/fstab\fP; see \fBman mount\fP for details.
  325. .SH "EXTERNAL DEPENDENCIES"
  326. .sp
  327. diffoscope requires Python 3 and the following modules available on PyPI:
  328. \fI\%libarchive\-c\fP,
  329. \fI\%python\-magic\fP\&.
  330. .sp
  331. The various comparators rely on external commands being available. To
  332. get a list of them, please run:
  333. .INDENT 0.0
  334. .INDENT 3.5
  335. .sp
  336. .nf
  337. .ft C
  338. $ diffoscope \-\-list\-tools
  339. .ft P
  340. .fi
  341. .UNINDENT
  342. .UNINDENT
  343. .SH CONTRIBUTORS
  344. .sp
  345. Lunar, Reiner Herrmann, Chris Lamb, Mattia Rizzolo, Ximin Luo, Helmut Grohne,
  346. Holger Levsen, Daniel Kahn Gillmor, Paul Gevers, Peter De Wachter, Yasushi
  347. SHOJI, Clemens Lang, Ed Maste, Joachim Breitner, Mike McQuaid. Baptiste
  348. Daroussin, Levente Polyak.
  349. .SH CONTACT
  350. .sp
  351. Please report bugs and send patches through the Debian bug tracking
  352. system against the diffoscope package:
  353. <\fI\%https://bugs.debian.org/src:diffoscope\fP>
  354. .sp
  355. For more instructions, see \fBCONTRIBUTING.rst\fP in this directory.
  356. .sp
  357. Join the users and developers mailing\-list:
  358. <\fI\%https://lists.reproducible\-builds.org/listinfo/diffoscope\fP>
  359. .sp
  360. diffoscope website is at <\fI\%https://diffoscope.org/\fP>
  361. .SH LICENSE
  362. .sp
  363. diffoscope is free software: you can redistribute it and/or modify
  364. it under the terms of the GNU General Public License as published by
  365. the Free Software Foundation, either version 3 of the License, or
  366. (at your option) any later version.
  367. .sp
  368. diffoscope is distributed in the hope that it will be useful,
  369. but WITHOUT ANY WARRANTY; without even the implied warranty of
  370. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  371. GNU General Public License for more details.
  372. .sp
  373. You should have received a copy of the GNU General Public License
  374. along with diffoscope. If not, see <\fI\%https://www.gnu.org/licenses/\fP>.
  375. .SH "SEE ALSO"
  376. .INDENT 0.0
  377. .IP \(bu 2
  378. \fI<https://diffoscope.org/>\fP
  379. .IP \(bu 2
  380. \fI<https://wiki.debian.org/ReproducibleBuilds>\fP
  381. .UNINDENT
  382. .\" Generated by docutils manpage writer.
  383. .