• [PATCH] dpkg-buildpackage: Add flag to skip writing changes file

    From Adam Mohammed@21:1/5 to All on Wed Feb 24 14:30:02 2021
    dpkg-deb, dpkg-genbuildinfo and dpkg-genchanges already have flags for
    output directories in a directory other than `..`. Adding this
    `--no-changes` flag prevents `dpkg-buildpackage` from writing the
    .changes file to `..`.

    With this option, the `-O` options from `dpkg-genchanges` and `dpkg-genbuildinfo` can take care of handling the output instead of `dpkg-buildpackage`.

    This change could be done by having `dpkg-genchanges` determine where
    to place the .changes file, but currently `dpkg-buildpackage` does
    so. That change however seems like it potentially breaks existing
    behavior. Adding a flag to `dpkg-buildpackage` to override this
    behavior seems preferable since it is new behavior instead of breaking
    old behavior.

    scripts/dpkg-buildpackage.pl | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
    index aacb83118..4755b5a5a 100755
    --- a/scripts/dpkg-buildpackage.pl
    +++ b/scripts/dpkg-buildpackage.pl
    @@ -109,6 +109,7 @@ sub usage {
    -us, --unsigned-source unsigned source package.
    -ui, --unsigned-buildinfo unsigned .buildinfo file.
    -uc, --unsigned-changes unsigned .buildinfo and .changes file.
    + --no-changes do not create .changes file.
    --no-sign do not sign any file.
    --force-sign force signing the resulting files.
    --admindir=<directory> change the administrative directory.
    @@ -166,6 +167,7 @@ my $signreleased = 1;
    my $signsource = 1;
    my $signbuildinfo = 1;
    my $signchanges = 1;
    +my $skipchanges = 0;
    my $buildtarget = 'build';
    my $binarytarget = 'binary';
    my $host_arch = '';
    @@ -271,6 +273,8 @@ while (@ARGV) {