NetBSD Problem Report #37078

From martin@duskware.de  Sun Oct  7 23:50:56 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A1E1963B8F0
	for <gnats-bugs@gnats.netbsd.org>; Sun,  7 Oct 2007 23:50:56 +0000 (UTC)
Message-Id: <20071007185127.C313463B8D8@narn.NetBSD.org>
Date: Sun,  7 Oct 2007 18:51:27 +0000 (UTC)
From: zeurkous@nichten.info
Reply-To: zeurkous@nichten.info
To: netbsd-bugs-owner@NetBSD.org
Subject: archivers/unshield: libgetopt not referenced on Slackware Lunix 10.2
X-Send-Pr-Version: www-1.0

>Number:         37078
>Category:       pkg
>Synopsis:       archivers/unshield: libgetopt not referenced on Slackware Linux 10.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 07 23:55:00 +0000 2007
>Last-Modified:  Sat Jan 31 17:14:12 +0000 2009
>Originator:     De Zeurkous
>Release:        Slackware Lunix 10.2
>Organization:
Korax Productions
>Environment:
Linux zeurcomp 2.4.31 #21 Sun Jun 5 19:19:51 PDT 2005 i686 unknown unknown GNU/Lunix
>Description:
When attempting to build archivers/unshield on Slackware Lunix 10.2, I get the following errors:

[snip]
Making all in src
if gcc -DHAVE_CONFIG_H -I. -I. -I../lib    -I/usr/include -I/usr/local/include -g -ansi -Wall -Wsign-compare -Wno-long-long -Werror  -I../lib -O2 -march=athlon-xp -finline-functions -fomit-frame-pointer -ffast-math -mfpmath=sse -m3dnow -mmmx -msse -pipe -I/usr/include -MT unshield.o -MD -MP -MF ".deps/unshield.Tpo"  -c -o unshield.o `test -f 'unshield.c' || echo './'`unshield.c;  then mv -f ".deps/unshield.Tpo" ".deps/unshield.Po";  else rm -f ".deps/unshield.Tpo"; exit 1;  fi
unshield.c: In function `handle_parameters':
unshield.c:143: warning: implicit declaration of function `getopt'
unshield.c:148: error: `optarg' undeclared (first use in this function)
unshield.c:148: error: (Each undeclared identifier is reported only once
unshield.c:148: error: for each function it appears in.)
unshield.c:197: error: `optind' undeclared (first use in this function)
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/archivers/unshield/work/unshield-0.5/src
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/archivers/unshield/work/unshield-0.5
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/archivers/unshield
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/archivers/unshield

This was using branch 2007Q2 updated from CVS a few minutes ago, and is due to getopt being declared in a seperate header file on said platform.

Complete make output is available at http://www.xs4all.nl/~maribu/devel/NetBSD/misc/pkgsrc-archivers_unshield-Sun%20Oct%20%207%2018:46:48%20UTC%202007-make.1.log.gz
(UNIX gzip, 3K).
>How-To-Repeat:
#!/bin/sh
make() ( exec bmake "${@}" );
cd archivers/unshield &&
exec make
>Fix:
#!/bin/sh
make() ( exec bmake "${@}" );
cd archivers/unshield &&
exec make patch

Then apply the following patch:

