diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-10 02:03:52 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-11 00:51:52 +0100 |
commit | 66a602dbe193353842441bc9ef49be8f9f565620 (patch) | |
tree | 1babcfeb8e04e65727f87f1875312935e231937d | |
parent | eb6ee3a3b44c0971ff09f656fe3c00066dda8910 (diff) |
dgit: When generating patch filenames from titles, first transliterate them (lossily) to ascii. Closes:#834807.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | dgit | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index 9a71c0d..5d33781 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/debian/control b/debian/control index cd14b2a..294b811 100644 --- a/debian/control +++ b/debian/control @@ -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 @@ -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-$&/; |