specinfra 2.92.0 → 2.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41eadf19553cecaad597ee42c1e22757cfcddc9ba88fcd0c7c24a2b95400d426
4
- data.tar.gz: ddd53b0f9a6750c08bc23aeb3de8b46f4b00f63a74925a3cf85de7d44fd4a194
3
+ metadata.gz: e321cef299b5304cbd2be799da02c91b6f8f27eb0e262874b6277641e54becf7
4
+ data.tar.gz: 520fa85f14e29cce1e7d902854eabbabbf7151db348432cd41ace8b0803ce8b7
5
5
  SHA512:
6
- metadata.gz: b2aa5d0488509975ad807a8397b9b37d949e1a5526fa67e68a40e557b4a8fd2d688006a78b4816664408799eee6b23108a8224ba0252d75a996ec39b5903826f
7
- data.tar.gz: 1439700273209ecd261aeb17ed9a6992925d03ddd46f09aba71d85b1def93802dce9b5fa47ed96a7e34c568c5babbc578e1162699f5564271f95a35085ee05ce
6
+ metadata.gz: 4013fb3be50562a79f109b4e50caead9171b8d0cae3dbb966016c24c8c0148a940ea894ef62e961a12143765ed9dbb284899563b1639b68e254ad219962d241c
7
+ data.tar.gz: ca5897fa506bedeadb3ef834ca4353713a747688c2d91d5758b0b61d54b07429872fc31fbf6ba079bcd7bdcb088eae745c90bdf90e66c0308a10dfe11b85301d
@@ -13,13 +13,20 @@ class Specinfra::Helper::DetectOs::Debian < Specinfra::Helper::DetectOs
13
13
  distro = line.split('=').last.strip if line =~ /^DISTRIB_ID=/
14
14
  release = line.split('=').last.strip if line =~ /^DISTRIB_RELEASE=/
15
15
  end
16
- else
17
- if debian_version.stdout.chomp =~ /^[[:digit:]]+\.[[:digit:]]+$/
18
- release = debian_version.stdout.chomp
19
- end
20
16
  end
21
17
  distro ||= 'debian'
22
- release ||= nil
18
+ # lsb-release not available or reported no version number:
19
+ if release.nil? || release == 'n/a'
20
+ release = case debian_version.stdout.chomp
21
+ when /^[[:digit:]]+\.[[:digit:]]+$/
22
+ debian_version.stdout.chomp
23
+ when %r{^\w+/sid$}
24
+ # a number larger than any normal Debian version ever:
25
+ 2**32 - 1.0
26
+ else
27
+ nil
28
+ end
29
+ end
23
30
  { :family => distro.gsub(/[^[:alnum:]]/, '').downcase, :release => release }
24
31
  end
25
32
  end
@@ -1,5 +1,5 @@
1
1
  module Specinfra
2
- VERSION = "2.92.0"
2
+ VERSION = "2.93.0"
3
3
 
4
4
  def self.ruby_is_older_than?(*version)
5
5
  (RUBY_VERSION.split('.').map(&:to_i) <=> version) < 0
@@ -64,4 +64,19 @@ describe Specinfra::Helper::DetectOs::Debian do
64
64
  :release => '16.04'
65
65
  )
66
66
  end
67
+ it 'Should return debian testing when lsb_release says release = n/a' do
68
+ allow(debian).to receive(:run_command).with('cat /etc/debian_version') {
69
+ CommandResult.new(:stdout => "bookworm/sid", :exit_status => 0)
70
+ }
71
+ allow(debian).to receive(:run_command).with('lsb_release -ir') {
72
+ CommandResult.new(:stdout => "Distributor ID: Debian\nRelease: n/a\n", :exit_status => 0)
73
+ }
74
+ allow(debian).to receive(:run_command).with('cat /etc/lsb-release') {
75
+ CommandResult.new(:stdout => "", :exit_status => 1)
76
+ }
77
+ expect(debian.detect).to include(
78
+ :family => 'debian',
79
+ :release => 4294967295.0
80
+ )
81
+ end
67
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.92.0
4
+ version: 2.93.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-05 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64