X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateImageSha1.php;h=e9123aa34410efd8e8746cdc21c10ff52fae79b9;hb=e36195eae382eb09273cb673b1d7f51655b73aa9;hp=4964bf116ca6f433668a74918af689d44ba573aa;hpb=b2aaddfe059fd994d0072dee1960af233454f87a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateImageSha1.php b/maintenance/populateImageSha1.php index 4964bf116c..e9123aa344 100644 --- a/maintenance/populateImageSha1.php +++ b/maintenance/populateImageSha1.php @@ -36,7 +36,12 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { $this->addOption( 'multiversiononly', "Calculate only for files with several versions" ); $this->addOption( 'method', "Use 'pipe' to pipe to mysql command line,\n" . "\t\tdefault uses Database class", false, true ); - $this->addOption( 'file', 'Fix for a specific file, without File: namespace prefixed', false, true ); + $this->addOption( + 'file', + 'Fix for a specific file, without File: namespace prefixed', + false, + true + ); } protected function getUpdateKey() { @@ -72,11 +77,15 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { ); if ( !$res ) { $this->error( "No such file: $file", true ); + return false; } $this->output( "Populating img_sha1 field for specified files\n" ); } else { - if ( $force ) { + if ( $this->hasOption( 'multiversiononly' ) ) { + $conds = array(); + $this->output( "Populating and recalculating img_sha1 field for versioned files\n" ); + } elseif ( $force ) { $conds = array(); $this->output( "Populating and recalculating img_sha1 field\n" ); } else {