pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/puppet Various style improvements as suggeste...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a4823c6d70fb
branches:  trunk
changeset: 539806:a4823c6d70fb
user:      tonnerre <tonnerre%pkgsrc.org@localhost>
date:      Thu Mar 13 20:05:09 2008 +0000

description:
Various style improvements as suggested by Joerg:
 - Don't use variables that contain EXAMPLESDIR
 - Eliminate PLIST_SUBST
 - Use SUBST instead of post-patch target
 - Use INSTALLATION_DIRS instead of INSTALL_DATA_DIR
 - Use proper English capitalization in patch files

diffstat:

 sysutils/puppet/Makefile         |  36 ++++++---------
 sysutils/puppet/PLIST            |  90 ++++++++++++++++++++--------------------
 sysutils/puppet/distinfo         |   6 +-
 sysutils/puppet/patches/patch-aa |   4 +-
 sysutils/puppet/patches/patch-ac |   4 +-
 5 files changed, 66 insertions(+), 74 deletions(-)

diffs (216 lines):

diff -r 876ee1649176 -r a4823c6d70fb sysutils/puppet/Makefile
--- a/sysutils/puppet/Makefile  Thu Mar 13 19:59:03 2008 +0000
+++ b/sysutils/puppet/Makefile  Thu Mar 13 20:05:09 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2008/03/13 14:17:05 tonnerre Exp $
+# $NetBSD: Makefile,v 1.2 2008/03/13 20:05:09 tonnerre Exp $
 #
 
 DISTNAME=              puppet-0.22.4
@@ -13,7 +13,7 @@
 NO_BUILD=              yes
 DOCS=                  CHANGELOG TODO README LICENSE COPYING
 PUPPET_DOCSDIR=                ${PREFIX}/share/doc/puppet
-PUPPET_EXAMPLESDIR=    ${PREFIX}/share/examples/puppet
+PUPPET_EGDIR=          ${PREFIX}/share/examples/puppet
 EXAMPLEROOT_DIRS=      bin etc etc/init.d etc/puppet
 EXAMPLEROOT_FILES=     bin/sleeper etc/init.d/sleeper                  \
        etc/puppet/puppetd.conf etc/puppet/fileserver.conf              \
@@ -22,45 +22,37 @@
        etc/debian-passwd etc/debian-syslog.conf
 RCD_SCRIPTS=           puppetd puppetmasterd
 
-PLIST_SUBST+=          DOCSDIR="${PUPPET_DOCSDIR:S,${PREFIX}/,,}"
-PLIST_SUBST+=          EXAMPLESDIR="${PUPPET_EXAMPLESDIR:S,${PREFIX}/,,}"
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    post-patch
+SUBST_FILES.prefix=    lib/puppet/configuration.rb
+SUBST_SED.prefix=      -e "s@/etc/puppet@${PREFIX}/etc/puppet@"
+
+INSTALLATION_DIRS=     ${PUPPET_DOCSDIR} ${PUPPET_EGDIR} ${PUPPET_EGDIR}/code
+INSTALLATION_DIRS+=    ${PUPPET_EGDIR}/root/bin ${PUPPET_EGDIR}/root/etc
+INSTALLATION_DIRS+=    ${PUPPET_EGDIR}/root/etc/init.d
+INSTALLATION_DIRS+=    ${PUPPET_EGDIR}/root/etc/puppet
 
 .include "../../lang/ruby/buildlink3.mk"
 
 DEPENDS+=              ${RUBY_PKGPREFIX}-facter-[0-9]*:../../sysutils/ruby-facter
 
