Bug 21000 - debian/build-git-snapshot script ignores -D
Summary: debian/build-git-snapshot script ignores -D
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-26 15:26 UTC by Jerome Charaoui
Modified: 2020-06-04 20:33 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03


Attachments
Bug 21000: Force case sensitivity on Getopt::Long (2.02 KB, patch)
2019-06-28 01:05 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 21000: Force case sensitivity on Getopt::Long (2.07 KB, patch)
2019-07-04 17:39 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21000: Force case sensitivity on Getopt::Long (2.13 KB, patch)
2019-07-05 13:04 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Charaoui 2018-06-26 15:26:36 UTC
Calling debian/build-git-snapshot with the --distribution switch has no effect. It seems that the variable isn't passed to the adjust_debian_changelog() function.
Comment 1 Jonathan Druart 2018-06-29 17:20:36 UTC
There is a colision with debug:

 41     'distribution|D=s'  => \$distribution,

 46     'debug|d'           => \$debug,

It works with the long option name (--distribution)
Comment 2 Mark Tompsett 2019-06-26 19:30:01 UTC
Reading the code it seems like debug is better called verbose.
Anyone object to a change to verbose?
Comment 3 Mark Tompsett 2019-06-28 00:49:34 UTC
Because of the whole --version/-v fixing case sensitivity seemed best.
Comment 4 Mark Tompsett 2019-06-28 01:05:52 UTC
Created attachment 91056 [details] [review]
Bug 21000: Force case sensitivity on Getopt::Long

Before patch: -D and -d are mistaken for --debug

    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    Option d does not take an argument
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "squeeze-dev" -v "19.06~git+20190627205913.466f99e4-1" "Building git snapshot."
    dch warning: Recognised distributions are:
    experimental, unstable, testing, stable, oldstable, oldoldstable,
    {bullseye,buster,stretch,jessie,wheezy}-proposed-updates,
    {testing,stable,oldstable,oldoldstable}-proposed-updates,
    {bullseye,buster,stretch,jessie,wheezy}-security,
    {testing,stable,oldstable,oldoldstable}}-security, jessie-backports, stretch-backports and UNRELEASED.
    Using your request anyway.

NOTE: squeeze-dev in the first dch line and warning about Option d.

Apply patch: -D and -d are differentiated correctly.
    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "stretch" -v "19.06~git+20190627210316.b3f919a7-1" "Building git snapshot."
    dch warning: Previous package version was Debian native whilst new version is not
    dch -r "Building git snapshot."

NOTE: No more 'Option d' error, and "stretch" in the first dch line.
Comment 5 Tomás Cohen Arazi 2019-07-04 17:39:12 UTC
Created attachment 91294 [details] [review]
Bug 21000: Force case sensitivity on Getopt::Long

Before patch: -D and -d are mistaken for --debug

    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    Option d does not take an argument
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "squeeze-dev" -v "19.06~git+20190627205913.466f99e4-1" "Building git snapshot."
    dch warning: Recognised distributions are:
    experimental, unstable, testing, stable, oldstable, oldoldstable,
    {bullseye,buster,stretch,jessie,wheezy}-proposed-updates,
    {testing,stable,oldstable,oldoldstable}-proposed-updates,
    {bullseye,buster,stretch,jessie,wheezy}-security,
    {testing,stable,oldstable,oldoldstable}}-security, jessie-backports, stretch-backports and UNRELEASED.
    Using your request anyway.

NOTE: squeeze-dev in the first dch line and warning about Option d.

Apply patch: -D and -d are differentiated correctly.
    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "stretch" -v "19.06~git+20190627210316.b3f919a7-1" "Building git snapshot."
    dch warning: Previous package version was Debian native whilst new version is not
    dch -r "Building git snapshot."

NOTE: No more 'Option d' error, and "stretch" in the first dch line.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2019-07-04 17:39:46 UTC
Good catch, Mark. This always bothered me and didn't find the time to dig into the solution. Thanks!
Comment 7 Martin Renvoize 2019-07-05 13:04:20 UTC
Created attachment 91332 [details] [review]
Bug 21000: Force case sensitivity on Getopt::Long

Before patch: -D and -d are mistaken for --debug

    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    Option d does not take an argument
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "squeeze-dev" -v "19.06~git+20190627205913.466f99e4-1" "Building git snapshot."
    dch warning: Recognised distributions are:
    experimental, unstable, testing, stable, oldstable, oldoldstable,
    {bullseye,buster,stretch,jessie,wheezy}-proposed-updates,
    {testing,stable,oldstable,oldoldstable}-proposed-updates,
    {bullseye,buster,stretch,jessie,wheezy}-security,
    {testing,stable,oldstable,oldoldstable}}-security, jessie-backports, stretch-backports and UNRELEASED.
    Using your request anyway.

NOTE: squeeze-dev in the first dch line and warning about Option d.

Apply patch: -D and -d are differentiated correctly.
    $ sudo DEB_BUILD_OPTIONS=nocheck ./debian/build-git-snapshot -r ~/debian -v 19.06~git --autoversion -d -D="stretch"
    git status --porcelain -unormal
    git rev-parse --short=8 HEAD
    dch --force-distribution -D "stretch" -v "19.06~git+20190627210316.b3f919a7-1" "Building git snapshot."
    dch warning: Previous package version was Debian native whilst new version is not
    dch -r "Building git snapshot."

NOTE: No more 'Option d' error, and "stretch" in the first dch line.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2019-07-05 13:04:41 UTC
Very sensible fix, thanks..

Passing QA
Comment 9 Martin Renvoize 2019-07-15 11:21:38 UTC
Nice work!

Pushed to master for 19.11.00
Comment 10 Fridolin Somers 2019-07-30 05:36:32 UTC
Pushed to 19.05.x for 19.05.03
Comment 11 Lucas Gass 2019-08-06 16:09:07 UTC
backported to 18.11.x for 18.11.09