diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /scripts/syncflags.pl | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'scripts/syncflags.pl')
-rwxr-xr-x | scripts/syncflags.pl | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/scripts/syncflags.pl b/scripts/syncflags.pl index c99fd5160..2d3d65b58 100755 --- a/scripts/syncflags.pl +++ b/scripts/syncflags.pl @@ -32,7 +32,7 @@ use Bugzilla; use Bugzilla::Constants; sub usage() { - print <<USAGE; + print <<USAGE; Usage: syncflags.pl <srcproduct> <tgtproduct> E.g.: syncflags.pl FoodReplicator SeaMonkey @@ -41,7 +41,7 @@ so matching inclusions exist for the product "SeaMonkey". This script is normally used prior to moving components from srcproduct to tgtproduct. USAGE - exit(1); + exit(1); } ############################################################################# @@ -52,8 +52,8 @@ USAGE Bugzilla->usage_mode(USAGE_MODE_CMDLINE); if (scalar @ARGV < 2) { - usage(); - exit(); + usage(); + exit(); } my ($srcproduct, $tgtproduct) = @ARGV; @@ -62,40 +62,42 @@ my $dbh = Bugzilla->dbh; # Find product IDs my $srcprodid = $dbh->selectrow_array("SELECT id FROM products WHERE name = ?", - undef, $srcproduct); + undef, $srcproduct); if (!$srcprodid) { - print "Can't find product ID for '$srcproduct'.\n"; - exit(1); + print "Can't find product ID for '$srcproduct'.\n"; + exit(1); } my $tgtprodid = $dbh->selectrow_array("SELECT id FROM products WHERE name = ?", - undef, $tgtproduct); + undef, $tgtproduct); if (!$tgtprodid) { - print "Can't find product ID for '$tgtproduct'.\n"; - exit(1); + print "Can't find product ID for '$tgtproduct'.\n"; + exit(1); } # Normal flags such as bug flags and attachment flags -$dbh->do("INSERT INTO flaginclusions(component_id, type_id, product_id) +$dbh->do( + "INSERT INTO flaginclusions(component_id, type_id, product_id) SELECT fi1.component_id, fi1.type_id, ? FROM flaginclusions fi1 LEFT JOIN flaginclusions fi2 ON fi1.type_id = fi2.type_id AND fi2.product_id = ? WHERE fi1.product_id = ? - AND fi2.type_id IS NULL", - undef, - $tgtprodid, $tgtprodid, $srcprodid); + AND fi2.type_id IS NULL", undef, $tgtprodid, $tgtprodid, + $srcprodid +); # Tracking type flags -$dbh->do("INSERT INTO tracking_flags_visibility (tracking_flag_id, product_id, component_id) +$dbh->do( + "INSERT INTO tracking_flags_visibility (tracking_flag_id, product_id, component_id) SELECT tf1.tracking_flag_id, ?, tf1.component_id FROM tracking_flags_visibility tf1 LEFT JOIN tracking_flags_visibility tf2 ON tf1.tracking_flag_id = tf2.tracking_flag_id AND tf2.product_id = ? WHERE tf1.product_id = ? - AND tf2.tracking_flag_id IS NULL", - undef, - $tgtprodid, $tgtprodid, $srcprodid); + AND tf2.tracking_flag_id IS NULL", undef, $tgtprodid, + $tgtprodid, $srcprodid +); # It's complex to determine which items now need to be flushed from memcached. # As this is expected to be a rare event, we just flush the entire cache. |