getch 0.3.3 → 0.3.5

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: 6e6d53101249982f83b05a372decd08d8967c52fc952b930dff7bf4d6c31634f
4
- data.tar.gz: 3410eab0dff20d434691e6ddb7e5f8279c6a2eb70e4d675ac5791932638cb614
3
+ metadata.gz: 6a15cef9d7c838de8e60bb93e4ee6bbe3e0b473c7eb5a8b0e0e003cb7d4edc2d
4
+ data.tar.gz: ebe82964c26b1b75ea7b0b446fb593b36aa5d1ffa8382138853b4ba52e06c7a3
5
5
  SHA512:
6
- metadata.gz: d96be1666a606ef3eacd482bc539e75612844cf83406095113566901c42834e3e604d23908bbd87ab41b830c6fd1d6381a3ae36f04122c0b184dbebba192f0f8
7
- data.tar.gz: 9ff7cb0caa78084a6bc04a6e72acec5c582e17191473583ffd0fcf9401e9275b9ae8ed9e59f68e49be0a4477f78b941348bba550c7b3d6e99b7181725b08bad9
6
+ metadata.gz: cad28b0d1459f912f6c587ee2d42c384b1a720e82f6cb96079fc16396d2a4522e0ca5f2099c75e52dbd4159837481b82828df6ff98bca56b9ee8e3fa3a51aa84
7
+ data.tar.gz: 0eefb3ddfee3658e882a75ac18caef7d25f86442a32511e74ab1167aac6f631b507839d024087f7488615f2f5272bc6fba0adb06562ed3ac8633af4822a42cec
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
- ## 0.3.2, release 2022-10-01
1
+ ## 0.3.5, release 2022-11-21
2
+ * Tested on a live Ubuntu 22.10.
3
+ * Ensure `dracut.conf.d` exist before writing to it.
4
+ * Display the version with `-v`, `--version`.
5
+
6
+ ## 0.3.4, release 2022-10-10
7
+ * Can work on a Live image of Voidlinux
8
+
9
+ ## 0.3.3, release 2022-10-01
2
10
  * Support disk with a sector size of 512.
3
11
  * Support vdx disk.
4
12
 
data/README.md CHANGED
@@ -40,13 +40,17 @@ Boot Manager:
40
40
 
41
41
  The ISO images i was able to test and that works:
