bugQuilt - Bugs: bug #54772, A few test fails when using...

 
 

bug #54772: A few test fails when using compat/getopt script

Submitter:  Eric Bavier <bavier>
Submitted:  Wed 03 Oct 2018 03:01:16 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  khali
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 09 Oct 2018 08:08:15 AM UTC, comment #4: 
Jean Delvare <khali>
Group administrator
Wed 03 Oct 2018 03:23:25 PM UTC, comment #3: 

Those 2 patches allow the tests to pass for me, without the modifying the tests.  Thank you for the quick reply!

Eric Bavier <bavier>
Wed 03 Oct 2018 02:25:39 PM UTC, comment #2: 

Please test the attached 2 patches. They fix the test suite for me, without having to change the test suite itself.

Jean Delvare <khali>
Group administrator
Wed 03 Oct 2018 01:52:44 PM UTC, comment #1: 

Thanks for reporting. I can reproduce the bugs by passing --without-getopt to ./configure.

You suggested workarounds "work" in that they allow the test suite to complete, however doing that means that we are purposely not testing cases which we know are broken. The user could trigger the same bugs later by running the same, valid quilt commands.

So a better solution would be to fix the getopt compatibility script so that it no longer chokes on these corner cases. I'm looking into it.

Jean Delvare <khali>
Group administrator
Wed 03 Oct 2018 03:01:16 AM UTC, original submission:  

Good Day,

If quilt's configure script cannot find a suitable "getopt" program in the environment, e.g. the "util-linux" package is not installed, it will revert to using the internal "compat/getopt" script.  But this leads to a few test failures in my environment:


$ ./git-desc
v0.65-34-g7354a21
$ ./configure
...
checking for getopt... no
configure: WARNING: Using internal getopt mechanism.  Use option '--with-getopt' to override
...
$ make check TESTS=test/create-delete.test
[create-delete.test]
[4] $ mkdir patches -- ok
[6] $ echo delete > delete -- ok
[7] $ quilt new test.diff -- ok
[10] $ quilt add create -- ok
[13] $ echo create > create -- ok
[14] $ quilt refresh -- ok
[17] $ quilt add delete -- ok
[20] $ rm -f delete -- ok
[21] $ quilt refresh -- ok
[23] $ quilt header -r -- ok
[31] $ quilt patches -v create -- ok
[33] $ quilt patches delete -- ok
[36] $ quilt pop -q -- ok
[40] $ quilt patches create -- ok
[42] $ quilt patches -v delete -- ok
[44] $ quilt patches -- /dev/null dev/null null --- -- failed
illegal option: - at /tmp/quilt/compat/getopt line 125. != ~
Usage: quilt patches [-v] [--color[=always|auto|never]] {file} [files...] != ~
[46] $ echo create > create -- ok
[47] $ rm -f delete -- ok
[48] $ patch -p1 --dry-run < patches/test.diff -- ok
19 commands (18 passed, 1 failed)
make: *** [Makefile:410: test/.create-delete.ok] Error 1
$ #
$ #--------------------------------------------------------------
$ #
$ make check TESTS=test/empty-files.test
[empty-files.test]
[4] $ mkdir patches -- ok
[5] $ echo "will be deleted" > deleted1 -- ok
...
[104] $ quilt refresh -pab --sort --no-index -- failed
unexpected character after option p at /tmp/quilt/compat/getopt line 106. != Refreshed patch patches/using-filenames.patch
Usage: quilt refresh [-p n|-p ab] [-u|-U num|-c|-C num] [-z[new_name]] [-f] [--no-timestamps] [--no-index] [--diffstat] [--sort] [--backup] [--strip-trailing-whitespace] [patch] != ~
[106] $ quilt pop -q -- ok
[110] $ quilt push -- ok
...
make: *** [Makefile:410: test/.empty-files.ok] Error 2
$ #
$ #--------------------------------------------------------------
$ #
$ make check TESTS=test/faildiff.test
[faildiff.test]
[1] $ mkdir patches -- ok
[3] $ quilt new test.diff -- ok
...
[30] $ quilt diff -pab --no-index -- failed
unexpected character after option p at /tmp/quilt/compat/getopt line 106. !~ (Files|Binary files) a/test\.bin and b/test\.bin differ
Usage: quilt diff [-p n|-p ab] [-u|-U num|-c|-C num] [--combine patch|-z] [-R] [-P patch] [--snapshot] [--diff=utility] [--no-timestamps] [--no-index] [--sort] [--color[=always|auto|never]] [file ...] != Diff failed on file 'test.bin', aborting
...
make: *** [Makefile:410: test/.faildiff.ok] Error 3


The first failure is strange.  My getopt from util-linux also does not like the '---' and complains, but it must do so in a way quilt can handle, because the tests pass with it, but not with compat/getopt.  As a workaround, removing the '---' allows the test to pass.

The last two seem to be related to compata/getopt's handling of short options with immediately following arguments.  As a workaround, replacing '-pab' with '-p ab' allows the tests to pass.

Eric Bavier <bavier>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #45131:  compat-getopt-fix-second-separator.patch added by khali (2KiB - text/x-patch - 2 patches fixing the issue)
file #45132:  compat-getopt-fix-option-with-nondigit-param.patch added by khali (2KiB - text/x-patch - 2 patches fixing the issue)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by khali (Posted a comment)
  • -email is unavailable- added by bavier (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-09 khali StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2018-10-03 khali StatusConfirmed Need Info
    2018-10-03 khali Attached File- Added compat-getopt-fix-second-separator.patch, #45131
        Attached File- Added compat-getopt-fix-option-with-nondigit-param.patch, #45132
    2018-10-03 khali StatusNone Confirmed
        Assigned toNone khali

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code