[DRE-maint] Bug#989175: Version patch doesn't work with coloured Maven output

Raul Tambre raul at tambre.ee
Thu May 27 16:21:01 BST 2021


Package: ruby-maven-libs
Version: 3.3.9+ds-1.1
Severity: important

My "mvn --version" outputs the version text bold using ASCII escape sequences (\e[1m).
The 02-do-not-hard-code-maven-version.patch patch in ruby-maven-libs fails to parse this, i.e. ruby -e "require 'maven'" fails with:

Traceback (most recent call last):
        4: from -e:1:in `<main>'
        3: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'
        2: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'
        1: from /usr/lib/ruby/vendor_ruby/maven.rb:1:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/maven.rb:12:in `<module:Maven>': undefined method `split' for nil:NilClass (NoMethodError)

This is because the regex asserts the match at the beginning of the line, but the string is actually "\e[1mApache Maven 3.6.3\e[m".
Things that work to fix this:
1. Remove the assert for the beginning of the line (the ^)
2. Simplify to `#{mvn_cmd_path} --version`.split("\n")[0].split[2].freeze

-- System Information:
Debian Release: 11.0
  APT prefers experimental
  APT policy: (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ruby-maven-libs depends on:
ii  maven  3.6.3-5
ii  ruby   1:2.7+2

ruby-maven-libs recommends no packages.

ruby-maven-libs suggests no packages.

-- no debconf information



More information about the Pkg-ruby-extras-maintainers mailing list