NetBSD Problem Report #36655

From yx@rtk0.lneuro.x.ua  Mon Jul 16 10:38:48 2007
Return-Path: <yx@rtk0.lneuro.x.ua>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 0A8E963B93E
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 16 Jul 2007 10:38:48 +0000 (UTC)
Message-Id: <200707160936.l6G9agx2001098@rtk0.lneuro.x.ua>
Date: Mon, 16 Jul 2007 12:36:42 +0300 (EEST)
From: yx@x.ua
Reply-To: yx@x.ua
To: gnats-bugs@NetBSD.org
Subject: pkgtools/pkg_install: fails to build on linux
X-Send-Pr-Version: 3.95

>Number:         36655
>Category:       pkg
>Synopsis:       pkgtools/pkg_install: fails to build on linux
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    joerg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 16 10:40:00 +0000 2007
>Closed-Date:    Sun Jan 06 20:04:00 +0000 2008
>Last-Modified:  Sun Jan 06 20:04:00 +0000 2008
>Originator:     Yakovetsky Vladimir
>Release:        NetBSD 4.99.19
>Organization:
Yakovetsky Vladimir
>Environment:
System: NetBSD lrou.x.ua 4.99.19 NetBSD 4.99.19 (lrou-1.825) #0: Mon May 7 16:00:07 EEST 2007 yx@lrou.x.ua:/sys/arch/i386/compile/lrou i386
Architecture: i386
Machine: i386
>Description:
pkg_install-20070715 fails to build on linux

>How-To-Repeat:
% uname -sr
Linux 2.6.21.5
% cd /usr/pkgsrc/pkgtools/pkg_install
% bmake
...
gcc -DHAVE_CONFIG_H -DDEF_UMASK=022 -DPREFIX="\"/usr/pkg\"" -DSYSCONFDIR="\"/usr/pkg/etc\"" -I/usr/obj/pkgtools/pkg_install/work/libnbcompat -DHOST=\"i386-debian-linux-gnu\" -DPKGSRC -I. -I../lib -O2 -march=pentium3 -finline-functions -fomit-frame-pointer -ffast-math -Wall -c audit-packages.c -o audit-packages.o
In file included from audit-packages.c:52:
/usr/obj/pkgtools/pkg_install/work/libnbcompat/nbcompat/sha2.h:57: error: expected specifier-qualifier-list before 'uint32_t'
/usr/obj/pkgtools/pkg_install/work/libnbcompat/nbcompat/sha2.h:62: error: expected specifier-qualifier-list before 'uint64_t'
audit-packages.c: In function 'old_pvfile':
audit-packages.c:771: error: 'struct stat' has no member named 'st_ctimespec'
*** Error code 1

Stop.
bmake: stopped in /usr/obj/pkgtools/pkg_install/work/pkg_install-20070715/audit-packages
*** Error code 1

>Fix:
--- pkg_install-20070715/audit-packages/audit-packages.c.orig
+++ pkg_install-20070715/audit-packages/audit-packages.c
@@ -47,6 +47,10 @@
 #include <sys/stat.h>
 #include <sys/time.h>

+#ifdef linux
+#include <stdint.h>
+#endif
+
 /* depending where we are being built pull in crypto support */
 #ifdef PKGSRC
 #include <nbcompat/sha2.h>
@@ -73,6 +77,11 @@
 #  define PKGPREFIX	PREFIX
 #endif

+#ifdef linux
+/* use GNU extensions */
+#  define __USE_GNU
+#endif
+
 /* macros */
 #define STRIP(c) 	((c) == '\n' || (c) == '\'' || (c) == '\"' || \
 			 (c) == '\t' || (c) == ' ' || (c) == '=')
@@ -768,7 +777,11 @@
 	} else {
 		/* difference between the file and now */
 		t_current = now_time.tv_sec;
+#ifdef __USE_GNU
+		t_pvfile = pvstat.st_ctime;
+#else
 		t_pvfile = pvstat.st_ctimespec.tv_sec;
+#endif
 		t_diff = (((((float) t_current - (float) t_pvfile) / 60) / 60) / 24);

 		if (t_diff >= 7)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->adrianp
Responsible-Changed-By: joerg@netbsd.org
Responsible-Changed-When: Mon, 16 Jul 2007 11:37:45 +0000
Responsible-Changed-Why:
audit-packages is Adrian's code.
Can you check merging the uintXX_t detection changes from digest?


From: "Tobias Nygren" <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: yx@x.ua, pkgsrc-bugs@NetBSD.org, adrianp@NetBSD.org
Subject: Re: pkg/36655: pkgtools/pkg_install: fails to build on linux
Date: Mon, 16 Jul 2007 21:53:58 +0200 (CEST)

 > +#ifdef __USE_GNU
 > +		t_pvfile = pvstat.st_ctime;
 > +#else
 >  		t_pvfile = pvstat.st_ctimespec.tv_sec;
 > +#endif

 Regarding the above: st_ctime is SUSv3, not GNU :-)
 I don't see a reason for using st_ctimespec at all, since
 we don't look at the nanosecond part.
 (The fix is needed on HP-UX as well)




