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 9a71c0dbc5560deeb9b9e9684888df61a06b6920..5d337818390cbe52b4c135a2f3e59282a153773c 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 cd14b2aabec7e760d03e9019b73c8b76d5deca64..294b811dafc57f8d9afa2064ded895ad2cc9a403 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 469f6bfe5572ad718439eb8024719d1d0a325bcb..7a4b391a2c1054ee262d04627d34accb01083f4d 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-$&/;