Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 2014 07:55:26 -0500 (CDT)
From:      Alex Stangl <alex@stangl.us>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/190066: [patch] lang/ruby19 (and lang/ruby20, lang/ruby21) fix
Message-ID:  <20140521125526.A5E1017048@scout.stangl.us>
Resent-Message-ID: <201405211300.s4LD00ZR035836@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         190066
>Category:       ports
>Synopsis:       [patch] lang/ruby19 (and lang/ruby20, lang/ruby21) fix
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 21 13:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Alex Stangl
>Release:        FreeBSD 9.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD scout.stangl.us 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

Makefile was missing ${STAGEDIR} for source of find commands for ${RUBY_RIDIR}.
This would manifest as a problem in one of two ways:

1. If actual ${RUBY_RIDIR} contained leftover directories and files, a bunch
of error messages like this would be emitted:
pkg-static: Plist error, directory listed as a file: /usr/local/share/ri/1.9/system/ACL/ACLList
pkg-static: Plist error, directory listed as a file: /usr/local/share/ri/1.9/system/ACL/ACL


2. If actual ${RUBY_RIDIR} non-existent or empty, then find command would not
actually do anything, i.e., not add anything to the ${TMPPLIST}, since it's
operating out of the real ${RUBY_RIDIR} rather than the staging directory version.
This in turn makes scenario #1 likely to happen since a deinstall won't clean up these files.

I also cleaned up a few of the many warnings emitted. The created.rid files were reported as
orphaned. I believe these should either be deleted from the stage directory before packaging,
or else included as part of the plist. I opted for the latter, as it seems like these files
are harmless and probably actually desired, especially in ${RUBY_SITERIDIR}, if I understand
the purpose of these files correctly.

Although these fixes are shown for lang/ruby19 Makefile, it appears lang/ruby20
and lang/ruby21 need the same fixes.

	
>How-To-Repeat:

Problem can be demonstrated by trying to package the port when the ${RUBY_RIDIR} has contents
leftover from a previous install.
	
>Fix:

Index: Makefile
===================================================================
--- Makefile	(revision 354748)
+++ Makefile	(working copy)
@@ -40,7 +40,7 @@
 WRKSRC=		${WRKDIR}/${PORTNAME}-${RUBY_DISTVERSION}
 
 RUBY_VER=		1.9
-USE_BZIP2=		yes
+USES=	tar:bzip2
 USE_RUBY=		yes
 RUBY_NO_BUILD_DEPENDS=	yes
 RUBY_NO_RUN_DEPENDS=	yes
@@ -207,12 +207,13 @@
 #
 # Add generated RI files to pkg-plist
 #
-	@${FIND} -ds ${RUBY_RIDIR}/ ! -type d ! -name created.rid | \
+	@${FIND} -ds ${STAGEDIR}${RUBY_RIDIR}/ ! -type d | \
 		${SED} 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST}
-	@${FIND} -ds ${RUBY_RIDIR}/ -type d -mindepth 1 | \
+	@${FIND} -ds ${STAGEDIR}${RUBY_RIDIR}/ -type d -mindepth 1 | \
 		${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
+	@${FIND} -ds ${STAGEDIR}${RUBY_SITERIDIR}/ ! -type d | \
+		${SED} 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST}
 
-
 #
 # Add generated doxygen files to pkg-plist
 #

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140521125526.A5E1017048>