[58309] trunk/dports/sysutils/pv

jmr at macports.org jmr at macports.org
Fri Sep 25 14:10:06 PDT 2009


Revision: 58309
          http://trac.macports.org/changeset/58309
Author:   jmr at macports.org
Date:     2009-09-25 14:10:05 -0700 (Fri, 25 Sep 2009)
Log Message:
-----------
pv: buildfix for tiger

Modified Paths:
--------------
    trunk/dports/sysutils/pv/Portfile

Added Paths:
-----------
    trunk/dports/sysutils/pv/files/
    trunk/dports/sysutils/pv/files/stat64.diff

Modified: trunk/dports/sysutils/pv/Portfile
===================================================================
--- trunk/dports/sysutils/pv/Portfile	2009-09-25 19:53:44 UTC (rev 58308)
+++ trunk/dports/sysutils/pv/Portfile	2009-09-25 21:10:05 UTC (rev 58309)
@@ -24,3 +24,8 @@
 		rmd160 e10582d21bd13e11e6b1cb4ae138c148f1995561
 configure.args	--mandir=${prefix}/share/man --infodir=${prefix}/share/info
 depends_lib	port:gettext
+
+if {${os.platform} == "darwin" && ${os.major} != 9} {
+    # Leopard is the only release where stat64 exists and is not deprecated
+    patchfiles-append stat64.diff
+}

Added: trunk/dports/sysutils/pv/files/stat64.diff
===================================================================
--- trunk/dports/sysutils/pv/files/stat64.diff	                        (rev 0)
+++ trunk/dports/sysutils/pv/files/stat64.diff	2009-09-25 21:10:05 UTC (rev 58309)
@@ -0,0 +1,100 @@
+--- src/pv/file.c.orig	2008-03-06 23:09:57.000000000 +1100
++++ src/pv/file.c	2009-09-26 06:57:06.000000000 +1000
+@@ -37,27 +37,27 @@
+  */
+ void pv_calc_total_size(opts_t opts)
+ {
+-	struct stat64 sb;
++	struct stat sb;
+ 	int rc, i, j, fd;
+ 
+ 	opts->size = 0;
+ 	rc = 0;
+ 
+ 	if (opts->argc < 1) {
+-		if (fstat64(STDIN_FILENO, &sb) == 0)
++		if (fstat(STDIN_FILENO, &sb) == 0)
+ 			opts->size = sb.st_size;
+ 		return;
+ 	}
+ 
+ 	for (i = 0; i < opts->argc; i++) {
+ 		if (strcmp(opts->argv[i], "-") == 0) {
+-			rc = fstat64(STDIN_FILENO, &sb);
++			rc = fstat(STDIN_FILENO, &sb);
+ 			if (rc != 0) {
+ 				opts->size = 0;
+ 				return;
+ 			}
+ 		} else {
+-			rc = stat64(opts->argv[i], &sb);
++			rc = stat(opts->argv[i], &sb);
+ 			if (rc == 0)
+ 				rc = access(opts->argv[i], R_OK);
+ 		}
+@@ -103,14 +103,14 @@
+ 		fd = -1;
+ 
+ 		if (strcmp(opts->argv[i], "-") == 0) {
+-			rc = fstat64(STDIN_FILENO, &sb);
++			rc = fstat(STDIN_FILENO, &sb);
+ 			if ((rc != 0) || (!S_ISREG(sb.st_mode))) {
+ 				opts->size = 0;
+ 				return;
+ 			}
+ 			fd = dup(STDIN_FILENO);
+ 		} else {
+-			rc = stat64(opts->argv[i], &sb);
++			rc = stat(opts->argv[i], &sb);
+ 			if ((rc != 0) || (!S_ISREG(sb.st_mode))) {
+ 				opts->size = 0;
+ 				return;
+@@ -153,8 +153,8 @@
+  */
+ int pv_next_file(opts_t opts, int filenum, int oldfd)
+ {
+-	struct stat64 isb;
+-	struct stat64 osb;
++	struct stat isb;
++	struct stat osb;
+ 	int fd;
+ 
+ 	if (oldfd > 0) {
+@@ -186,7 +186,7 @@
+ 		}
+ 	}
+ 
+-	if (fstat64(fd, &isb)) {
++	if (fstat(fd, &isb)) {
+ 		fprintf(stderr, "%s: %s: %s: %s\n",
+ 			opts->program_name,
+ 			_("failed to stat file"),
+@@ -195,7 +195,7 @@
+ 		return -1;
+ 	}
+ 
+-	if (fstat64(STDOUT_FILENO, &osb)) {
++	if (fstat(STDOUT_FILENO, &osb)) {
+ 		fprintf(stderr, "%s: %s: %s\n",
+ 			opts->program_name,
+ 			_("failed to stat output file"), strerror(errno));
+--- src/pv/loop.c.orig	2008-03-06 23:09:57.000000000 +1100
++++ src/pv/loop.c	2009-09-26 07:04:54.000000000 +1000
+@@ -62,7 +62,7 @@
+ 	struct timeval start_time, next_update, next_reset, cur_time;
+ 	struct timeval init_time;
+ 	long double elapsed;
+-	struct stat64 sb;
++	struct stat sb;
+ 	int fd, n;
+ 
+ 	/*
+@@ -111,7 +111,7 @@
+ 		return 1;
+ 	}
+ 
+-	if (fstat64(fd, &sb) == 0) {
++	if (fstat(fd, &sb) == 0) {
+ 		pv_set_buffer_size(sb.st_blksize * 32, 0);
+ 	}
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090925/643b6461/attachment.html>


More information about the macports-changes mailing list