Skip to content

strip directory when comparing files like `debdiff` does

I would like to replace debdiff by diffoscope as it supports Debian source packages (.dsc) already. Currently this does not work as the upstream tarballs in there contain a directory prefix with the version and diffoscope only prints the the file names. Example:

$ diffoscope --version
diffoscope 272
$ dget "https://deb.debian.org/debian/pool/main/d/dash/dash_0.5.11+git20200708+dd9ef66-5.dsc"
$ dget "https://deb.debian.org/debian/pool/main/d/dash/dash_0.5.12-2.dsc"
$ diffoscope dash_0.5.11+git20200708+dd9ef66-5.dsc dash_0.5.12-2.dsc
[..]
├── +++ dash_0.5.12.orig.tar.gz
│ │   --- dash_0.5.11+git20200708+dd9ef66.orig.tar
│ ├── +++ dash_0.5.12.orig.tar
│ │ ├── file list
│ │ │ @@ -1,89 +1,82 @@
│ │ │ -drwxrwxr-x   0 root         (0) root         (0)        0 2020-07-08 06:58:29.000000 dash-0.5.11+git20200708+dd9ef66/
│ │ │ --rw-rw-r--   0 root         (0) root         (0)      476 2020-07-08 06:58:29.000000 dash-0.5.11+git20200708+dd9ef66/.gitignore
[..]
│ │ │ +drwxr-xr-x   0     1000     1000        0 2022-12-11 06:42:14.000000 dash-0.5.12/
│ │ │ +-rwxr-xr-x   0     1000     1000     6878 2021-01-04 05:32:20.000000 dash-0.5.12/missing

I am not sure if it is feasible to always find files in different directories but maybe have a special option for Debian source packages?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information