summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-05-23 16:10:12 +0200
committerGitHub <noreply@github.com>2018-05-23 16:10:12 +0200
commitb0b55b7251c2e0bc1521010cfb2a42814e1247e4 (patch)
tree7e78ebd9ef1e47632afa4738f10e926cd532308a /scripts
parentff60b109bcd1a83f79b45296a9bc679ad9fd1f6b (diff)
downloadbugzilla-b0b55b7251c2e0bc1521010cfb2a42814e1247e4.tar.gz
bugzilla-b0b55b7251c2e0bc1521010cfb2a42814e1247e4.tar.xz
no bug - fix-remove-non-public-data.pl should use use FindBin
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/remove-non-public-data.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/remove-non-public-data.pl b/scripts/remove-non-public-data.pl
index fd379af79..61c761c27 100755
--- a/scripts/remove-non-public-data.pl
+++ b/scripts/remove-non-public-data.pl
@@ -9,8 +9,17 @@
use 5.10.1;
use strict;
use warnings;
-use lib qw(. lib local/lib/perl5);
+use File::Basename qw(dirname);
+use File::Spec::Functions qw(catfile catdir rel2abs);
+use Cwd qw(realpath);
+BEGIN {
+ require lib;
+ my $dir = rel2abs(catdir(dirname(__FILE__), '..'));
+ lib->import($dir, catdir($dir, 'lib'), catdir($dir, qw(local lib perl5)));
+}
+
+use autodie;
use Bugzilla;
use Bugzilla::Constants;
use List::MoreUtils qw(any);
@@ -130,7 +139,8 @@ my $dbh = Bugzilla->dbh;
# run sanitiseme.pl
print "running sanitizeme.pl\n";
-system "'$RealBin/sanitizeme.pl' --execute";
+my $sanitizeme = catfile(realpath(dirname(__FILE__)), 'sanitizeme.pl');
+system $sanitizeme, '--execute';
if ($dbh->selectrow_array("SELECT COUNT(*) FROM bug_group_map")) {
die "sanitization failed\n";