Hello community, here is the log from the commit of package convmv for openSUSE:Factory checked in at 2017-11-27 22:18:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/convmv (Old) and /work/SRC/openSUSE:Factory/.convmv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "convmv" Mon Nov 27 22:18:05 2017 rev:22 rq:545782 version:2.04 Changes: -------- --- /work/SRC/openSUSE:Factory/convmv/convmv.changes 2017-06-23 09:18:57.345425004 +0200 +++ /work/SRC/openSUSE:Factory/.convmv.new/convmv.changes 2017-11-27 22:18:07.835245644 +0100 @@ -1,0 +2,17 @@ +Sun Nov 26 17:20:57 UTC 2017 - [email protected] + +- Update to 2.04: + * check for valid utf-8 also in upperlower_checkenc() + * fix parsable output, missed the path files to run utime() on + * add --run-parsable option to blindly run what a file generated + with --parsable tells us to do +- includes 2.03: + * fix man page build due to non-ASCII char +- includes 2.02: + * add option --caseful-sz to optionally treat upper-/lowercasing + of sz. This also fixes unwanted unidirectional lowercasing + of U+1E9E +- cleanup with spec-cleaner +- replace wildcard with name macro + +------------------------------------------------------------------- Old: ---- convmv-2.01.tar.gz New: ---- convmv-2.04.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ convmv.spec ++++++ --- /var/tmp/diff_new_pack.HiU1Le/_old 2017-11-27 22:18:08.519220819 +0100 +++ /var/tmp/diff_new_pack.HiU1Le/_new 2017-11-27 22:18:08.519220819 +0100 @@ -17,14 +17,13 @@ Name: convmv -Version: 2.01 +Version: 2.04 Release: 0 Summary: Converts File Names from One Encoding to Another License: GPL-2.0+ Group: Productivity/File utilities Url: http://j3e.de/linux/convmv/ Source: http://j3e.de/linux/convmv/%{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description @@ -56,9 +55,8 @@ make %{?_smp_mflags} test %files -%defattr(-, root, root) %doc GPL2 Changes CREDITS TODO VERSION -%{_bindir}/* -%{_mandir}/man1/* +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.1%{ext_man} %changelog ++++++ convmv-2.01.tar.gz -> convmv-2.04.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convmv-2.01/Changes new/convmv-2.04/Changes --- old/convmv-2.01/Changes 2017-05-04 03:33:18.000000000 +0200 +++ new/convmv-2.04/Changes 2017-11-20 22:15:32.000000000 +0100 @@ -1,3 +1,14 @@ +2.04 +- check for valid utf-8 also in upperlower_checkenc() +- fix parsable output, missed the path files to run utime() on +- add --run-parsable option to blindly run what a file generated with --parsable tells us to do + +2.03 +- fix man page build due to non-ASCII char (thanks, Anton!) + +2.02 +- add option --caseful-sz to optionally treat upper-/lowercasing of sz. This also fixes unwanted unidirectional lowercasing of U+1E9E + 2.01 - map : instead of / in SFU mapping tables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convmv-2.01/SHA256sums new/convmv-2.04/SHA256sums --- old/convmv-2.01/SHA256sums 2017-05-05 04:55:29.000000000 +0200 +++ new/convmv-2.04/SHA256sums 2017-11-20 22:37:52.000000000 +0100 @@ -1,18 +1,18 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 -6cd57b452e9e2be5a9ca992831f96e4a8317c1bc37171f237094d8dc0a6e0d27 ./TODO -f759d3169c063594b04a9b1714a52e09f881dd7bc49ff65cf1c468d4e6a8dbbc ./convmv +33cd6497c59daf1697e21663343f703b1eaf6a13e435c4e654c56790a9a7bd2e ./TODO +2275cc495a2f39185400844c0ecfcd223dd36167bac27d0ea83a60cba718e187 ./convmv 31a04f0b0584237d6f81fab7e77b0d43e307230102f09db947e20b2a3103a108 ./testsuite.tar 42b2cfe802e3bac5bdc2462a0d61de002991125053e41c18d5cd7799b4cebf2b ./CREDITS -4d7d6c70f3f7bd5127794e01ccfc42b1f3dcd882d229ad6c9d274104eb6db6b5 ./VERSION -9c1d31097f289010a598ed3656ee9a00b56221c8d87893db005f2635250b640b ./Changes +cfbcc24bdb8d268486e65a1dac11b6fea3e07805769d3d15918238a43059ce44 ./VERSION +37b03ab277d317eea59c2430f36045ac7a3c231c91e39580e4248c54912929fc ./Changes 10f96f4cf2f61333c289f603cedd4c0f5e523d2da05486d9bea670f3877d8592 ./Makefile a2a9cfa48ba7f7453edf1c43bb8bb1aef5fcd1b87dde11420edceee2e2528db0 ./GPL2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 -iEYEAREIAAYFAlkL6Z4ACgkQdoo0s+hIejmBZwCgs6PP1YWsa9ifUTosGfwEaNeS -WJIAni4rsOvom8Nxks8Io0dHDht5Se8m -=n1Km +iEYEAREIAAYFAloTSy4ACgkQdoo0s+hIejnMZwCg9dimRgvjBTQggCwkR9Xql79Y +5tQAn0hvSXL+3TszEP3chObXayLMCrvl +=ZMbA -----END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convmv-2.01/TODO new/convmv-2.04/TODO --- old/convmv-2.01/TODO 2008-11-10 15:09:55.000000000 +0100 +++ new/convmv-2.04/TODO 2017-11-20 22:37:40.000000000 +0100 @@ -5,7 +5,6 @@ - --exclude option - verbose mode printing actual scanned files - --null option for "find -print0 | xargs convmv --null" usage -- map illegal ntfs characters away: " / \ * ? < > | : - map "most" strange chracters to ASCII equivalences - keep/restore old ctime - difficult to do! No Perl module, not even a ctime option in standard "touch" command :-| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convmv-2.01/VERSION new/convmv-2.04/VERSION --- old/convmv-2.01/VERSION 2017-05-05 04:55:26.000000000 +0200 +++ new/convmv-2.04/VERSION 2017-11-20 22:37:50.000000000 +0100 @@ -1 +1 @@ -2.01 +2.04 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convmv-2.01/convmv new/convmv-2.04/convmv --- old/convmv-2.01/convmv 2017-05-04 03:31:19.000000000 +0200 +++ new/convmv-2.04/convmv 2017-11-20 22:30:29.000000000 +0100 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# convmv 2.01 - converts filenames from one encoding to another +# convmv 2.04 - converts filenames from one encoding to another # Copyright © 2003-2017 Bjoern JACKE <[email protected]> # # This program comes with ABSOLUTELY NO WARRANTY; it may be copied or modified @@ -107,6 +107,12 @@ column is separated by \0\n (nullbyte newline). Each row (one action) is separated by \0\0\n (nullbyte nullbyte newline). +=item B<--run-parsable> + +This option can be used to blindly execute the output of a previous +B<--parsable> run. This way it's possible to rename a huge amount of file in +a minimum of time. + =item B<--no-preserve-mtimes> modifying filenames usually causes the parent directory's mtime being updated. @@ -157,6 +163,13 @@ letters as u, m, and n. J is a variant form of i which emerged at this time and subsequently became a separate letter. +=item B<--caseful-sz> + +let convmv convert the sz ligature (U+00DF) to the uppercase version +(U+1E9E) and vice versa. As of 2017 most fs case mapping tables don't treat +those two code points as case equivalents. Thus the default of convmv is to +treat it caseless for now also (unless this option is used). + =item B<--help> print a short summary of available options @@ -321,7 +334,9 @@ 'upper'=>\$opt_upper, 'lower'=>\$opt_lower, 'dotlessi'=>\$opt_dotlessi, + 'caseful-sz'=>\$opt_caseful_sz, 'parsable'=>\$opt_parsable, + 'run-parsable=s'=>\$opt_runparsable, 'fixdouble'=>\$opt_fixdouble, 'preserve-mtimes!'=>\$opt_mtimes, 'dump-options'=>\$opt_dumpoptions, @@ -346,13 +361,14 @@ &listvalidencodings and exit 0 if ($opt_list); &dumpoptions and exit 0 if ($opt_dumpoptions); +&runparsable and exit 0 if ($opt_runparsable); &printusage and exit 1 if (!@ARGV or $opt_help); &check_for_broken_perl_release(); -if ($opt_parsable) { +if ($opt_parsable or $opt_runparsable) { if ($opt_notest or $opt_exec or $opt_i) { - die "--parsable mode cannot be used with --notest, --exec or -i\n"; + die "--parsable/--run-parsable mode cannot be used with --notest, --exec or -i\n"; } } @@ -558,11 +574,11 @@ } } elsif (-d $arg) { # $type="directory"; + &restore_times_if_any($dir,$arg) if ($opt_mtimes); $newname=&$get_newname($arg); if ($newname and $newname ne $arg) { &renameit($arg,$newname); } - &restore_times_if_any($dir,$arg,$newname) if ($opt_mtimes); } elsif (-f $arg) { # $type="file"; $newname=&$get_newname($arg); @@ -570,7 +586,6 @@ &renameit($arg,$newname); } } - # &restore_times_if_any($dir,$arg,$newname) if ($opt_mtimes); # only in -d case needed !? -> moved up! chdir $pwd; } @@ -701,18 +716,17 @@ sub restore_times_if_any() { my $dir=shift; my $old=shift; - my $new=shift; if ($dir eq ".") { $dir = ""; } else { $dir .= "/"; } $dir .= $old; - # print $outerr "Trying to delete \"$dir\" now \"$new\" from %dir_time_hash\n"; # debug print if (exists $dir_time_hash{$dir}) { if ($opt_notest) { - utime ${$dir_time_hash{$dir}}[0], ${$dir_time_hash{$dir}}[1], $new or print $outerr "Could not run utime() on $new: $!\n"; - print UNDOLOG "utime ".${$dir_time_hash{$dir}}[0].", ".${$dir_time_hash{$dir}}[1].", ".$new." or print \"Could not run utime() on $new: \$!\n\""; + # in this functions cwd is $dir - so we need to call utime() on $old (and not $path) + utime ${$dir_time_hash{$dir}}[0], ${$dir_time_hash{$dir}}[1], $old or print $outerr "Could not run utime() on $old: $!\n"; + print UNDOLOG "utime ".${$dir_time_hash{$dir}}[0].", ".${$dir_time_hash{$dir}}[1].", ".$dir." or print \"Could not run utime() on $dir: \$!\n\""; } elsif ($opt_parsable) { print "utime".$del.$dir.$del.${$dir_time_hash{$dir}}[0].$del.${$dir_time_hash{$dir}}[1].$del.${$dir_time_hash{$dir}}[2].$fin_del; } @@ -793,7 +807,7 @@ sub printusage { &check_for_perl_bugs; print <<END; -convmv 2.01 - converts filenames from one encoding to another +convmv 2.04 - converts filenames from one encoding to another Copyright (C) 2003-2017 Bjoern JACKE <bjoern\@j3e.de> This program comes with ABSOLUTELY NO WARRANTY; it may be copied or modified @@ -823,6 +837,7 @@ --help print this help END #--dotlessi care about the dotless i issue of certain locales (use with care) +#--caseful-sz treat make convmv aware of caputal sz ligature (ß vs. ẞ) } sub looks_like_utf8() { @@ -974,6 +989,16 @@ sub upperlower_checkenc() { my $oldname = shift; my $newname = upperlower_get_newname($oldname); + if ($from_is_utf8) { + if (! &$this_is_valid_utf8($oldname)) { + if ($opt_parsable) { + print "errormsg".$del."filenotutf8".$del.$dir."/".$oldname.$fin_del; + } else { + print $outerr "this file was not validly encoded in UTF-8: \"". &$from_print($dir."/".$oldname) ."\"\n"; + } + return undef; + } + } if (not defined($newname)) { return undef; } else { @@ -987,7 +1012,11 @@ my $oldname = shift; my $name=$oldname; if (! from_to($name, $opt_f, "utf8", Encode::FB_QUIET)) { # should also leave NFD as it is ... - print $outerr "\"",&$from_print($oldname),"\" not encoded in $opt_f ? Supply the correct encoding via -f option!\n"; + if ($opt_parsable) { + print "errormsg".$del."fileencodedinvalid".$del.$dir."/".$oldfile.$fin_del; + } else { + print $outerr "\"",&$from_print($oldname),"\" not encoded in $opt_f ? Supply the correct encoding via -f option!\n"; + } return undef; } _utf8_on($name); # Unicode in Perl can be a real pain ... @@ -1004,13 +1033,23 @@ # but until now I don't see use for this in filenames ... $name =~ s/ß/\000DWSLQH/g; $name = uc($name); - $name =~ s/\000DWSLQH/ß/g; + if ($opt_caseful_sz) { + $name =~ s/\000DWSLQH/ẞ/g; + } else { + $name =~ s/\000DWSLQH/ß/g; + } } else { if ($opt_dotlessi) { $name =~ s/I/ı/g; $name =~ s/İ/i/g; } + $name =~ s/ẞ/\000dwslqh/g; $name = lc($name); + if ($opt_caseful_sz) { + $name =~ s/\000dwslqh/ß/g; + } else { + $name =~ s/\000dwslqh/ẞ/g; + } } use bytes; _utf8_off($name); @@ -1018,7 +1057,11 @@ # the problems that arise with this letter are endless ... # $name =~ s/i\314\207/i/g if ($from_is_utf8); if (! from_to($name, "utf8", $opt_f, Encode::FB_QUIET)) { - print $outerr $opt_upper?"Upper":"Lower","case of \"",&$from_print($oldname),"\" not possible in $opt_f ! Maybe supply different encoding via -f option.\n"; + if ($opt_parsable) { + print "errormsg".$del."fileencodingunknown".$del.$dir."/".$oldfile.$fin_del; + } else { + print $outerr $opt_upper?"Upper":"Lower","case of \"",&$from_print($oldname),"\" not possible in $opt_f ! Maybe supply different encoding via -f option.\n"; + } return undef; } return $name; @@ -1041,6 +1084,29 @@ return $oldname; } + +sub runparsable() { + $/=$fin_del; + open(FH, "<", $opt_runparsable); + while(<FH>) { + my @line = split($del, $_); + if ($line[0] eq "rename") { + print "renaming ".$line[1]."\n"; + rename($line[1], $line[2]) or print "-> FAILED\n"; + } elsif ($line[0] eq "utime") { + print "restoring times on ".$line[1]."\n"; + utime $line[2], $line[3], $line[1] or print "-> FAILED\n"; + } elsif ($line[0] eq "symlink") { + print "symlinking ".$line[1]."\n"; + symlink($line[1], $line[2]) or print "-> FAILED\n"; + } elsif ($line[0] eq "unlink") { + print "deleting ".$line[1]."\n"; + unlink $line[1] or print "-> FAILED\n"; + } + } + close FH; +} + sub check_for_broken_perl_release() { # Check that most basic Perl Encode features we use work reliably # and decide which code path we use for &this_is_valid_utf8():
