]> git.donarmstrong.com Git - debbugs.git/commitdiff
for installsql and loadsql, use the git INC if run out of git
authorDon Armstrong <don@donarmstrong.com>
Tue, 10 Apr 2018 23:21:59 +0000 (16:21 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 10 Apr 2018 23:21:59 +0000 (16:21 -0700)
bin/debbugs-installsql
bin/debbugs-loadsql

index 71ecc8ff18e5e4c096e840e63d220de3496799cd..079fde6e0acd211f722efa2771d822d299ca3fb9 100755 (executable)
@@ -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';
index 56c4f912562f38a759d17f60e73785ef3f5bbf23..6401fa8caa94f13e67e7cec8f865e7ba0dca4d12 100755 (executable)
@@ -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),