-post-patch:
-       ${RM} ${WRKSRC}/bin/*.orig || ${TRUE}
-       ${SED} -e "s@/etc/puppet@${PREFIX}/etc/puppet@"         \
-               ${WRKSRC}/lib/puppet/configuration.rb >         \
-               ${WRKSRC}/lib/puppet/configuration.rb.new
-       ${MV} ${WRKSRC}/lib/puppet/configuration.rb.new         \
-               ${WRKSRC}/lib/puppet/configuration.rb
-
 do-install:
        cd ${WRKSRC} && ${SETENV} DSTDIR=${DESTDIR}/${PREFIX}   \
                ${RUBY} ${WRKSRC}/install.rb --full
-       ${INSTALL_DATA_DIR} ${PUPPET_DOCSDIR}
 .for file in ${DOCS}
        ${INSTALL_DATA} ${WRKSRC}/${file} ${PUPPET_DOCSDIR}
 .endfor
-       ${INSTALL_DATA_DIR} ${PUPPET_EXAMPLESDIR}
-       ${INSTALL_DATA_DIR} ${PUPPET_EXAMPLESDIR}/code
-       ${INSTALL_DATA} ${WRKSRC}/examples/code/* ${PUPPET_EXAMPLESDIR}/code
-.for dir in ${EXAMPLEROOT_DIRS}
-       ${INSTALL_DATA_DIR} ${PUPPET_EXAMPLESDIR}/root/${dir}
-.endfor
+       ${INSTALL_DATA} ${WRKSRC}/examples/code/* ${PUPPET_EGDIR}/code
 .for file in ${EXAMPLEROOT_FILES}
        ${INSTALL_DATA} ${WRKSRC}/examples/root/${file}         \
-               ${PUPPET_EXAMPLESDIR}/root/${file}
+               ${PUPPET_EGDIR}/root/${file}
 .endfor
-       ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PUPPET_EXAMPLESDIR}
 
 post-install:
        ${RUBY} ${PREFIX}/bin/puppetmasterd                             \
                --confdir=${PREFIX}/etc/puppet --rundir=/var/run        \
                --genconfig |                                           \
                ${SED} -e 's/genconfig = true/# genconfig = false/'     \
-               > ${PUPPET_EXAMPLESDIR}/puppetmasterd.conf.sample
+               > ${PUPPET_EGDIR}/puppetmasterd.conf.sample
 
 .include "../../mk/bsd.pkg.mk"
diff -r 876ee1649176 -r a4823c6d70fb sysutils/puppet/PLIST
--- a/sysutils/puppet/PLIST     Thu Mar 13 19:59:03 2008 +0000
+++ b/sysutils/puppet/PLIST     Thu Mar 13 20:05:09 2008 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2008/03/13 14:17:05 tonnerre Exp $
+@comment $NetBSD: PLIST,v 1.2 2008/03/13 20:05:09 tonnerre Exp $
 bin/puppet
 bin/puppetca
 bin/puppetd
@@ -294,47 +294,47 @@
 @dirrm ${RUBY_SITELIBDIR}/puppet/external/event-loop
 @dirrm ${RUBY_SITELIBDIR}/puppet/external
 @dirrm ${RUBY_SITELIBDIR}/puppet
-${DOCSDIR}/CHANGELOG
-${DOCSDIR}/TODO
-${DOCSDIR}/README
-${DOCSDIR}/LICENSE
-${DOCSDIR}/COPYING
-@dirrm ${DOCSDIR}
-${EXAMPLESDIR}/root/bin/sleeper
-${EXAMPLESDIR}/root/etc/init.d/sleeper
-${EXAMPLESDIR}/root/etc/puppet/puppetd.conf
-${EXAMPLESDIR}/root/etc/puppet/fileserver.conf
-${EXAMPLESDIR}/root/etc/puppet/puppetmasterd.conf
-${EXAMPLESDIR}/root/etc/puppet/namespaceauth.conf
-${EXAMPLESDIR}/root/etc/puppet/tagmail.conf
-${EXAMPLESDIR}/root/etc/otherfile
-${EXAMPLESDIR}/root/etc/configfile
-${EXAMPLESDIR}/root/etc/debian-passwd
-${EXAMPLESDIR}/root/etc/debian-syslog.conf
-${EXAMPLESDIR}/code/allatonce
-${EXAMPLESDIR}/code/head
-${EXAMPLESDIR}/code/selectors
-${EXAMPLESDIR}/code/execs
-${EXAMPLESDIR}/code/nodes
-${EXAMPLESDIR}/code/mac_automount.pp
-${EXAMPLESDIR}/code/filerecursion
-${EXAMPLESDIR}/code/components
-${EXAMPLESDIR}/code/file.bl
-${EXAMPLESDIR}/code/groups
-${EXAMPLESDIR}/code/functions
-${EXAMPLESDIR}/code/fileparsing
-${EXAMPLESDIR}/code/svncommit
-${EXAMPLESDIR}/code/filedefaults
-${EXAMPLESDIR}/code/simpletests
-${EXAMPLESDIR}/code/assignments
-${EXAMPLESDIR}/code/relationships
-${EXAMPLESDIR}/code/importing
-${EXAMPLESDIR}/code/one
-${EXAMPLESDIR}/puppetmasterd.conf.sample
-@dirrm ${EXAMPLESDIR}/root/bin
-@dirrm ${EXAMPLESDIR}/root/etc/init.d
-@dirrm ${EXAMPLESDIR}/root/etc/puppet
-@dirrm ${EXAMPLESDIR}/root/etc
-@dirrm ${EXAMPLESDIR}/root
-@dirrm ${EXAMPLESDIR}/code
-@dirrm ${EXAMPLESDIR}
+share/doc/puppet/CHANGELOG
+share/doc/puppet/TODO
+share/doc/puppet/README
+share/doc/puppet/LICENSE
+share/doc/puppet/COPYING
+@dirrm share/doc/puppet
+share/examples/puppet/root/bin/sleeper
+share/examples/puppet/root/etc/init.d/sleeper
+share/examples/puppet/root/etc/puppet/puppetd.conf
+share/examples/puppet/root/etc/puppet/fileserver.conf
+share/examples/puppet/root/etc/puppet/puppetmasterd.conf
+share/examples/puppet/root/etc/puppet/namespaceauth.conf
+share/examples/puppet/root/etc/puppet/tagmail.conf
+share/examples/puppet/root/etc/otherfile
+share/examples/puppet/root/etc/configfile
+share/examples/puppet/root/etc/debian-passwd
+share/examples/puppet/root/etc/debian-syslog.conf
+share/examples/puppet/code/allatonce
+share/examples/puppet/code/head
+share/examples/puppet/code/selectors
+share/examples/puppet/code/execs
+share/examples/puppet/code/nodes
+share/examples/puppet/code/mac_automount.pp
+share/examples/puppet/code/filerecursion
+share/examples/puppet/code/components
+share/examples/puppet/code/file.bl
+share/examples/puppet/code/groups
+share/examples/puppet/code/functions
+share/examples/puppet/code/fileparsing
+share/examples/puppet/code/svncommit
+share/examples/puppet/code/filedefaults
+share/examples/puppet/code/simpletests
+share/examples/puppet/code/assignments
+share/examples/puppet/code/relationships
+share/examples/puppet/code/importing
+share/examples/puppet/code/one
+share/examples/puppet/puppetmasterd.conf.sample
+@dirrm share/examples/puppet/root/bin
+@dirrm share/examples/puppet/root/etc/init.d
+@dirrm share/examples/puppet/root/etc/puppet
+@dirrm share/examples/puppet/root/etc
+@dirrm share/examples/puppet/root
+@dirrm share/examples/puppet/code
+@dirrm share/examples/puppet
diff -r 876ee1649176 -r a4823c6d70fb sysutils/puppet/distinfo
--- a/sysutils/puppet/distinfo  Thu Mar 13 19:59:03 2008 +0000
+++ b/sysutils/puppet/distinfo  Thu Mar 13 20:05:09 2008 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.1.1.1 2008/03/13 14:17:05 tonnerre Exp $
+$NetBSD: distinfo,v 1.2 2008/03/13 20:05:09 tonnerre Exp $
 
 SHA1 (puppet-0.22.4.tgz) = afc6e64dcbfab251dd433c6e0de5015cbe0a37ec
 RMD160 (puppet-0.22.4.tgz) = c836292dc112e52d32bfdcd68d74799135e9c2e9
 Size (puppet-0.22.4.tgz) = 642077 bytes
-SHA1 (patch-aa) = 73c2ffa5890f6d0d473ec0585b34d42965361b39
+SHA1 (patch-aa) = 3573c5ad7852c3e03aab76a40188203069b58dbf
 SHA1 (patch-ab) = f14b5f3d595fa5f9d1e115f85d9dd030a711d7bc
-SHA1 (patch-ac) = 1b36104cf7cf92c3b44be49d76de8ebb83b6ee17
+SHA1 (patch-ac) = 60ca77dd0dffcab2eba9c9a99c4094dca22c0fd1
diff -r 876ee1649176 -r a4823c6d70fb sysutils/puppet/patches/patch-aa
--- a/sysutils/puppet/patches/patch-aa  Thu Mar 13 19:59:03 2008 +0000
+++ b/sysutils/puppet/patches/patch-aa  Thu Mar 13 20:05:09 2008 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.1.1.1 2008/03/13 14:17:05 tonnerre Exp $
+$NetBSD: patch-aa,v 1.2 2008/03/13 20:05:09 tonnerre Exp $
 
-always define PATCH. without it, puppetd hangs when upgrading INTERACTIVE port.
+Always define PATCH. Without it, puppetd hangs when upgrading INTERACTIVE port.
 http://reductivelabs.com/trac/puppet/ticket/624
 
 --- lib/puppet/provider/package/ports.rb.orig  Tue May  8 14:55:34 2007
diff -r 876ee1649176 -r a4823c6d70fb sysutils/puppet/patches/patch-ac
--- a/sysutils/puppet/patches/patch-ac  Thu Mar 13 19:59:03 2008 +0000
+++ b/sysutils/puppet/patches/patch-ac  Thu Mar 13 20:05:09 2008 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-ac,v 1.1.1.1 2008/03/13 14:17:05 tonnerre Exp $
+$NetBSD: patch-ac,v 1.2 2008/03/13 20:05:09 tonnerre Exp $
 
-support package that contains '-' in its name, like syslog-ng
+Support package that contains '-' in its name, like syslog-ng
 http://reductivelabs.com/trac/puppet/ticket/628
 
 --- lib/puppet/provider/package/ports.rb.orig       Wed May  9 17:12:39 2007



Home | Main Index | Thread Index | Old Index