From: Adrian Portelli <adrianp@stindustries.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36655: pkgtools/pkg_install: fails to build on linux
Date: Wed, 18 Jul 2007 23:06:04 +0100

 Hi,

 Could you please do a 'cvs update' to make sure you have all the latest
 changes and then apply the following patch:

 http://www.stindustries.net/NetBSD/stuff/pkg_install.diff

 (cd ${PREFIX} && cat pkg_install.diff | patch -p0)

 And see if this fixes your issues.

 thanks,

 adrian.

State-Changed-From-To: open->feedback
State-Changed-By: adrianp@netbsd.org
State-Changed-When: Wed, 18 Jul 2007 22:12:24 +0000
State-Changed-Why:
Feedback requested on latest patch.


From: Yakovetsky Vladimir <yx@x.ua>
To: gnats-bugs@NetBSD.org
Cc: adrianp@NetBSD.org, gnats-admin@NetBSD.org,
	pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/36655: pkgtools/pkg_install: fails to build on linux
Date: Thu, 19 Jul 2007 11:49:21 +0300

 On Wed, Jul 18, 2007 at 10:10:07PM +0000, Adrian Portelli wrote:
 > 
 >  Hi,
 >  
 >  Could you please do a 'cvs update' to make sure you have all the latest
 >  changes and then apply the following patch:
 >  http://www.stindustries.net/NetBSD/stuff/pkg_install.diff
 >  (cd ${PREFIX} && cat pkg_install.diff | patch -p0)
 >  And see if this fixes your issues.
 >  
   It's fixed, thanks.

 -- 
 Yakovetsky Vladimir

From: Adrian Portelli <adrianp@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36655 CVS commit: pkgsrc/pkgtools/pkg_install/files
Date: Sat, 21 Jul 2007 10:21:05 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	adrianp
 Date:		Sat Jul 21 10:21:05 UTC 2007

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files: configure configure.ac
 	pkgsrc/pkgtools/pkg_install/files/audit-packages: audit-packages.c
 	    audit-packages.conf.5.in audit-packages.conf.cat5.in

 Log Message:
 Misc man page fixes
 Update to autoconf 2.61
 Add checks for AC_TYPE_UINT{8,16,32,64}_T
 Add checks for stdint.h
 Change how config file notification works
 If no IGNORE_URLS directive is found then just say that
 Check that pkg-vulnerabilities exists before we try any operations on it
 Use st_ctime as opposed to st_ctimespec.tv_sec as the former is SUSv3
 This update should fix PR #36655 and go part way to fixing PR #36662

 Thanks to tnn@ and joerg@ for suggested fixes and Yakovetsky Vladimir and
  Stuart Shelton for testing and patches.


 To generate a diff of this commit:
 cvs rdiff -r1.21 -r1.22 pkgsrc/pkgtools/pkg_install/files/configure
 cvs rdiff -r1.19 -r1.20 pkgsrc/pkgtools/pkg_install/files/configure.ac
 cvs rdiff -r1.2 -r1.3 \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.c \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.conf.5.in \
     pkgsrc/pkgtools/pkg_install/files/audit-packages/audit-packages.conf.cat5.in

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: adrianp->joerg
Responsible-Changed-By: joerg@netbsd.org
Responsible-Changed-When: Sat, 21 Jul 2007 13:34:33 +0000
Responsible-Changed-Why:
Requested to handle the missing @gzcat@ expansion in bootstrap
differently.


State-Changed-From-To: feedback->open
State-Changed-By: joerg@netbsd.org
State-Changed-When: Sat, 21 Jul 2007 13:34:33 +0000
State-Changed-Why:
One issue remains.


State-Changed-From-To: open->feedback
State-Changed-By: joerg@netbsd.org
State-Changed-When: Sat, 05 Jan 2008 05:39:47 +0000
State-Changed-Why:
Is there any problem left?


From: Yakovetsky Vladimir <yx@x.ua>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org, pkgsrc-bugs@NetBSD.org, gnats-admin@NetBSD.org
Subject: Re: pkg/36655 (pkgtools/pkg_install: fails to build on linux)
Date: Sun, 6 Jan 2008 20:17:46 +0200

 On Sat, Jan 05, 2008 at 05:39:48AM +0000, joerg@NetBSD.org wrote:
 > Synopsis: pkgtools/pkg_install: fails to build on linux
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: joerg@netbsd.org
 > State-Changed-When: Sat, 05 Jan 2008 05:39:47 +0000
 > State-Changed-Why:
 > Is there any problem left?
 > 
   no (fixed in july 2007).


 -- 
 Yakovetsky Vladimir

State-Changed-From-To: feedback->closed
State-Changed-By: rillig@netbsd.org
State-Changed-When: Sun, 06 Jan 2008 20:04:00 +0000
State-Changed-Why:
Everything's fine. Thanks for the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.