Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 2010 17:24:48 -0700 (PDT)
From:      Russell Jackson <raj@csub.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        noc@csub.edu
Subject:   ports/146812: maintainer-update: sysutils/puppet
Message-ID:  <201005220024.o4M0OmWD017021@fbsd.csub.edu>
Resent-Message-ID: <201005220110.o4M1A15Q021766@freefall.freebsd.org>

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

>Number:         146812
>Category:       ports
>Synopsis:       maintainer-update: sysutils/puppet
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 22 01:10:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Russell Jackson
>Release:        
>Organization:
California State University Bakersfield
>Environment:
>Description:
	Update port to 0.25.5.

	Adds files:
		files/patch-lib-puppet-provider-package-ports.rb
		files/patch-lib-puppet-provider-service-freebsd.rb

	New dependencies:

		textproc/agueas (submitted in ports/146743)
		textproc/rubygem-ruby-augeas (submitted ports/146744)
>How-To-Repeat:
>Fix:
diff -urN puppet.orig/Makefile puppet/Makefile
--- puppet.orig/Makefile	2010-05-21 16:45:08.000000000 -0700
+++ puppet/Makefile	2010-05-21 17:14:09.000000000 -0700
@@ -2,19 +2,20 @@
 # Date created:		2007-03-03
 # Whom:			Tomoyuki Sakurai <cherry@trombik.mine.nu>
 #
 # $FreeBSD: ports/sysutils/puppet/Makefile,v 1.13 2010/04/05 23:04:13 sylvio Exp $
 #
 
 PORTNAME=	puppet
-PORTVERSION=	0.25.4
+PORTVERSION=	0.25.5
 CATEGORIES=	sysutils
-MASTER_SITES=	http://www.puppetlabs.com/downloads/${PORTNAME}/
+MASTER_SITES=	http://www.puppetlabs.com/downloads/puppet/
 
 MAINTAINER=	raj@csub.edu
 COMMENT=	A configuration management framework written in Ruby
 
 BUILD_DEPENDS=	${RUBY_SITELIBDIR}/facter.rb:${PORTSDIR}/sysutils/facter \
-	portupgrade>0:${PORTSDIR}/ports-mgmt/portupgrade
+	rubygem-ruby-augeas-local>0:${PORTSDIR}/local/rubygem-ruby-augeas \
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
 CONFLICTS=	puppet-devel-[0-9]*
@@ -35,7 +36,7 @@
 		PUPPET_WORKDIR="${PUPPET_WORKDIR}"
 
 MANCOMPRESSED=	yes
-MAN8=	filebucket.8 pi.8 puppet.8 puppet.conf.8 puppetca.8 puppetd.8 \
+MAN8=	filebucket.8 pi.8 puppet.8 puppetca.8 puppetd.8 \
 	puppetdoc.8 puppetmasterd.8 puppetrun.8 ralsh.8 puppetqd.8
 
 .include <bsd.port.pre.mk>
@@ -57,7 +58,7 @@
 .for DIR in ssl manifests
 	${INSTALL} -d ${PREFIX}/etc/${PORTNAME}/${DIR}
 .endfor
