• [PATCH] New dpkg-source build option: --no-generate-diff (2/2)

    From Daniel Richard G.@1:229/2 to All on Wed May 22 09:20:01 2024
    [continued from previous message]

    $self->{fields}{'Format'});
    }
    + if (!$self->{options}{generate_diff} &&
    + ($self->{options}{include_removal} ||
    + $self->{options}{include_timestamp} ||
    + $self->{options}{include_binaries} ||
    + $self->{options}{create_empty_orig} ||
    + $self->{options}{auto_commit})) {
    + my @incompat = (
    + "--include-removal",
    + "--include-timestamp",
    + "--include-binaries",
    + "--create-empty-orig",
    + "--auto-commit"
    + );
    + usageerr(g_("--no-generate-diff is incompatible with the following options: %s"), join(", ", @incompat));
    + }
    $self->prepare_build($dir);

    my $include_binaries = $self->{options}{include_binaries};
    @@ -569,8 +594,9 @@ sub do_build {
    header_from => $autopatch,
    handle_binary => $handle_binary,
    skip_auto => $self->{options}{auto_commit},
    + do_diff => $self->{options}{generate_diff},
    usage => 'build');
    - unless (-z $tmpdiff or $self->{options}{auto_commit}) {
    + unless (!$tmpdiff or -z $tmpdiff or $self->{options}{auto_commit}) {
    info(g_('Hint: make sure the version in debian/changelog matches ' .
    'the unpacked source tree'));
    info(g_('you can integrate the local changes with %s'),
    @@ -578,7 +604,7 @@ sub do_build {
    error(g_('aborting due to unexpected upstream changes, see %s'),
    $tmpdiff);
    }
    - push_exit_handler(sub { unlink($tmpdiff) });
    + push_exit_handler(sub { !$tmpdiff or unlink($tmpdiff) });
    $binaryfiles->update_debian_source_include_binaries() if $include_binaries;

    # Install the diff as the new autopatch
    @@ -590,7 +616,7 @@ sub do_build {
    $autopatch) if -e $autopatch;
    rmdir(File::Spec->catdir($dir, 'debian', 'patches')); # No check on purpose
    }
    - unlink($tmpdiff) or syserr(g_('cannot remove %s'), $tmpdiff);
    + !$tmpdiff or unlink($tmpdiff) or syserr(g_('cannot remove %s'), $tmpdiff);
    pop_exit_handler();

    # Create the debian.tar

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Daniel Richard G.@1:229/2 to Guillem Jover on Thu Jul 11 22:40:01 2024
    [continued from previous message]

    When I first ran into the problem of dpkg-source taking ages to build,
    I thought of throwing together a script that just does the specific
    tar(1) command to generate the .debian.tar.xz file, and a simple
    template to generate the .dsc. But I knew that was a half-arsed
    solution, so I prepared this patch.

    Subjectively, I don't like that the patch couches this modality as
    "don't generate an automatic diff" rather than a more straightforward
    "just generate the debian/dsc files against existing orig tarball(s)
    without doing any checks," but the former seemed like it was necessary
    to fit into the man page conceptually. If you disagree, I'm happy to
    rename the option and rewrite the doc text; just let me know what
    approach I should take.

    For the patch itself, I'm not very fond of the semantics it
    introduces, because while something similar can probably be specified
    for format 1.0, that one has rather loose semantics and is more prone
    to error. Personally I don't trust myself to remember if I've done
    changes to a tree (if it's not tracked by a VCS), so I see this
    diluting its robustness and checks.

    Depending on the scenarios you have in mind, a better option might
    perhaps be to either make dpkg-source integrate more tightly with a
    VCS, or perhaps create a new source format. Both of which I've had
    in mind for a while, but see the motivation bit above.

    I can't comment on this nor the rest, and I hope it's now clear why :]
    I'm sorry for putting you though this whole thought process unnecessarily---
    I can only hope the time you spent on it will bear fruit in other areas
    of dpkg's development.


    --Daniel


    --
    Daniel Richard G. || skunk@iSKUNK.ORG
    My ASCII-art .sig got a bad case of Times New Roman.

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)