From b0b55b7251c2e0bc1521010cfb2a42814e1247e4 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 23 May 2018 10:10:12 -0400 Subject: no bug - fix-remove-non-public-data.pl should use use FindBin --- scripts/remove-non-public-data.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') 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"; -- cgit v1.2.3-24-g4f1b