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 +4 -4
- data/lib/specinfra/helper/detect_os/debian.rb +12 -5
- data/lib/specinfra/version.rb +1 -1
- data/spec/helper/detect_os/debian_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e321cef299b5304cbd2be799da02c91b6f8f27eb0e262874b6277641e54becf7
|
4
|
+
data.tar.gz: 520fa85f14e29cce1e7d902854eabbabbf7151db348432cd41ace8b0803ce8b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/specinfra/version.rb
CHANGED
@@ -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.
|
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
|
11
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|