summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-05-23 23:16:51 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-23 23:16:51 -0700
commit7f826bfc1352ef84b2e990874c6285c5aca66bac (patch)
treebf2d11a0bf96d4372ecb1daaa51f6f7a354800c0 /ext
parent25b967559dfa39eb094008c7a3952c4ee885530b (diff)
parente0b63a27382b577ce8af497238f702193ad15795 (diff)
downloadpuppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.tar.gz
puppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.tar.xz
puppet-7f826bfc1352ef84b2e990874c6285c5aca66bac.zip
Merge branch '2.7.x'
* 2.7.x: (#7502) Fixed parser spec for ruby 1.8.5 (#7507) Add more 1.9 filters (#6395) Add extpuppet help, eval, and interfaces maint: move trap call to Signal so we can stub it for specs Updated CHANGELOG for 2.7.0rc3 (#7259) Remove ActiveRecord requirement from indirector face spec (#7259) Do not try to load all Terminus classes when configuring the Indirector Adding a sleep state post starting master
Diffstat (limited to 'ext')
-rwxr-xr-xext/envpuppet59
1 files changed, 56 insertions, 3 deletions
diff --git a/ext/envpuppet b/ext/envpuppet
index d921a19b8..c794e6764 100755
--- a/ext/envpuppet
+++ b/ext/envpuppet
@@ -34,6 +34,38 @@
set -e
set -u
+if [[ "${1:-}" == "--help" ]]; then
+ cat <<EO_HELP
+This command reconfigures the environment once for development.
+It is designed to wrap around any other command, specifically puppet
+
+Jeff McCune <jeff@puppetlabs.com>
+2011-02-09
+
+Puppet should not be installed in site_ruby because all of \$LOAD_PATH
+is searched by puppet when loading libraries and the installed version
+will taint the development version
+
+The following enviornment variables configure the behavior of envpuppet
+
+ ENVPUPPET_BASEDIR=${HOME}/src
+ the base directory where puppet, facter, etc... live.
+
+ ENVPUPPET_BLEEDING=true Enables bleeding edge prototypes like
+ puppet-interfaces
+
+The PATH and RUBYLIB are the primary environment variables modified by
+the envpuppet script.
+
+If no arguments are given, the environment variables are printed to STDOUT
+allowing the output to be sourced. For example:
+
+ eval \$(envpuppet)
+
+EO_HELP
+ exit 0
+fi
+
if test -d puppet -o -d facter; then
echo " WARNING!"
echo " Strange things happen if puppet or facter are in the"
@@ -50,15 +82,23 @@ fi
# Set this to where you check out puppet and facter
: ${ENVPUPPET_BASEDIR:="${HOME}/src"}
+# Are we bleeding edge?
+: ${ENVPUPPET_BLEEDING:='false'}
-# git://github.com/reductivelabs/puppet.git
+# git://github.com/puppetlabs/puppet.git
mypath="${ENVPUPPET_BASEDIR}/puppet/sbin:${ENVPUPPET_BASEDIR}/puppet/bin"
myrubylib="${ENVPUPPET_BASEDIR}/puppet/lib"
-# git://github.com/reductivelabs/facter.git
+# git://github.com/puppetlabs/facter.git
mypath="${mypath}:${ENVPUPPET_BASEDIR}/facter/bin"
myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/facter/lib"
+if [[ "${ENVPUPPET_BLEEDING:-}" == "true" ]]; then
+ # git://github.com/puppetlabs/facter.git
+ mypath="${mypath}:${ENVPUPPET_BASEDIR}/puppet-interfaces/bin"
+ myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-interfaces/lib"
+fi
+
# http://github.com/jamtur01/puppet-scaffold.git
mypath="${mypath}:${ENVPUPPET_BASEDIR}/puppet-scaffold/bin"
myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-scaffold/lib"
@@ -73,8 +113,21 @@ myrubylib="${myrubylib}:${ENVPUPPET_BASEDIR}/puppet-module-tool/lib"
mypath="${mypath}:${PATH:-}"
myrubylib="${myrubylib}:${RUBYLIB:-}"
+export ENVPUPPET_OLD_PATH="${PATH:-}"
+export ENVPUPPET_OLD_RUBYLIB="${RUBYLIB:-}"
+
# Trim any trailing colons from the path list.
export PATH="${mypath%%:}"
export RUBYLIB="${myrubylib%%:}"
-exec "$@"
+if [[ $# -eq 0 ]]; then
+ echo "export ENVPUPPET_OLD_PATH='${ENVPUPPET_OLD_PATH}'"
+ echo "export ENVPUPPET_OLD_RUBYLIB='${ENVPUPPET_OLD_RUBYLIB}'"
+ echo "export ENVPUPPET_BASEDIR='${ENVPUPPET_BASEDIR}'"
+ echo "export ENVPUPPET_BLEEDING='${ENVPUPPET_BLEEDING}'"
+ echo "export PATH='${PATH}'"
+ echo "export RUBYLIB='${RUBYLIB}'"
+else
+ exec "$@"
+fi
+