Last modified: 2013-10-18 17:46:06 UTC
reedy@terbium:/media/external/keepers$ sudo -u apache mwscript importImages.php --wiki=commonswiki --comment-ext=txt --user=LSHuploadBot /media/external/keepers/reupload/ --overwrite Import Images Vas_med_frostblommor_-_Hallwylska_museet_-_87149.tif exists, overwriting...done. Älghudskyller,_Sverige_1600-talets_början_-_Livrustkammaren_-_43603.tif exists, skipping Found: 2 Skipped: 1 Overwritten: 1 reedy@terbium:/media/external/keepers$ rm reupload/Vas_med_frostblommor_-_Hallwylska_museet_-_87149.t* reedy@terbium:/media/external/keepers$ sudo -u apache mwscript importImages.php --wiki=commonswiki --comment-ext=txt --user=LSHuploadBot /media/external/keepers/reupload/ --overwrite Import Images Älghudskyller,_Sverige_1600-talets_början_-_Livrustkammaren_-_43603.tif exists, overwriting...done. Found: 1 Overwritten: 1
Looks like it's because $options is blindly overwritten # Import the file if ( isset( $options['dry'] ) ) { echo " publishing {$file} by '" . $wgUser->getName() . "', comment '$commentText'... "; } else { $props = FSFile::getPropsFromPath( $file ); $flags = 0; $options = array(); $handler = MediaHandler::getHandler( $props['mime'] ); if ( $handler ) { $options['headers'] = $handler->getStreamHeaders( $props['metadata'] ); } else { $options['headers'] = array(); } $archive = $image->publish( $file, $flags, $options ); if ( !$archive->isGood() ) { echo "failed. (" . $archive->getWikiText() . ")\n"; $failed++; continue; } } Some parameters are variablised, some aren't. Any that aren't won't be carried forward...
Change 90573 had a related patch set uploaded by Reedy: Don't blindly overwrite $options in importImages.php https://gerrit.wikimedia.org/r/90573
Change 90573 merged by jenkins-bot: Don't blindly overwrite $options in importImages.php https://gerrit.wikimedia.org/r/90573