svn commit: r403618 - in head/sysutils/puppet: . files

Michael Moll mmoll at FreeBSD.org
Sat Dec 12 17:31:18 UTC 2015


Author: mmoll
Date: Sat Dec 12 17:31:17 2015
New Revision: 403618
URL: https://svnweb.freebsd.org/changeset/ports/403618

Log:
  sysutils/puppet: refresh pkgng provider and remove pkg_* patches

Deleted:
  head/sysutils/puppet/files/optpatch-package_origin
  head/sysutils/puppet/files/optpatch-package_root
Modified:
  head/sysutils/puppet/Makefile
  head/sysutils/puppet/files/patch-lib_puppet_provider_package_pkgng.rb

Modified: head/sysutils/puppet/Makefile
==============================================================================
--- head/sysutils/puppet/Makefile	Sat Dec 12 17:30:06 2015	(r403617)
+++ head/sysutils/puppet/Makefile	Sat Dec 12 17:31:17 2015	(r403618)
@@ -3,6 +3,7 @@
 
 PORTNAME=	puppet
 PORTVERSION=	3.8.4
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://downloads.puppetlabs.com/puppet/
 
@@ -32,30 +33,9 @@ SUB_FILES+=	pkg-message
 SUB_LIST=	RUBY=${RUBY}
 
 OPTIONS_DEFINE=		DOCS EXAMPLES
-OPTIONS_DEFAULT=	PACKAGE_ORIGIN
-OPTIONS_RADIO=		PATCHES
-OPTIONS_RADIO_PATCHES=	PACKAGE_ORIGIN PACKAGE_ROOT
-PACKAGE_ORIGIN_DESC=	Use port origin as package name
-PACKAGE_ROOT_DESC=	Use PACKAGEROOT instead of PACKAGESITE
-PATCHES_DESC=		Optional exclusive patches
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MPACKAGE_ROOT}
-.if ! ${PORT_OPTIONS:MPACKAGE_ORIGIN}
-EXTRA_PATCHES+=	${FILESDIR}/optpatch-package_root
-.else
-BROKEN=	PACKAGE_ROOT option patch is incompatible with PACKAGE_ORIGIN patch.
-.endif
-.endif
 
 .include <bsd.port.pre.mk>
 
-.if ${PORT_OPTIONS:MPACKAGE_ORIGIN}
-EXTRA_PATCHES+=	${FILESDIR}/optpatch-package_origin
-RUN_DEPENDS+=	rubygem-bzip2-ruby>=0:${PORTSDIR}/archivers/rubygem-bzip2-ruby
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e "s|/etc/puppet|${ETCDIR}|" \
 		${WRKSRC}/install.rb \

Modified: head/sysutils/puppet/files/patch-lib_puppet_provider_package_pkgng.rb
==============================================================================
--- head/sysutils/puppet/files/patch-lib_puppet_provider_package_pkgng.rb	Sat Dec 12 17:30:06 2015	(r403617)
+++ head/sysutils/puppet/files/patch-lib_puppet_provider_package_pkgng.rb	Sat Dec 12 17:31:17 2015	(r403618)
@@ -1,6 +1,6 @@
 --- /dev/null
 +++ lib/puppet/provider/package/pkgng.rb
-@@ -0,0 +1,150 @@
+@@ -0,0 +1,142 @@
 +require 'puppet/provider/package'
 +
 +Puppet::Type.type(:package).provide :pkgng, :parent => Puppet::Provider::Package do
@@ -16,13 +16,11 @@
 +  has_feature :upgradeable
 +
 +  def self.get_query
-+    @pkg_query = @pkg_query || pkg(['query', '-a', '%n %v %o'])
-+    @pkg_query
++    pkg(['query', '-a', '%n %v %o'])
 +  end
 +
 +  def self.get_version_list
-+    @version_list = @version_list || pkg(['version', '-voRL='])
-+    @version_list
++    @version_info_list ||= pkg(['version', '-voRL='])
 +  end
 +
 +  def self.get_latest_version(origin)
@@ -84,19 +82,20 @@
 +    source = resource[:source]
 +    source = URI(source) unless source.nil?
 +
-+    # If resource[:name] is actually an origin (e.g. 'www/curl' instead of
-+    # just 'curl'), drop the category prefix. pkgng doesn't support version
-+    # pinning with the origin syntax (pkg install curl-1.2.3 is valid, but
-+    # pkg install www/curl-1.2.3 is not).
-+    if resource[:name] =~ /\//
-+      installname = resource[:name].split('/')[1]
-+    else
-+      installname = resource[:name]
-+    end
-+
 +    # Ensure we handle the version
-+    if resource[:ensure] =~ /\./
-+      installname += '-' + resource[:ensure]
++    case resource[:ensure]
++    when true, false, Symbol
++      installname = resource[:name]
++      else
++        # If resource[:name] is actually an origin (e.g. 'www/curl' instead of
++        # just 'curl'), drop the category prefix. pkgng doesn't support version
++        # pinning with the origin syntax (pkg install curl-1.2.3 is valid, but
++        # pkg install www/curl-1.2.3 is not).
++        if resource[:name] =~ /\//
++          installname = resource[:name].split('/')[1] + '-' + resource[:ensure]
++        else
++          installname = resource[:name] + '-' + resource[:ensure]
++        end
 +    end
 +
 +    if not source # install using default repo logic
@@ -107,6 +106,7 @@
 +    else # add package located at URL
 +      args = ['add', '-q', source.to_s]
 +    end
++
 +    pkg(args)
 +  end
 +
@@ -115,7 +115,6 @@
 +  end
 +
 +  def query
-+    debug @property_hash
 +    if @property_hash[:ensure] == nil
 +      return nil
 +    else
@@ -125,22 +124,11 @@
 +  end
 +
 +  def version
-+    debug @property_hash[:version].inspect
 +    @property_hash[:version]
 +  end
 +
-+  def version=
-+    pkg(['install', '-qy', "#{resource[:name]}-#{resource[:version]}"])
-+  end
-+
-+  def origin
-+    debug @property_hash[:origin].inspect
-+    @property_hash[:origin]
-+  end
-+
 +  # Upgrade to the latest version
 +  def update
-+    debug 'pkgng: update called'
 +    install
 +  end
 +
@@ -150,4 +138,8 @@
 +    @property_hash[:latest]
 +  end
 +
++  def origin
++    @property_hash[:origin]
++  end
++
 +end


More information about the svn-ports-head mailing list