[X2Go-Commits] [maintenancescripts] 01/01: git/hooks/x2go-post-receive-{close-bugs, tag-pending}: temporarily fix perl issue via switching to a python one-liner to encode the From address.

git-admin at x2go.org git-admin at x2go.org
Mon Mar 6 04:58:20 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository maintenancescripts.

commit 9653406e0a23c573734b7be01b0c8090a09b5439
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Mar 6 04:57:13 2017 +0100

    git/hooks/x2go-post-receive-{close-bugs,tag-pending}: temporarily fix perl issue via switching to a python one-liner to encode the From address.
    
    Will be reverted once
    https://bugs.launchpad.net/ubuntu/+source/libencode-perl/+bug/1670226 is
    fixed.
---
 git/hooks/x2go-post-receive-close-bugs  | 5 ++++-
 git/hooks/x2go-post-receive-tag-pending | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/git/hooks/x2go-post-receive-close-bugs b/git/hooks/x2go-post-receive-close-bugs
index dee3585..7f0cdfe 100755
--- a/git/hooks/x2go-post-receive-close-bugs
+++ b/git/hooks/x2go-post-receive-close-bugs
@@ -35,8 +35,11 @@ function send_mail () { # send_mail bugno revno diff_file
     local oldrev="${3}"
     local newrev="${4}"
     local diff="${5}"
+    # Switch to a python implementation until https://bugs.launchpad.net/ubuntu/+source/libencode-perl/+bug/1670226 is fixed.
+    #local from="$(git show -s --pretty='format:%cn <%ce>' "$(git rev-parse --verify "${newrev}^{commit}")" |
+    #              perl -CI -MEncode -e 'print Encode::encode("MIME-Q", <STDIN>)')"
     local from="$(git show -s --pretty='format:%cn <%ce>' "$(git rev-parse --verify "${newrev}^{commit}")" |
-                  perl -CI -MEncode -e 'print Encode::encode("MIME-Q", <STDIN>)')"
+                  python3.5 -c 'from email.header import Header; import fileinput;[print(Header(line, "UTF-8").encode()) for line in fileinput.input()]')"
     (cat <<EOF
 From: ${from}
 To: ${bug}-submitter at bugs.x2go.org
diff --git a/git/hooks/x2go-post-receive-tag-pending b/git/hooks/x2go-post-receive-tag-pending
index b79ffbb..b3cf7fa 100755
--- a/git/hooks/x2go-post-receive-tag-pending
+++ b/git/hooks/x2go-post-receive-tag-pending
@@ -34,8 +34,11 @@ function send_mail () { # send_mail bugno revno diff_file
     local fixed_in_version="${2}"
     local rev="${3}"
     local diff="${4}"
+    # Switch to a python implementation until https://bugs.launchpad.net/ubuntu/+source/libencode-perl/+bug/1670226 is fixed.
+    #local from="$(git show -s --pretty='format:%cn <%ce>' "${rev}" |
+    #              perl -CI -MEncode -e 'print Encode::encode("MIME-Q", <STDIN>)')"
     local from="$(git show -s --pretty='format:%cn <%ce>' "${rev}" |
-                  perl -CI -MEncode -e 'print Encode::encode("MIME-Q", <STDIN>)')"
+                  python3.5 -c 'from email.header import Header; import fileinput;[print(Header(line, "UTF-8").encode()) for line in fileinput.input()]')"
     (cat <<EOF
 From: ${from}
 To: ${bug}-submitter at bugs.x2go.org

--
Alioth's /srv/git/code.x2go.org/maintenancescripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git


More information about the x2go-commits mailing list