chiark / gitweb /
dgit: When generating patch filenames from titles, first transliterate them (lossily...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 01:03:52 +0000 (02:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 23:51:52 +0000 (00:51 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
debian/control
dgit

index 9a71c0d..5d33781 100644 (file)
@@ -97,6 +97,8 @@ dgit (1.5~~) unstable; urgency=medium
     as is proper.  Closes:#835858.
   * Get sense of failed clone failed cleanup error reporting check
     correct.  Closes:#796773.
+  * When generating patch filenames from titles, first transliterate
+    them (lossily) to ascii.  Closes:#834807.
 
   Test suite:
   * When sbuild fails, do not crash due to sed not finding the log
index cd14b2a..294b811 100644 (file)
@@ -14,7 +14,7 @@ Depends: perl, libwww-perl, libdpkg-perl, git-core, devscripts, dpkg-dev,
          coreutils (>= 8.23-1~) | realpath,
          libdigest-sha-perl, dput, curl,
          libjson-perl, ca-certificates
-Recommends: ssh-client
+Recommends: ssh-client, libtext-iconv-perl
 Suggests: sbuild
 Architecture: all
 Description: git interoperability with the Debian archive
diff --git a/dgit b/dgit
index 469f6bf..7a4b391 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4146,6 +4146,16 @@ sub quiltify ($$$$) {
        if (!defined $patchname) {
            $patchname = $title;
            $patchname =~ s/[.:]$//;
+            use Text::Iconv;
+           eval {
+               my $converter = new Text::Iconv qw(UTF-8 ASCII//TRANSLIT);
+               my $translitname = $converter->convert($patchname);
+               die unless defined $translitname;
+               $patchname = $translitname;
+           };
+           print STDERR
+               "dgit: patch title transliteration error: $@"
+               if $@;
            $patchname =~ y/ A-Z/-a-z/;
            $patchname =~ y/-a-z0-9_.+=~//cd;
            $patchname =~ s/^\W/x-$&/;