From: Don Armstrong Date: Tue, 10 Apr 2018 23:21:59 +0000 (-0700) Subject: for installsql and loadsql, use the git INC if run out of git X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=31ca6da8af32321837265482c92ab9cc15014d04 for installsql and loadsql, use the git INC if run out of git --- diff --git a/bin/debbugs-installsql b/bin/debbugs-installsql index 71ecc8f..079fde6 100755 --- a/bin/debbugs-installsql +++ b/bin/debbugs-installsql @@ -68,6 +68,13 @@ debbugs-installsql use vars qw($DEBUG); +# if we're running out of git, we want to use the git base directory as the +# first INC directory. If you're not running out of git, or someone has given a +# non-absolute INC, don't do that. +use FindBin; +use if (-d $FindBin::Bin.'/../.git/' && $INC[0] =~ m#^/#), + lib => $FindBin::Bin.'/../'; + use Debbugs::DB; use Debbugs::DB::Util qw(prepare_execute); use aliased 'DBIx::Class::DeploymentHandler' => 'DH'; diff --git a/bin/debbugs-loadsql b/bin/debbugs-loadsql index 56c4f91..6401fa8 100755 --- a/bin/debbugs-loadsql +++ b/bin/debbugs-loadsql @@ -131,6 +131,13 @@ Display this manual. use vars qw($DEBUG); +# if we're running out of git, we want to use the git base directory as the +# first INC directory. If you're not running out of git, or someone has given a +# non-absolute INC, don't do that. +use FindBin; +use if (-d $FindBin::Bin.'/../.git/' && $INC[0] =~ m#^/#), + lib => $FindBin::Bin.'/../'; + use Debbugs::Common (qw(checkpid lockpid get_hashname getparsedaddrs), qw(getbugcomponent make_list getsourcemaintainers), qw(walk_bugs),