From 026e4987a65f4bd8845e1ab3451225da724737a4 Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Mon, 3 Jul 2023 22:35:22 +0200 Subject: [PATCH 1/4] chore: update ci to python3.11-bookworm (which also ships schleuder 4 instead fo 3.6) --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49a13e6..ec56f23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: python:3.9-bullseye +image: python:3.11-bookworm stages: - test @@ -123,9 +123,7 @@ build_debian: - python3 setup.py egg_info install --root=package/debian/multischleuder/ --prefix=/usr --optimize=1 - cd package/debian - sed -re "s/__MULTISCHLEUDER_VERSION__/${MULTISCHLEUDER_VERSION}/g" -i multischleuder/DEBIAN/control - - mkdir -p multischleuder/usr/lib/python3/dist-packages/ - - rsync -a multischleuder/usr/lib/python3.9/site-packages/ multischleuder/usr/lib/python3/dist-packages/ - - rm -rf multischleuder/usr/lib/python3.9/site-packages + - mv multischleuder/usr/lib/python3.11 multischleuder/usr/lib/python3 - find multischleuder/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true - find multischleuder/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \; - find multischleuder/usr/lib/python3/dist-packages -name '*.pyo' -exec rm {} \; From caa2bd6a0624f660902a337ced9c06d1fc91b422 Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Tue, 4 Jul 2023 03:04:27 +0200 Subject: [PATCH 2/4] fix: apply patch for broken schleuder-cli package --- .gitlab-ci.yml | 3 ++- test/01-ruby3cgi.patch | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/01-ruby3cgi.patch diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec56f23..ad13b8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,8 @@ schleuder: script: - debconf-set-selections <<<"postfix postfix/mailname string example.org" - debconf-set-selections <<<"postfix postfix/main_mailer_type string 'Local only'" - - apt update; apt install --yes schleuder schleuder-cli postfix + - apt update; apt install --yes schleuder schleuder-cli postfix patch + - patch -p1 < test/01-ruby3cgi.patch # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040257 - /usr/lib/postfix/configure-instance.sh - - echo "virtual_alias_maps = static:root" >> /etc/postfix/main.cf - /usr/sbin/postmulti -i - -p start diff --git a/test/01-ruby3cgi.patch b/test/01-ruby3cgi.patch new file mode 100644 index 0000000..25bc897 --- /dev/null +++ b/test/01-ruby3cgi.patch @@ -0,0 +1,21 @@ +--- a/usr/lib/ruby/vendor_ruby/schleuder-cli.rb 2023-07-04 01:00:03.032907109 +0000 ++++ b/usr/lib/ruby/vendor_ruby/schleuder-cli.rb 2023-07-04 00:59:05.299382428 +0000 +@@ -3,6 +3,7 @@ + require 'pathname' + require 'net/https' + require 'uri' ++require 'cgi' + require 'singleton' + require 'yaml' + require 'base64' +--- a/usr/lib/ruby/vendor_ruby/schleuder-cli/helper.rb 2023-07-04 00:59:55.332884367 +0000 ++++ b/usr/lib/ruby/vendor_ruby/schleuder-cli/helper.rb 2023-07-04 00:59:20.859439658 +0000 +@@ -19,7 +19,7 @@ + u = "/#{args.join('/')}.json" + if params + paramstring = params.map do |k,v| +- "#{URI.escape(k.to_s)}=#{URI.escape(v.to_s)}" ++ "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" + end.join('&') + u << "?#{paramstring}" + end From d1e940391370298a983d48994f976e5294692247 Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Tue, 4 Jul 2023 03:07:36 +0200 Subject: [PATCH 3/4] fix: apply patch for broken schleuder-cli package --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad13b8c..9cdcbb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ schleuder: - debconf-set-selections <<<"postfix postfix/mailname string example.org" - debconf-set-selections <<<"postfix postfix/main_mailer_type string 'Local only'" - apt update; apt install --yes schleuder schleuder-cli postfix patch - - patch -p1 < test/01-ruby3cgi.patch # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040257 + - patch -d/ -p1 < test/01-ruby3cgi.patch # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040257 - /usr/lib/postfix/configure-instance.sh - - echo "virtual_alias_maps = static:root" >> /etc/postfix/main.cf - /usr/sbin/postmulti -i - -p start From d7603f2c87f1145852c8b0812403cca30b8b8e5d Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Tue, 4 Jul 2023 03:19:37 +0200 Subject: [PATCH 4/4] fix: ci python path fixes --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9cdcbb8..6e394cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,7 +124,9 @@ build_debian: - python3 setup.py egg_info install --root=package/debian/multischleuder/ --prefix=/usr --optimize=1 - cd package/debian - sed -re "s/__MULTISCHLEUDER_VERSION__/${MULTISCHLEUDER_VERSION}/g" -i multischleuder/DEBIAN/control - - mv multischleuder/usr/lib/python3.11 multischleuder/usr/lib/python3 + - mkdir -p multischleuder/usr/lib/python3 + - mv multischleuder/usr/lib/python3.11/site-packages multischleuder/usr/lib/python3/dist-packages + - rm -rf multischleuder/usr/lib/python3.11 - find multischleuder/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true - find multischleuder/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \; - find multischleuder/usr/lib/python3/dist-packages -name '*.pyo' -exec rm {} \;