42
42
  + [Archlinux](https://www.archlinux.org/download/)
43
- + [Archaeidae](https://github.com/szorfein/archaeidae): Custom Archiso that includes ZFS support.
43
+ + [Portia](https://github.com/szorfein/portia/releases): Custom Archiso that includes ZFS support and Ruby.
44
+ * [Ubuntu 22.10](https://cdimage.ubuntu.com/releases/22.10/release/)
45
+ * [Voidlinux](https://voidlinux.org/download/)
44
46
 
45
47
  You can also use your current `linux` host, just pay attention to the disk that will be used.
46
48
 
47
49
  ## Dependencies
48
50
  Getch is build without external libs, so it only require `ruby >= 2.5`.
49
51
 
52
+ On a live image of Void, you need to install `xbps-install -S ruby xz gptfdisk`.
53
+
50
54
  ## Install
51
55
  Getch is cryptographically signed, so add my public key (if you haven’t already) as a trusted certificate.
52
56
  With `gem` installed:
data/lib/dracut/root.rb CHANGED
@@ -24,6 +24,7 @@ module Dracut
24
24
  protected
25
25
 
26
26
  def host_only
27
+ mkdir "#{@mountpoint}/etc/dracut.conf.d"
27
28
  file = "#{@mountpoint}/etc/dracut.conf.d/host.conf"
28
29
  echo file, 'hostonly="yes"'
29
30
  echo_a file, 'use_fstab="yes"'
data/lib/getch/helpers.rb CHANGED
@@ -29,7 +29,7 @@ module Getch
29
29
 
30
30
  def self.get_file_online(url, dest)
31
31
  URI.open(url) do |l|
32
- File.open(dest, "wb") { |f| f.write(l.read) }
32
+ File.open(dest, 'wb') { |f| f.write(l.read) }
33
33
  end
34
34
  rescue Net::OpenTimeout => e
35
35
  abort "DNS error #{e}"
data/lib/getch/options.rb CHANGED
@@ -84,6 +84,11 @@ module Getch
84
84
  OPTIONS[:verbose] = true
85
85
  end
86
86
 
87
+ opts.on('-v', '--version', 'Display the version.') do
88
+ puts "Getch v#{VERSION}"
89
+ exit
90
+ end
91
+
87
92
  opts.on('-h', '--help', 'Display this') do
88
93
  puts opts
89
94
  exit
data/lib/getch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Getch
2
- VERSION = '0.3.3'.freeze
2
+ VERSION = '0.3.5'.freeze
3
3
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'open-uri'
4
3
  require 'open3'
5
4
 
6
5
  module Getch
@@ -15,7 +14,7 @@ module Getch
15
14
  end
16
15
 
17
16
  def x
18
- search_archive
17
+ @xbps = search_archive
19
18
  download
20
19
  checksum
21
20
  install
@@ -29,14 +28,19 @@ module Getch
29
28
  /void-x86_64-ROOTFS-[\d._]+.tar.xz/
30
29
  end
31
30
 
32
- # Search only the glibc x86_64 for now
31
+ # Search the name of the last release in @file 'sha256sum.txt'
32
+ # Should find a line like this:
33
+ # SHA256 (void-x86_64-ROOTFS-20210930.tar.xz) = 8681b060e39e173682e1721a6088280c2b6eade628f5e5e3e8e4b74163d187f6
33
34
  def search_archive
34
35
  yurl = "#{@url}/#{@file}"
35
36
  @log.info "Opening #{yurl}...\n"
36
37
  Helpers.get_file_online(yurl, @file)
37
38
  File.open(@file).each do |l|
38
- @xbps = l.tr('()', '').split(' ') if l.match(tarball)
39
+ matchrule = l.tr('()', '').split(' ') if l.match(tarball)
40
+ return matchrule if matchrule && matchrule[1] =~ /^void/
39
41
  end
42
+
43
+ raise "No valid archive found on #{@file}."
40
44
  end
41
45
 
42
46
  def download
@@ -55,10 +59,10 @@ module Getch
55
59
  _, stderr, status = Open3.capture3(command)
56
60
  if status.success? then
57
61
  @log.result_ok
58
- return
62
+ else
63
+ cleaning
64
+ @log.fatal "Problem with the checksum, relaunch getch.\n#{stderr}"
59
65
  end
60
- cleaning
61
- @log.fatal "Problem with the checksum, stderr\n#{stderr}"
62
66
  end
63
67
 
64
68
  def install
@@ -74,10 +78,9 @@ module Getch
74
78
  _, stderr, status = Open3.capture3(cmd)
75
79
  if status.success? then
76
80
  @log.result_ok
77
- return
81
+ else
82
+ @log.fatal "Fail to decompressing #{@xbps[1]} - #{stderr}."
78
83
  end
79
- cleaning
80
- @log.fatal "Fail to decompressing #{@xbps[1]} - #{stderr}."
81
84
  end
82
85
 
83
86
  def cleaning
@@ -25,7 +25,7 @@ module Getch
25
25
 
26
26
  def update
27
27
  ChrootOutput.new '/usr/bin/xbps-install -uy'
28
- ChrootOutput.new '/usr/bin/xbps-install -y base-system'
28
+ ChrootOutput.new '/usr/bin/xbps-install', '-Sy', 'base-system'
29
29
  ChrootOutput.new '/usr/bin/xbps-remove -y base-voidstrap'
30
30
  end
31
31
  end
data/lib/nito.rb CHANGED
@@ -55,12 +55,12 @@ module NiTo
55
55
 
56
56
  # Like echo 'content' > to_file
57
57
  def echo(file, content)
58
- File.write file, "#{content}\n", mode: 'w'
58
+ File.write(file, "#{content}\n")
59
59
  end
60
60
 
61
61
  # Like echo 'content' >> to_file
62
62
  def echo_a(file, content)
63
- File.write file, "#{content}\n", mode: 'a' unless grep? file, content
63
+ File.write(file, "#{content}\n", mode: 'a') unless grep? file, content
64
64
  end
65
65
 
66
66
  def cp(src, dest)
@@ -69,7 +69,7 @@ module NiTo
69
69
 
70
70
  # create a void file
71
71
  def touch(file)
72
- File.write file, '' unless File.exist? file
72
+ File.write(file, '') unless File.exist? file
73
73
  end
74
74
 
75
75
  # Like sed -i /old:new/ file
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -36,7 +36,7 @@ cert_chain:
36
36
  aEJeKq4/BlIwMlXPe+W5C8zp2i8hgG1/OYbwbGE1p2iRi1NIK7G/HyRqQjOqJxzE
37
37
  LLknX69FN7/G
38
38
  -----END CERTIFICATE-----
39
- date: 2022-10-01 00:00:00.000000000 Z
39
+ date: 2022-11-23 00:00:00.000000000 Z
40
40
  dependencies: []
41
41
  description:
42
42
  email:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.3.19
194
+ rubygems_version: 3.3.23
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: A CLI tool to install Gentoo or VoidLinux.
metadata.gz.sig CHANGED
Binary file