plat4m 1.1.4 → 1.1.6

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: '0568f72f0ee486986fb69681365388282d6a3ebce70cdd6aa7124b2c5ec7286e'
4
- data.tar.gz: 9c6b999ec6a913a576a1ce05f242f6a6a8e8bcff45a9ed67ef81ce0db7f177b7
3
+ metadata.gz: d6bca919c92aa255cfcf8e1996eb7eedfe1bc7943982ac476c671521d17fc6c2
4
+ data.tar.gz: d36e3c5fadea55755eb420b1b362bfd7aa77fbc365f9f950c595ee90e5a151ec
5
5
  SHA512:
6
- metadata.gz: a1bf2e5b82143028990f8dc384228ab58d4bf861d7d2ee826ad40e1b734e7dc86748b0d0ed4ccc298fa56064c889e21ca82148faaf00d7ba831a86915d58ea1e
7
- data.tar.gz: e06c38c1caa125f661446fec555ce6da4541259419fe680c4474de1a89a96e21d7dcdc37e4ffc71acf490b2fe722bd35c4e13f2b0939cdda847fdd1aa12d5ef0
6
+ metadata.gz: 0c8192c2f6ba80b85ec725f51049c49491b796aa0cf1ece235aef691f07e715509e2a46fdd9fde25d81cbabd949dc99777bf8554c870103606784a1d54361919
7
+ data.tar.gz: 2eebd3fe3e7ea893d95a18d8762a99cf0bbf440a4398efd1bc3ed01c92e6a3d7a5884baf72a0da1780269540c3fd4ec4ac301fba803517fde9b53f2c08f9a9cc
@@ -40,7 +40,10 @@ module Plat4m
40
40
  end
41
41
  {
42
42
  variant: if data['ID_LIKE']
43
- data['ID_LIKE'].split.first.to_sym
43
+ case (_v = data['ID_LIKE'].split.first.to_sym)
44
+ when :ubuntu then :debian # Distro like Mint has "ID_LIKE=ubuntu debian"
45
+ else _v
46
+ end
44
47
  elsif File.file?('/etc/redhat-release')
45
48
  :rhel
46
49
  elsif File.file?('/etc/SUSE-brand') || File.file?('/etc/SuSE-release')
@@ -85,7 +88,11 @@ module Plat4m
85
88
  when :suse
86
89
  Zypper.new(distro)
87
90
  when :arch
88
- Pacman.new(distro)
91
+ if distro[:distro] == 'manjaro'
92
+ Pamac.new(distro)
93
+ else
94
+ Pacman.new(distro)
95
+ end
89
96
  end
90
97
  distro
91
98
  end
@@ -258,6 +265,30 @@ module Plat4m
258
265
 
259
266
  end
260
267
 
268
+ class Pamac < NixManager
269
+
270
+ def installed?(pkg)
271
+ res = `pamac search -iq ^#{pkg}$ 2>&1`.chomp.split
272
+ !!(res.size == 1 && res.first =~ /^#{pkg}$/)
273
+ end
274
+
275
+ def available?(pkg)
276
+ res = `pamac search -rq ^#{pkg}$ 2>&1`.chomp.split
277
+ !!(res.size == 1 && res.first =~ /^#{pkg}$/)
278
+ end
279
+
280
+ protected
281
+
282
+ def get_install_command(*pkgs)
283
+ "pamac install --no-confirm #{ pkgs.join(' ') }"
284
+ end
285
+
286
+ def get_uninstall_command(*pkgs)
287
+ "pamac remove --no-confirm -u #{ pkgs.join(' ') }"
288
+ end
289
+
290
+ end
291
+
261
292
  end
262
293
 
263
294
  end
@@ -8,6 +8,6 @@
8
8
  module Plat4m
9
9
 
10
10
  # Current Plat4m version.
11
- VERSION = '1.1.4'
11
+ VERSION = '1.1.6'.freeze
12
12
 
13
13
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plat4m
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Plat4m is a simple runtime system platform scouting and support library.
14
13
  email: mcorino@m2c-software.nl
@@ -33,7 +32,6 @@ metadata:
33
32
  bug_tracker_uri: https://github.com/mcorino/plat4m/issues
34
33
  homepage_uri: https://github.com/mcorino/plat4m
35
34
  github_repo: https://github.com/mcorino/plat4m
36
- post_install_message:
37
35
  rdoc_options: []
38
36
  require_paths:
39
37
  - lib
@@ -48,8 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
46
  - !ruby/object:Gem::Version
49
47
  version: '0'
50
48
  requirements: []
51
- rubygems_version: 3.5.16
52
- signing_key:
49
+ rubygems_version: 3.6.9
53
50
  specification_version: 4
54
51
  summary: Runtime system detection.
55
52
  test_files: []