RPM Community Forums

Mailing List Message of <popt-devel>

Re: Test failure for popt 1.16

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 11 May 2010 - 21:13:43 CEST
Message-id: <706742EF-6D9D-4A82-97D3-2DABBA543403@mac.com>
Actually the previous patch is bogus. Right idea, just
the wrong way to fix.

Try this patch instead:

Index: popthelp.c
===================================================================
RCS file: /v/rpm/cvs/popt/popthelp.c,v
retrieving revision 1.94
diff -p -u -w -r1.94 popthelp.c
--- popthelp.c	28 Aug 2009 00:06:33 -0000	1.94
+++ popthelp.c	11 May 2010 19:12:28 -0000
@@ -652,6 +652,8 @@ static size_t showHelpIntro(poptContext 
 	const char * fn = (os->argv ? os->argv[0] : NULL);
 	if (fn == NULL) return len;
 	if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1;
+	if (fn[0] == 'l' && fn[1] == 't' && fn[2] == '-')
+	    fn += sizeof("lt-") - 1;
 	/* XXX POPT_fprintf not needed for argv[0] display. */
 	fprintf(fp, " %s", fn);
 	len += strlen(fn) + 1;
Index: testit.sh
===================================================================
RCS file: /v/rpm/cvs/popt/testit.sh,v
retrieving revision 1.31
diff -p -u -w -r1.31 testit.sh
--- testit.sh	26 Jul 2009 16:25:23 -0000	1.31
+++ testit.sh	11 May 2010 19:12:29 -0000
@@ -115,7 +115,7 @@ run test1 "test1 - 56" "arg1: 0 arg2: (n
 run test1 "test1 - 57" "arg1: 0 arg2: (none) aBits: foo,baz" --bits foo,bar,baz,!bar
 
 run test1 "test1 - 58" "\
-Usage: lt-test1 [-I?] [-c|--cb2=STRING] [--arg1] [-2|--arg2=ARG]
+Usage: test1 [-I?] [-c|--cb2=STRING] [--arg1] [-2|--arg2=ARG]
         [-3|--arg3=ANARG] [-onedash] [--optional=STRING] [--val]
         [-i|--int=INT] [-s|--short=SHORT] [-l|--long=LONG]
         [-L|--longlong=LONGLONG] [-f|--float=FLOAT] [-d|--double=DOUBLE]
@@ -124,7 +124,7 @@ Usage: lt-test1 [-I?] [-c|--cb2=STRING] 
         [--bitxor] [--nstr=STRING] [--lstr=STRING] [-I|--inc]
         [-c|--cb=STRING] [--longopt] [-?|--help] [--usage] [--simple=ARG]" --usage
 run test1 "test1 - 59" "\
-Usage: lt-test1 [OPTION...]
+Usage: test1 [OPTION...]
       --arg1                      First argument with a really long
                                   description. After all, we have to test
                                   argument help wrapping somehow, right?


And if you can confirm the patch "works" in the next 24 hours,
I'll re-roll the (unannounced) popt-1.16.tar.gz.

Otherwise, I'll figger better for popt-1.17.

hth

73 de Jeff

On May 11, 2010, at 2:54 PM, Jeff Johnson wrote:

> 
> On May 10, 2010, at 7:57 PM, Pieter Bowman wrote:
> 
>> I did builds of popt 1.16 on a number of our systems here.  Test 59
>> failed on a number of the systems with the following output:
>> 
> 
> The "fix" for the failure in popt-1.16 "make check" is likely (I have
> easy no easy means of testing across all the platforms that you have)
> as simple as the atached patch.
> 
> If you can confirm that the patch "works", I'll re-roll the popt-1.16
> tarballs, and re-release (it hasn't been announced anywhere)
> the popt-1.16 tarball.
> 
> hth
> 
> 73 de Jeff
> ==============================================================
> Index: test1.c
> ===================================================================
> RCS file: /v/rpm/cvs/popt/test1.c,v
> retrieving revision 1.44
> diff -p -u -w -r1.44 test1.c
> --- test1.c	26 Jul 2009 16:38:25 -0000	1.44
> +++ test1.c	11 May 2010 18:50:39 -0000
> @@ -252,7 +252,7 @@ int main(int argc, const char ** argv)
>     resetVars();
> /*@=modobserver@*/
> /*@-temptrans@*/
> -    optCon = poptGetContext("test1", argc, argv, options, 0);
> +    optCon = poptGetContext("test1", argc, argv, options, POPT_CONTEXT_KEEP_FIRST);
> /*@=temptrans@*/
>     (void) poptReadConfigFile(optCon, "./test-poptrc");
>     (void) poptReadDefaultConfig(optCon, 1);
> 
> 
> ______________________________________________________________________
> POPT Library                                           http://rpm5.org
> Developer Communication List                       popt-devel@rpm5.org
Received on Tue May 11 21:14:03 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.