Have you seen this? https://lists.debian.org/debian-devel/2023/08/
> I've been toying with the idea of setting up a Debian-wide system to nag > maintainers about out-of-date, inconsistent or plain broken packaging git > repos. This logic to diff the dsc against one built from unstable could be > part of that effort. Some will probably argue that you are trying to influence their priorities, that non-git .dsc formats are obsolete, and so on. Moreover, even if you guess the git tag and whether patches are applied, there is probably no deterministic way to tell if .gitignore matches the workflow of upstream, Debian or both. For the avoidance of doubt, I would appreciate such alerts, a Debian policy about tags and patches, and that .gitignore is only allowed for self defense... > Even with git what may be missing is a hook in dpkg-buildpackage to abort > the (source) build when the worktree is unclean, I often build with manual changes in debian/ that I want tested before committed. > > [...] script cleaning after the build, > > then reporting any difference between the source and the .dsc. > > The output is almost always either > > * trivial to work-around in Debian > > (echo '*.o' > debian/clean) > > (fixing upstream may be another story) > > * short enough to be easily ignored > > (./configure), > > * or a real issue. > [..] could you elaborate or show an example? The script I am using is too lazy for public exposure. Here are the parts unrelated with pbuilder. # After a successful build, clean and compare the source directory # with the contents extracted by dpkg-source. # The diff must match debian/clean.diff if it exists, else be empty. # Example: # Only in ../dsc: Makefile.in # Only in ../dsc: config.h # Only in ../dsc: configure # If lots of files are removed, repackaging with Files-Excluded is # probably a better option, see uscan(1). #!/bin/sh set -Ceux source=$(dpkg-parsechangelog -SSource) version=$(dpkg-parsechangelog -SVersion) dsc_dir=../dsc debian/rules clean dpkg-source -x ../$source_$version.dsc $dsc_dir if ! (diff -qr $dsc_dir . || true) | diff -N debian/clean.diff -; then # Display a full diagnostic while $dsc_dir is available. diff -ru $dsc_dir . || true # When -ru is empty, -N above already reported the obsolete clean.diff. fi rm -fr $dsc_dir

