Package: devscripts Version: 2.17.6+deb9u1 Followup-For: Bug #831521 Thanks for looking into this. My second thought is that there's a lot of useful functionality in mk-origtargz (determining the correct form of the tarball from debain/changelog, converting from zip or xpi, excluding files based on patterns...) and anyone needing some custom functionality shouldn't need to reinvent this. In my case I needed to run a command on a number of files within the upstream tarball, and also exclude some files.
Now I could create a debian/mk-origtargz script which creates a temp directory, extracts the upstream tar ball to it, runs my commands on the extracted files, re-tars the temporary folder into an intermediate tarball, calls /usr/bin/mk-origtargz with the path of intermediate tarball as an argument and then removes the temporary folder and intermediate tarball, but that seems to duplicate a lot of what mk-origtargz already does. I was wondering if it would be possible to insert some code around line 437 of mk-origtargz to check for the existance of a debian/modify-upstream script, and if it exists, call it with the path of the extracted files as the working directory? Another possibility might be to split the mk-origtargz into an unpack and repack scripts, and re-implement mk-origtargz as a wrapper which calls the unpack and repack script. Anyone implementing a debian/mk-origtargz could then call the unpack script, do some custome logic and then call the repack script. In the case of there being no upstream tarball, debian/mk-origtargz could assemble the upstream source into a temporary folder an then just call the repack script. I haven't thought too hard about this, so these ideas may be flawed. Christopher