diff -ur work.old/unshield-0.5/src/unshield.c work/unshield-0.5/src/unshield.c
--- work.old/unshield-0.5/src/unshield.c        2007-10-07 18:41:42.000000000 +0000
+++ work/unshield-0.5/src/unshield.c    2007-10-07 18:42:27.000000000 +0000
@@ -10,6 +10,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <getopt.h>
 #ifdef HAVE_CONFIG_H
 #include "../lib/unshield_config.h"
 #endif

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/37078: archivers/unshield: libgetopt not referenced on Slackware Lunix 10.2
Date: Mon, 08 Oct 2007 10:12:56 +0900

 On Mon, 08 Oct 2007 08:55:00 +0900, <zeurkous@nichten.info> wrote:

 > diff -ur work.old/unshield-0.5/src/unshield.c work/unshield-0.5/src/un=
 shield.c
 > --- work.old/unshield-0.5/src/unshield.c        2007-10-07 18:41:42.00=
 0000000 +0000
 > +++ work/unshield-0.5/src/unshield.c    2007-10-07 18:42:27.000000000 =
 +0000
 > @@ -10,6 +10,7 @@
 >  #include <sys/types.h>
 >  #include <sys/stat.h>
 >  #include <unistd.h>
 > +#include <getopt.h>
 >  #ifdef HAVE_CONFIG_H
 >  #include "../lib/unshield_config.h"
 >  #endif

 Should fix patch-ab instead.
 How about using following lines as patch-ab?

 $NetBSD$

 --- src/unshield.c.orig 2005-07-08 23:08:37.000000000 +0900
 +++ src/unshield.c
 @@ -2,3 +2,5 @@
   #define _BSD_SOURCE 1
 +#iddef __GLIBC__
   #define _POSIX_C_SOURCE 2
 +#endif
   #include "../lib/libunshield.h"
 @@ -280,6 +282,6 @@ static bool extract_file(Unshield* unshi
         default:
 -        if (!isprint(*p))
 +        if (!isprint((unsigned char)*p))
             *p =3D '_';
           else if (make_lowercase)
 -          *p =3D tolower(*p);
 +          *p =3D tolower((unsigned char)*p);
           break;;
 @@ -300,6 +302,6 @@ static bool extract_file(Unshield* unshi
     {
 -    if (!isprint(*p))
 +    if (!isprint((unsigned char)*p))
         *p =3D '_';
       else if (make_lowercase)
 -      *p =3D tolower(*p);
 +      *p =3D tolower((unsigned char)*p);
     }

From: "De Zeurkous" <zeurkous@nichten.info>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: RE: pkg/37078: archivers/unshield: libgetopt not referenced on 
     Slackware Lunix 10.2
Date: Mon, 8 Oct 2007 02:04:07 -0000 (UTC)

 On Mon, October 8, 2007 01:15, OBATA Akio wrote:
 > The following reply was made to PR pkg/37078; it has been noted by GNATS.
 >
 > From: "OBATA Akio" <obache@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: pkg/37078: archivers/unshield: libgetopt not referenced on
 > Slackware Lunix 10.2
 > Date: Mon, 08 Oct 2007 10:12:56 +0900
 >[snip]
 >  Should fix patch-ab instead.
 >  How about using following lines as patch-ab?
 >
 >[snip new patch-ab]

 Hm, that patch is malformed, at least relative to both mail-index, gnats,
 and my system. Please put it up somewhere gzipped.

 --De Zeurkous.

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/37078: archivers/unshield: libgetopt not referenced on Slackware Lunix 10.2
Date: Mon, 08 Oct 2007 11:24:27 +0900

 On Mon, 08 Oct 2007 11:05:07 +0900, De Zeurkous <zeurkous@nichten.info> wrote:

 >  Hm, that patch is malformed, at least relative to both mail-index, gnats,
 >  and my system. Please put it up somewhere gzipped.

 Sorry, the patch may not be applicable to 2007Q2 tree.
 Just for test, after make patch, edit work/unshield-0.5/src/unshield.c,
 uncomment

 /* #define _POSIX_C_SOURCE 2 */

 line, and surround the line with

 #ifdef __GLIBC__
 #endif

 -- 
 "Of course I love NetBSD":-)
 OBATA Akio / obache@NetBSD.org

From: "De Zeurkous" <zeurkous@nichten.info>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: RE: pkg/37078: archivers/unshield: libgetopt not referenced on 
     Slackware Lunix 10.2
Date: Mon, 8 Oct 2007 05:25:36 -0000 (UTC)

 On Mon, October 8, 2007 02:35, OBATA Akio wrote:
 > The following reply was made to PR pkg/37078; it has been noted by GNATS.
 >
 > From: "OBATA Akio" <obache@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: pkg/37078: archivers/unshield: libgetopt not referenced on
 > Slackware Lunix 10.2
 > Date: Mon, 08 Oct 2007 11:24:27 +0900
 >
 >  On Mon, 08 Oct 2007 11:05:07 +0900, De Zeurkous <zeurkous@nichten.info>
 > wrote:
 >
 >  >  Hm, that patch is malformed, at least relative to both mail-index,
 > gnats,
 >  >  and my system. Please put it up somewhere gzipped.
 >
 >  Sorry, the patch may not be applicable to 2007Q2 tree.
 >  Just for test, after make patch, edit work/unshield-0.5/src/unshield.c,
 >  uncomment
 >
 >  /* #define _POSIX_C_SOURCE 2 */
 >
 >  line, and surround the line with
 >
 >  #ifdef __GLIBC__
 >  #endif
 >
 >  --
 >  "Of course I love NetBSD":-)
 >  OBATA Akio / obache@NetBSD.org
 >
 >

 No, it was cut off and the encoding seemed to be broken. Check the way
 gnats noted your patch, and compare it with the relevant lines of actual
 input code.

 --De Zeurkous.

Responsible-Changed-From-To: pkg-manager->martin
Responsible-Changed-By: obache@netbsd.org
Responsible-Changed-When: Mon, 08 Oct 2007 06:19:11 +0000
Responsible-Changed-Why:
Over to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.