From nobody@FreeBSD.org  Tue Jan 31 14:25:16 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A0EF1065674
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Jan 2012 14:25:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E1DE18FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Jan 2012 14:25:15 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VEPF2o058948
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Jan 2012 14:25:15 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0VEPFRI058947;
	Tue, 31 Jan 2012 14:25:15 GMT
	(envelope-from nobody)
Message-Id: <201201311425.q0VEPFRI058947@red.freebsd.org>
Date: Tue, 31 Jan 2012 14:25:15 GMT
From: Vitaly Magerya <vmagerya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [maintainer] devel/premake4: fix broken regression tests
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164665
>Category:       ports
>Synopsis:       [maintainer] devel/premake4: fix broken regression tests
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 31 14:30:16 UTC 2012
>Closed-Date:    Sun Mar 04 12:27:23 UTC 2012
>Last-Modified:  Sun Mar  4 12:30:05 UTC 2012
>Originator:     Vitaly Magerya
>Release:        
>Organization:
>Environment:
>Description:
It appears that delve/premake4 has a set of unit tests, and two of them
do not currently pass, as premake tries to read from /etc/ld.so.conf,
which we don't have.

The attached patch fixes that problem, and implements regression-test
target.

You can see tinderbox logs at [1].

[1] https://redports.org/buildarchive/20120131150907-284/
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -x .svn -ruN premake4.orig/Makefile premake4/Makefile
--- premake4.orig/Makefile	2012-01-31 16:18:30.000000000 +0200
+++ premake4/Makefile	2012-01-31 15:20:56.000000000 +0200
@@ -29,12 +29,16 @@
 
 post-patch:
 	${REINPLACE_CMD} -e 's|-ldl||' ${BUILD_WRKSRC}/Premake4.make
+	${REINPLACE_CMD} -e 's|debug|release|' ${WRKSRC}/tests/test
 
 do-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}
 .endif
-	@${INSTALL_PROGRAM} ${WRKSRC}/bin/release/premake4 ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/bin/release/premake4 ${PREFIX}/bin
+
+regression-test: build
+	cd ${WRKSRC}/tests && ./test
 
 .include <bsd.port.post.mk>
diff -x .svn -ruN premake4.orig/files/patch-src-base-os.lua premake4/files/patch-src-base-os.lua
--- premake4.orig/files/patch-src-base-os.lua	1970-01-01 03:00:00.000000000 +0300
+++ premake4/files/patch-src-base-os.lua	2012-01-31 15:42:59.000000000 +0200
@@ -0,0 +1,17 @@
+--- src/base/os.lua.orig	2012-01-31 15:40:25.000000000 +0200
++++ src/base/os.lua	2012-01-31 15:42:16.000000000 +0200
+@@ -33,14 +33,6 @@
+ 			else
+ 				formats = { "lib%s.so", "%s.so" }
+ 				path = os.getenv("LD_LIBRARY_PATH") or ""
+-	
+-				io.input("/etc/ld.so.conf")
+-				if io.input() then
+-					for line in io.lines() do
+-						path = path .. ":" .. line
+-					end
+-					io.input():close()
+-				end
+ 			end
+ 			
+ 			table.insert(formats, "%s")	
diff -x .svn -ruN premake4.orig/files/patch-src-host-scripts.c premake4/files/patch-src-host-scripts.c
--- premake4.orig/files/patch-src-host-scripts.c	1970-01-01 03:00:00.000000000 +0300
+++ premake4/files/patch-src-host-scripts.c	2012-01-31 16:05:38.000000000 +0200
@@ -0,0 +1,5 @@
+--- src/host/scripts.c.orig	2010-11-16 13:29:13.000000000 +0200
++++ src/host/scripts.c	2012-01-31 16:05:26.000000000 +0200
+@@ -7 +7 @@
+-	"function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nio.input(\"/etc/ld.so.conf\")\nif io.input() then\nfor line in io.lines() do\npath = path .. \":\" .. line\nend\nio.input():close()\nend\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal function d
 omatch(result, mask, wantfiles)\nif mas"
++	"function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal function domatch(result, mask, wantfiles)\nif mas"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Wed Feb 1 11:21:45 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164665 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Sun Mar 4 07:10:02 UTC 2012 
State-Changed-Why:  

Hi, 

this patch is not clean: 

|--- premake4.orig/files/patch-src-host-scripts.c       1970-01-01 
03:00:00.000000000 +0300 |+++ premake4/files/patch-src-host-scripts.c 
2012-01-31 16:05:38.000000000 +0200 -------------------------- (Creating 
file patch-src-host-scripts.c...) Patching file patch-src-host-scripts.c 
using Plan A...  patch: **** malformed patch at line 55:  omatch(result, 
mask, wantfiles)nif mas" 


http://www.freebsd.org/cgi/query-pr.cgi?pr=164665 

From: Vitaly Magerya <vmagerya@gmail.com>
To: miwi@freebsd.org
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/164665: [maintainer] devel/premake4: fix broken regression tests
Date: Sun, 4 Mar 2012 12:24:51 +0200

 miwi@freebsd.org wrote:
 > Hi,
 >
 > this patch is not clean:
 >
 > [...]
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=164665
 
 It appears that the patch has one of it's lines wrapped around at
 990 characters. (Does web interface do that automatically or was
 it my mistake?)
 
 Anyway, you can get the original patch at [1].
 
 [1] http://tx97.net/~magv/premake4-fix.diff
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sun Mar 4 12:27:23 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164665 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/164665: commit references a PR
Date: Sun,  4 Mar 2012 12:27:23 +0000 (UTC)

 miwi        2012-03-04 12:27:14 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/premake4       Makefile 
   Added files:
     devel/premake4/files patch-src-base-os.lua 
                          patch-src-host-scripts.c 
   Log:
   - Fix broken regression test
   
   PR:             164665
   Submitted by:   maintainer
   
   Revision  Changes    Path
   1.2       +5 -1      ports/devel/premake4/Makefile
   1.1       +17 -0     ports/devel/premake4/files/patch-src-base-os.lua (new)
   1.1       +5 -0      ports/devel/premake4/files/patch-src-host-scripts.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
