From 66a602dbe193353842441bc9ef49be8f9f565620 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 10 Oct 2016 02:03:52 +0100 Subject: [PATCH] dgit: When generating patch filenames from titles, first transliterate them (lossily) to ascii. Closes:#834807. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ debian/control | 2 +- dgit | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9a71c0db..5d337818 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 cd14b2aa..294b811d 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 diff --git a/dgit b/dgit index 469f6bfe..7a4b391a 100755 --- 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-$&/; -- 2.30.2