Opened 12 years ago

Closed 6 years ago

#33684 closed defect (fixed)

autogen 5.15 fails shell.hlp test case on case-insensitive filesystems

Reported by: howarth@… Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), fang@…
Port: autogen

Description (last modified by ryandesign (Ryan Carsten Schmidt))

The MacPorts autogen 5.15 package is currently not passing the autogen testsuite.
The autoopts/test/shell.test test is failing as...

FAILURE: script generator help output mismatch: *** shell.hlp	Sat Mar 17 20:12:00 2012
--- shell.help	Sat Mar 17 20:12:00 2012
***************
*** 1,25 ****
- genshellopt - Generate Shell Option Processing Script - Ver. 1
- USAGE: shell [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
- Flg Arg Option-Name Description
- -o Str script Output Script File
- -s Str shell Shell name (follows "#!" magic)
- - disabled as --no-shell
- - enabled by default
- -v opt version Output version information and exit
- -? no help Display extended usage information and exit
- -! no more-help Extended usage information passed thru pager
- Options are specified by doubled hyphens and their name or by a single
- hyphen and the flag character.
- = = = = = = = =
- This incarnation of genshell will produce
- a shell script to parse the options for test_shell:
- test_shell - Test AutoOpts for shell
- USAGE: test_shell [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
- reg-arg [ ... ]
- Flg Arg Option-Name Description
- -o Str option The option option descrip
- -s no second The second option descrip
- -? no help Display extended usage information and exit
- -! no more-help Extended usage information passed thru pager
- Options are specified by doubled hyphens and their name or by a single
- hyphen and the flag character.
--- 0 ----
FAIL: shell.test

This has been filed upstream as...

https://sourceforge.net/tracker/?func=detail&atid=103593&aid=3507334&group_id=3593#

The autogen developers can't reproduce this failure (although I can also reproduce under fink). Any help we can give the autogen developer in debugging this apparent sed issue on darwin would be appreciated.

Attachments (6)

shell.help (1.7 KB) - added by bkorb@… 12 years ago.
unmodified usage/help text
shell.HELP (1.2 KB) - added by bkorb@… 12 years ago.
help/usage text after sed and grep are done
shell.log (21.9 KB) - added by bkorb@… 12 years ago.
the xtrace file, in case that's helpful
main.log (88.8 KB) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
main.2.log (71.5 KB) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
autogen.diff (527 bytes) - added by howarth@… 12 years ago.
shell.test fix for darwin

Download all attachments as: .zip

Change History (28)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to mww@…

Just for the record, what OS version and Xcode version are you using?

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Ah, in the upstream bug you stated OS X 10.7.3 and Xcode 4.3.1.

Changed 12 years ago by bkorb@…

Attachment: shell.help added

unmodified usage/help text

Changed 12 years ago by bkorb@…

Attachment: shell.HELP added

help/usage text after sed and grep are done

Changed 12 years ago by bkorb@…

Attachment: shell.log added

the xtrace file, in case that's helpful

comment:3 Changed 12 years ago by bkorb@…

What is seen from the various files is that the test program at issue runs and is capable of producing the expected output. The command xtrace ("set -x") output shows a sed command that ought to leave behind the text that should be tested against. Instead, the text file produced is empty. The "shell.help" file (attached) is the output of running the test command with the --help option and the "shell.HELP" file (also attached) is the output created by running that text through the following pipe (also on a Mac):

/sw/bin/sed '/[Pp]lease send bug reports/d
/^Packaged by/d
/^Report .* bugs to/d
/Note that.*is only useful/,/will be regenerated/d' | grep -v $'^[ \t]*$'

comment:4 Changed 12 years ago by howarth@…

FYI, I have reproduced this under fink as well using llvm-gcc-4.2, clang and gcc-fsf-4.6 under Mac OS X 10.7.3 and Xcode 4.3.1. Upstream claims the shell.test binary runs fine and produced the correct output.

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:5 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

I reproduced the issue on my machine with OS X 10.6.8 and Xcode 3.2.6; I attached the main.log for reference.

comment:6 Changed 12 years ago by bkorb@…

I am sure it is eminently reproducible. I don't have a Mac build platform, so I cannot. I just need to know how the shell.test script and clean_help function are failing. In my repo, I've altered the clean_help function (lives in "defs.in") thus:

clean_help() {
  {
    echo '/^Packaged by/d'
    echo '/^Report .* bugs to/d'
    echo '/[Pp]lease send bug reports/d'
    test -z "$sedcmd" || echo "$sedcmd"
    echo "/^[ ${ht}]*\$/d"
  } > ${testname}.sed-cmd
  ${SED} -f ${testname}.sed-cmd
}

but Jack says this makes it worse for him, so maybe not the right solution.

comment:7 in reply to:  4 Changed 12 years ago by bkorb@…

Replying to howarth@…:

FYI, ... Upstream claims the shell.test binary runs fine

It does, indeed. In your tarball there is a file named test/FAILURES/shell That is a binary, not actually any sort of shell. Run it with "--help" or "-?" and you will get the correct help text. The shell.test script will do that.

comment:8 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

What is the significance of the fact that the files you attached were named shell.help and shell.HELP? Are those the names that the test suite will use to create these files? If so, presumably they are created in the same directory? If so, they will overwrite each other on case-insensitive filesystems, which mine and most Mac users' are.

comment:9 Changed 12 years ago by bkorb@…

while IFS='' read -r line
do
  <<<manipulations>>>
done < ${testname}.help > ${testname}.HELP

Then the bug is here. I wrote this so many years ago and I don't really do development on a Mac. Or under Windows. Thank you.

comment:10 Changed 12 years ago by bkorb@…

Yep. That while loop is left over cruft from before the "clean_help" function was written. Next rev.

comment:11 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: autogen 5.15 fails shell.hlp test caseautogen 5.15 fails shell.hlp test case on case-insensitive filesystems

comment:12 Changed 12 years ago by bkorb@…

Please try:

http://autogen.sourceforge.net/data/autogen-5.16pre11.tar.xz

comment:13 in reply to:  12 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to bkorb@…:

Please try:

Two tests now fail; I'll attach the main.log.

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.2.log added

comment:14 in reply to:  12 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like 5.16pre11 still contains the line:

 done < ${testname}.help > ${testname}.HELP

This can't work right on case-insensitive filesystems.

comment:15 Changed 12 years ago by bkorb@…

*sigh*. Thank you.

  1. Duh. I must have overwritten the removal ... #(
  1. NTP folks want texi markups in the option short descriptions, so I sedded-away the texi-isms and reformatted with "fmt -w72". Apparently, our "fmt" programs disagree about whether byte 72 causes a line break or is a line limit. More variable text.

Changed 12 years ago by howarth@…

Attachment: autogen.diff added

shell.test fix for darwin

comment:16 Changed 12 years ago by howarth@…

Simply changing the instances of .HELP to .HELP2 is sufficient to fix the test for darwin.

comment:17 Changed 12 years ago by bkorb@…

Removing that whole "while" loop fixes it, too. :) Whatever is easiest tho...This time, it's really gone from my source base.

comment:18 Changed 12 years ago by bkorb@…

That fixes it for the 5.15 release, that is. My "pre" release has that formatting issue.

comment:19 Changed 12 years ago by fang@…

Cc: fang@… added

Cc Me!

comment:20 Changed 12 years ago by jmroot (Joshua Root)

I gather this can be closed now that the port is at version 5.16.1?

comment:21 Changed 7 years ago by mf2k (Frank Schima)

Owner: mww@… deleted
Status: newassigned

See #53012.

comment:22 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.