From 0bff56f72922a3ecc611b278b959936e7934e98d Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 11 Jun 2013 18:10:54 +0100 Subject: [PATCH] better discovery of localenv status Squashed commit of the following: commit 6ca234759e27bb7e9e598eaf468d4ea6a0043867 Author: Oliver Gorwits Date: Tue Jun 11 13:38:19 2013 +0100 version bump commit c90ce039899b9a07e2ad833c753d0805e68d8bef Author: Oliver Gorwits Date: Tue Jun 11 13:29:11 2013 +0100 better discovery of localenv status --- Netdisco/Changes | 6 ++++++ Netdisco/META.yml | 2 +- Netdisco/bin/netdisco-daemon | 5 ++--- Netdisco/bin/netdisco-deploy | 3 +-- Netdisco/bin/netdisco-do | 7 +++---- Netdisco/bin/netdisco-web | 5 ++--- Netdisco/lib/App/Netdisco.pm | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 4af8e52f..6f4686a5 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -1,3 +1,9 @@ +2.008001 - 2013-06-11 + + [BUG FIXES] + + * more fixes for localenv discovery in scripts + 2.008000 - 2013-06-09 [BUG FIXES] diff --git a/Netdisco/META.yml b/Netdisco/META.yml index da6c4e11..0656075b 100644 --- a/Netdisco/META.yml +++ b/Netdisco/META.yml @@ -60,4 +60,4 @@ resources: homepage: http://netdisco.org/ license: http://opensource.org/licenses/bsd-license.php repository: git://git.code.sf.net/p/netdisco/netdisco-ng -version: 2.008000 +version: 2.008001 diff --git a/Netdisco/bin/netdisco-daemon b/Netdisco/bin/netdisco-daemon index 53b7c3e8..f34b537b 100755 --- a/Netdisco/bin/netdisco-daemon +++ b/Netdisco/bin/netdisco-daemon @@ -6,11 +6,10 @@ use warnings FATAL => 'all'; our $home; BEGIN { - # try really hard to find a localenv if one isn't already in place. + # try to find a localenv if one isn't already in place. $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); - eval "require App::Netdisco::Util::Noop"; - if ($@) { + if (!exists $ENV{PERL_LOCAL_LIB_ROOT}) { use File::Spec; my $localenv = File::Spec->catfile($FindBin::RealBin, 'localenv'); exec($localenv, $0, @ARGV) if -f $localenv; diff --git a/Netdisco/bin/netdisco-deploy b/Netdisco/bin/netdisco-deploy index 395d7cc2..5a237517 100755 --- a/Netdisco/bin/netdisco-deploy +++ b/Netdisco/bin/netdisco-deploy @@ -5,9 +5,8 @@ our $home; BEGIN { # try really hard to find a localenv if one isn't already in place. $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); - eval "require App::Netdisco::Util::Noop"; - if ($@) { + if (!exists $ENV{PERL_LOCAL_LIB_ROOT}) { use File::Spec; my $localenv = File::Spec->catfile($FindBin::RealBin, 'localenv'); exec($localenv, $0, @ARGV) if -f $localenv; diff --git a/Netdisco/bin/netdisco-do b/Netdisco/bin/netdisco-do index d8b1019d..c6d2ba4b 100755 --- a/Netdisco/bin/netdisco-do +++ b/Netdisco/bin/netdisco-do @@ -3,11 +3,10 @@ our $home; BEGIN { - # try really hard to find a localenv if one isn't already in place. + # try to find a localenv if one isn't already in place. $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); - eval "require App::Netdisco::Util::Noop"; - if ($@) { + if (!exists $ENV{PERL_LOCAL_LIB_ROOT}) { use File::Spec; my $localenv = File::Spec->catfile($FindBin::RealBin, 'localenv'); exec($localenv, $0, @ARGV) if -f $localenv; @@ -119,7 +118,7 @@ exit ($status eq 'done' ? 0 : 1); =head1 NAME -netdisco-do - Run any Netdisco poller job from the command-line. +netdisco-do - Run any Netdisco job from the command-line. =head1 USAGE diff --git a/Netdisco/bin/netdisco-web b/Netdisco/bin/netdisco-web index 9c86eb78..6818cbe1 100755 --- a/Netdisco/bin/netdisco-web +++ b/Netdisco/bin/netdisco-web @@ -6,11 +6,10 @@ use warnings FATAL => 'all'; our $home; BEGIN { - # try really hard to find a localenv if one isn't already in place. + # try to find a localenv if one isn't already in place. $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); - eval "require App::Netdisco::Util::Noop"; - if ($@) { + if (!exists $ENV{PERL_LOCAL_LIB_ROOT}) { use File::Spec; my $localenv = File::Spec->catfile($FindBin::RealBin, 'localenv'); exec($localenv, $0, @ARGV) if -f $localenv; diff --git a/Netdisco/lib/App/Netdisco.pm b/Netdisco/lib/App/Netdisco.pm index 48a69061..79fce419 100644 --- a/Netdisco/lib/App/Netdisco.pm +++ b/Netdisco/lib/App/Netdisco.pm @@ -7,7 +7,7 @@ use 5.010_000; use File::ShareDir 'dist_dir'; use Path::Class; -our $VERSION = '2.008000'; +our $VERSION = '2.008001'; BEGIN { if (not length ($ENV{DANCER_APPDIR} || '')