ports/132060: [PATCH] graphics/ophoto: fix after strndup addition/MFC, remove BROKEN tag

Florian Smeets flo at kasimir.com
Tue Feb 24 13:30:03 UTC 2009


>Number:         132060
>Category:       ports
>Synopsis:       [PATCH] graphics/ophoto: fix after strndup addition/MFC, remove BROKEN tag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 24 13:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Florian Smeets
>Release:        FreeBSD 7.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD mail.solomo.de 7.1-STABLE FreeBSD 7.1-STABLE #4: Mon Jan  5 22:33:23 CET
>Description:
this port was broken by the addition/MFC of strndup. With this patch it builds again.

Added file(s):
- files/patch-utils.c
- files/patch-utils.h

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
build on 7-STABLE >= 701101 or 8-CURRENT >= 800058 without this patch
>Fix:
use strndup function included in the port only in the cases where it's needed

--- ophoto-0.1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/graphics/ophoto.orig/Makefile /usr/ports/graphics/ophoto/Makefile
--- /usr/ports/graphics/ophoto.orig/Makefile	2009-02-24 14:15:10.000000000 +0100
+++ /usr/ports/graphics/ophoto/Makefile	2009-02-24 14:05:02.000000000 +0100
@@ -20,10 +20,4 @@
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/ophoto ${PREFIX}/bin
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 800058 || (${OSVERSION} >= 701101 && ${OSVERSION} < 800000)
-BROKEN=		does not build
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/graphics/ophoto.orig/files/patch-utils.c /usr/ports/graphics/ophoto/files/patch-utils.c
--- /usr/ports/graphics/ophoto.orig/files/patch-utils.c	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/graphics/ophoto/files/patch-utils.c	2009-02-24 14:10:37.000000000 +0100
@@ -0,0 +1,21 @@
+--- utils.c.orig	2009-02-24 14:08:54.000000000 +0100
++++ utils.c	2009-02-24 14:07:20.000000000 +0100
+@@ -54,6 +54,9 @@
+ 	return (mem);
+ }
+ 
++#if defined(__FreeBSD__)
++#include <osreldate.h>
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100
+ char *strndup (const char *src, int num)
+ {
+ 	char *dst;
+@@ -63,6 +66,8 @@
+ 	dst[num] = '\0';
+ 	return (strncpy(dst, src, num));
+ }
++#endif
++#endif
+ 
+ char *justify (char *str)
+ {
diff -ruN --exclude=CVS /usr/ports/graphics/ophoto.orig/files/patch-utils.h /usr/ports/graphics/ophoto/files/patch-utils.h
--- /usr/ports/graphics/ophoto.orig/files/patch-utils.h	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/graphics/ophoto/files/patch-utils.h	2009-02-24 14:10:42.000000000 +0100
@@ -0,0 +1,21 @@
+--- utils.h.orig	2009-02-24 14:08:58.000000000 +0100
++++ utils.h	2009-02-24 14:07:43.000000000 +0100
+@@ -65,6 +65,9 @@
+  *   allocated.
+  */
+ 
++#if defined(__FreeBSD__)  
++#include <osreldate.h>  
++#if __FreeBSD_version <= 800057 && __FreeBSD_version > 800000 || __FreeBSD_version <= 701100  
+ char *strndup (const char *src, int num);
+ /*
+  *   Like strdup(), but limits the string length to at most
+@@ -73,6 +76,8 @@
+  *   Always allocates <num>+1 bytes, even if less space would
+  *   be sufficient to store <src>.
+  */
++#endif
++#endif
+ 
+ char *justify (char *str);
+ /*
--- ophoto-0.1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list