-	${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/bin/puppetmasterd \
+	${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/sbin/puppetmasterd \
 		--confdir=${PREFIX}/etc/${PORTNAME} \
 		--rundir=${PUPPET_RUNDIR} \
 		--genconfig | \
diff -urN puppet.orig/distinfo puppet/distinfo
--- puppet.orig/distinfo	2010-05-21 16:45:08.000000000 -0700
+++ puppet/distinfo	2010-05-19 11:45:29.000000000 -0700
@@ -1,3 +1,3 @@
-MD5 (puppet-0.25.4.tar.gz) = 69c97019fda5620f9f45f6ad64407e3b
-SHA256 (puppet-0.25.4.tar.gz) = c2dd640a31d1e57ad09929001f90247cd83908485f1f737abca352eb1866fbf3
-SIZE (puppet-0.25.4.tar.gz) = 1424240
+MD5 (puppet-0.25.5.tar.gz) = 2988385801c967f7262cdf08640c9e07
+SHA256 (puppet-0.25.5.tar.gz) = 88038160a4a91790475012df10396e6292dcf39c0402ac42edf89f755fb9b105
+SIZE (puppet-0.25.5.tar.gz) = 1446756
diff -urN puppet.orig/files/patch-lib-puppet-provider-package-ports.rb puppet/files/patch-lib-puppet-provider-package-ports.rb
--- puppet.orig/files/patch-lib-puppet-provider-package-ports.rb	1969-12-31 16:00:00.000000000 -0800
+++ puppet/files/patch-lib-puppet-provider-package-ports.rb	2010-05-21 16:38:25.000000000 -0700
@@ -0,0 +1,46 @@
+--- lib/puppet/provider/package/ports.rb.orig	2010-05-21 16:34:09.000000000 -0700
++++ lib/puppet/provider/package/ports.rb	2010-05-21 16:28:32.000000000 -0700
+@@ -1,12 +1,13 @@
+ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :freebsd do
+     desc "Support for FreeBSD's ports.  Again, this still mixes packages and ports."
+ 
+-    commands :portupgrade => "/usr/local/sbin/portupgrade",
++    commands :portinstall => "/usr/local/sbin/portinstall",
++             :portupgrade => "/usr/local/sbin/portupgrade",
+              :portversion => "/usr/local/sbin/portversion",
+              :portuninstall => "/usr/local/sbin/pkg_deinstall",
+              :portinfo => "/usr/sbin/pkg_info"
+ 
+-    defaultfor :operatingsystem => :freebsd
++    confine :operatingsystem => nil
+ 
+     # I hate ports
+     %w{INTERACTIVE UNAME}.each do |var|
+@@ -16,11 +17,9 @@
+     end
+ 
+     def install
+-        # -N: install if the package is missing, otherwise upgrade
+-        # -M: yes, we're a batch, so don't ask any questions
+-        cmd = %w{-N -M BATCH=yes} << @resource[:name]
++        cmd = %w{--batch} << @resource[:name]
+ 
+-        output = portupgrade(*cmd)
++        output = portinstall(*cmd)
+         if output =~ /\*\* No such /
+             raise Puppet::ExecutionFailure, "Could not find package %s" % @resource[:name]
+         end
+@@ -91,7 +90,12 @@
+     end
+ 
+     def update
+-        install()
++        cmd = %w{--batch} << @resource[:name]
++
++        output = portupgrade(*cmd)
++        if output =~ /\*\* No such /
++            raise Puppet::ExecutionFailure, "Could not find package %s" % @resource[:name]
++        end
+     end
+ end
+ 
diff -urN puppet.orig/files/patch-lib-puppet-provider-service-freebsd.rb puppet/files/patch-lib-puppet-provider-service-freebsd.rb
--- puppet.orig/files/patch-lib-puppet-provider-service-freebsd.rb	1969-12-31 16:00:00.000000000 -0800
+++ puppet/files/patch-lib-puppet-provider-service-freebsd.rb	2010-05-21 17:09:49.000000000 -0700
@@ -0,0 +1,74 @@
+--- lib/puppet/provider/service/freebsd.rb.orig	2010-05-17 17:40:49.000000000 -0700
++++ lib/puppet/provider/service/freebsd.rb	2010-05-21 17:06:06.000000000 -0700
+@@ -1,47 +1,48 @@
+ # Manage FreeBSD services.
+-Puppet::Type.type(:service).provide :freebsd, :parent => :init do
+-    desc "FreeBSD's (and probably NetBSD?) form of ``init``-style service management.
++# vim: set ts=4 sw=4 expandtab:
+ 
+-    Uses ``rc.conf.d`` for service enabling and disabling.
++require 'augeas' if Puppet.features.augeas?
+ 
++Puppet::Type.type(:service).provide :freebsd, :parent => :init do
++    desc "FreeBSD's form of ``init``-style service management.
+ "
+ 
+-    confine :operatingsystem => [:freebsd, :netbsd, :openbsd]
+-
++    confine :operatingsystem => :freebsd
+     defaultfor :operatingsystem => :freebsd
+ 
+-    @@rcconf_dir = '/etc/rc.conf.d'
++    confine :true => Puppet.features.augeas?
++
++    @@rcconf = "/etc/rc.conf"
+ 
+     def self.defpath
+         superclass.defpath
+     end
+ 
+-    # remove service file from rc.conf.d to disable it
+-    def disable
+-        rcfile = File.join(@@rcconf_dir, @model[:name])
+-        if File.exists?(rcfile)
+-            File.delete(rcfile)
++    def setrcvar(value)
++        Augeas::open do |aug|
++            aug.set("/files%s/%s_enable" % [@@rcconf, @model[:name]], value)
++            aug.save
+         end
+     end
+ 
+-    # if the service file exists in rc.conf.d then it's already enabled
++    def getrcvar
++        Augeas::open { |aug| aug.get("/files%s/%s_enable" % [@@rcconf, @model[:name]]) }
++    end
++
++    def disable
++        setrcvar("NO")
++    end
++
+     def enabled?
+-        rcfile = File.join(@@rcconf_dir, @model[:name])
+-        if File.exists?(rcfile)
++        if getrcvar == "YES"
+             return :true
++        else
++            return :false
+         end
+-
+-        return :false
+     end
+ 
+-    # enable service by creating a service file under rc.conf.d with the
+-    # proper contents
+     def enable
+-        if not File.exists?(@@rcconf_dir)
+-            Dir.mkdir(@@rcconf_dir)
+-        end
+-        rcfile = File.join(@@rcconf_dir, @model[:name])
+-        open(rcfile, 'w') { |f| f << "%s_enable=\"YES\"\n" % @model[:name] }
++        setrcvar("YES")
+     end
+ 
+     # Override stop/start commands to use one<cmd>'s and the avoid race condition

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



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