Subject: pkg/30423: Don't use non-portable PRIu64 in pkgtools
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <tnn@netilium.org>
List: pkgsrc-bugs
Date: 06/04/2005 07:41:00
>Number:         30423
>Category:       pkg
>Synopsis:       Don't use non-portable PRIu64 in pkgtools
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 04 07:41:00 +0000 2005
>Originator:     Tobias Nygren
>Release:        OSF 5.1
>Organization:
>Environment:
>Description:
Back out the use of PRIu64 in pkg_add/perform.c since it breaks on Tru64.
Use the print method advised by libnbcompat instead.

References:

Problem described in by Tobias Nygren in http://mail-index.netbsd.org/tech-pkg/2005/05/28/0007.html
Solution suggested by Grant Beattie in
http://mail-index.netbsd.org/tech-pkg/2005/05/29/0002.html

>How-To-Repeat:

>Fix:
Index: pkgtools/pkg_install/files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.30
diff -u -r1.30 perform.c
--- pkgtools/pkg_install/files/add/perform.c	28 May 2005 02:50:46 -0000	1.30
+++ pkgtools/pkg_install/files/add/perform.c	4 Jun 2005 07:40:06 -0000
@@ -326,7 +326,12 @@
 
 			needed = 4 * (uint64_t) sb.st_size;
 			if (!inPlace && min_free(playpen) < needed) {
-				warnx("projected size of %" PRIu64 " bytes exceeds available free space\n"
+#ifdef HAVE_PRINTF_QD
+#define LLD "qd"
+#else
+#define LLD "lld"
+#endif
+				warnx("projected size of %" LLD " bytes exceeds available free space\n"
 				    "in %s. Please set your PKG_TMPDIR variable to point\n"
 				    "to a location with more free space and try again.",
 					needed, playpen);