Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Apr 2011 20:11:38 -0500 (CDT)
From:      "Douglas K. Rand" <rand@meridian-enviro.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/156629: [patch] sysutils/puppet patch to use PACKAGEROOT instead of PACKAGESITE
Message-ID:  <201104250111.p3P1BcrI061165@newman.meridian-enviro.com>
Resent-Message-ID: <201104250130.p3P1UBnQ025067@freefall.freebsd.org>

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

>Number:         156629
>Category:       ports
>Synopsis:       [patch] sysutils/puppet patch to use PACKAGEROOT instead of PACKAGESITE
>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:   Mon Apr 25 01:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Douglas K. Rand
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
Meridian Environmental Technology
>Environment:
System: FreeBSD kermit.meridian-enviro.com 8.2-RELEASE FreeBSD 8.2-RELEASE #1: Fri Mar 11 18:14:49 CST 2011 rand@kermit.meridian-enviro.com:/usr/obj/usr/src/sys/SERVER amd64


	
>Description:
We use our own local (and slightly modified) package site
for use with puppet, and setting the PACKAGEROOT env for
pkg_add works alot cleaner for us than PACKAGESITE. We get
to push off to pkg_add the work of choosing arch and version.
The patch lets you set source in a module to something like:
	http://packages.mydomain.com/
and pkg_add will automatically append, for example:
	/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/zsh.tbz
to the source.

This patch does not work if you leave the default PACKAGE_ORIGIN option
enabled.

>How-To-Repeat:
I thought about patching the existing files/optpatch-package_origin
to use pkg_add -r instead of pkg_add -f, but this seemed like a lower
impact approach.
>Fix:


--- sysutils/puppet/Makefile	2011-04-10 11:11:49.000000000 -0500
+++ sysutils/puppet/Makefile	2011-04-21 20:22:55.000000000 -0500
@@ -40,7 +40,8 @@
 	puppetdoc.8 puppetmasterd.8 puppetrun.8 ralsh.8 puppetqd.8
 
 OPTIONS=	MONGREL		"Run puppet server as a mongrel service"	Off \
-		PACKAGE_ORIGIN	"Use port origin as package name"		On
+		PACKAGE_ORIGIN	"Use port origin as package name"		On \
+		PACKAGE_ROOT	"Use PACKAGEROOT insted of PACKAGESITE"		Off
 
 .include <bsd.port.options.mk>
 
@@ -53,6 +54,14 @@
 RUN_DEPENDS+=	${RUBY_SITEARCHLIBDIR}/bz2.so:${PORTSDIR}/archivers/ruby-bz2
 .endif
 
+.if defined(WITH_PACKAGE_ROOT)
+.if !defined(WITH_PACKAGE_ORIGIN)
+EXTRA_PATCHES+=	${FILESDIR}/optpatch-package_root
+.else
+BROKEN=	"PACKAGE_ROOT option patch is incompatable with PACKAGE_ORIGIN patch."
+.endif
+.endif
+
 .include <bsd.port.pre.mk>
 
 post-patch:
--- /dev/null	2011-04-21 20:34:09.000000000 -0500
+++ /local-project/jails/wiki/usr/ports/sysutils/puppet/files/optpatch-package_root	2011-04-21 20:23:42.000000000 -0500
@@ -0,0 +1,11 @@
+--- lib/puppet/provider/package/freebsd.rb-orig	2011-04-21 19:36:17.000000000 -0500
++++ lib/puppet/provider/package/freebsd.rb	2011-04-21 20:09:50.000000000 -0500
+@@ -20,7 +20,7 @@
+ 
+     if @resource[:source] =~ /\/$/
+       if @resource[:source] =~ /^(ftp|https?):/
+-        Puppet::Util::Execution::withenv :PACKAGESITE => @resource[:source] do
++        Puppet::Util::Execution::withenv :PACKAGEROOT => @resource[:source] do
+           pkgadd "-r", @resource[:name]
+         end
+       else

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



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