]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1441181 - Step 2 - Fix jobqueue header and @INC
authorDylan William Hardison <dylan@hardison.net>
Tue, 6 Mar 2018 00:31:31 +0000 (19:31 -0500)
committerGitHub <noreply@github.com>
Tue, 6 Mar 2018 00:31:31 +0000 (19:31 -0500)
jobqueue.pl

index ebc9118e89f3ec5d34bfecf9c3cf5f68c462704c..011d0ff87b9f5545163995a4c77e0ba59109e100 100755 (executable)
@@ -10,15 +10,15 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Cwd qw(abs_path);
 use File::Basename;
+use File::Spec;
 BEGIN {
-    # Untaint the abs_path.
-    my ($a) = abs_path($0) =~ /^(.*)$/;
-    chdir dirname($a);
+    require lib;
+    my $dir = File::Spec->rel2abs(dirname(__FILE__));
+    lib->import($dir, File::Spec->catdir($dir, 'lib'), File::Spec->catdir($dir, qw(local lib perl5)));
+    chdir $dir or die "chdir $dir failed: $!";
 }
 
-use lib qw(. lib local/lib/perl5);
 use Bugzilla;
 use Bugzilla::JobQueue::Runner;