pkgforge 0.4.11 → 0.4.12

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
  SHA1:
3
- metadata.gz: 264ddfb22fbba6afa5197ff26f426c1b332e6bab
4
- data.tar.gz: d04e8005705d2dc35d0bcc07f39bc412f338422e
3
+ metadata.gz: f9a38334d221eb2e0093f81e149ad1442009727b
4
+ data.tar.gz: beb09352808370b608679a3fbfaca874719fd64a
5
5
  SHA512:
6
- metadata.gz: f2703469eee712f3b1ae7efb22e48328fd11298c381e711e8c335d599c5d63530a9a602d48da8fa522d5a3a892d78bb67db4d29c4c1a04b5083a907798f16025
7
- data.tar.gz: 73b61050f817f3f258dd63588add88d53ea949edee0c78df9d8fb5b55a4ef7063c9cfed774b448aabf74078b5932e8e27f8fa36da59bb5c9cac328ac79a511a1
6
+ metadata.gz: 7f4b196a000dedd1987da1f4bb305c4273b24e5b40f05b738ee57a8aa0c4c6d1067585749cadc09f01af23d9a470da5030ebd667433a80f97bdd9bc735fa8b62
7
+ data.tar.gz: 4aff62e60a2fc267c5a6196e3be13b474fcbbccb051964f5c5605a0a4162a9c42f1096f67bb7b9d5d6083f74bad5edfe7751ba2f8c88d4116fd7e233b5ff2ff8
@@ -34,12 +34,21 @@ module PkgForge
34
34
  Contract Func[None => nil] => nil
35
35
  def lib_override
36
36
  lib_path_file = '/etc/ld-musl-x86_64.path'
37
- old_lib_paths = File.read(lib_path_file)
37
+ old_lib_paths = File.read(lib_path_file) if File.exist?(lib_path_file)
38
38
  puts "Setting library path: #{ld_library_path}"
39
39
  File.open(lib_path_file, 'w') { |fh| fh << ld_library_path }
40
40
  yield
41
41
  ensure
42
- File.open(lib_path_file, 'w') { |fh| fh << old_lib_paths }
42
+ reset_lib_path_file(old_lib_paths)
43
+ end
44
+
45
+ Contract Maybe[String] => nil
46
+ def reset_lib_path_file(old_lib_paths)
47
+ if old_lib_paths
48
+ File.open(lib_path_file, 'w') { |fh| fh << old_lib_paths }
49
+ else
50
+ File.rm(lib_path_file)
51
+ end
43
52
  nil
44
53
  end
45
54
 
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Declare version number
3
3
  module PkgForge
4
- VERSION = '0.4.11'.freeze
4
+ VERSION = '0.4.12'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkgforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker