patchelf 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/patchelf/patcher.rb +13 -5
- data/lib/patchelf/version.rb +1 -1
- 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: 8560f68dba4f9e656585c38f31da63ae5f15320a03c1675adb13d27ffa2230b4
|
4
|
+
data.tar.gz: 2d19b129beb5df7bd713fc6f0f65bb942194bea201857bda499a18e4496c4fe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c443a08655333dc1b97ca62c1f6803bf6971565a9b40c80554aaf89a78b8e7548f0a854dd6703175e8be57154ca541ffe71f642a35ded2a734fbe1eae83b0e
|
7
|
+
data.tar.gz: 73707a964c3cc1a9d47efcb0baaa45d1fc8e42e2450acca899b5258ca2b9236229e9e560a5c9fa347bbd7c5a429644a66ceed5ac072cb7ac06db3b98088c1a8c
|
data/lib/patchelf/patcher.rb
CHANGED
@@ -19,13 +19,21 @@ module PatchELF
|
|
19
19
|
# @param [String] filename
|
20
20
|
# Filename of input ELF.
|
21
21
|
# @param [Boolean] logging
|
22
|
-
#
|
23
|
-
|
22
|
+
# *deprecated*: use +on_error+ instead
|
23
|
+
# @param [:log, :silent, :exception] on_error
|
24
|
+
# action when the desired segment/tag field isn't present
|
25
|
+
# :log = logs to stderr
|
26
|
+
# :exception = raise exception related to the error
|
27
|
+
# :silent = ignore the errors
|
28
|
+
def initialize(filename, on_error: :log, logging: true)
|
24
29
|
@in_file = filename
|
25
30
|
@elf = ELFTools::ELFFile.new(File.open(filename))
|
26
31
|
@set = {}
|
27
32
|
@rpath_sym = :runpath
|
28
|
-
@
|
33
|
+
@on_error = !logging ? :exception : on_error
|
34
|
+
|
35
|
+
on_error_syms = %i[exception log silent]
|
36
|
+
raise ArgumentError, "on_error must be one of #{on_error_syms}" unless on_error_syms.include?(@on_error)
|
29
37
|
end
|
30
38
|
|
31
39
|
# @return [String?]
|
@@ -179,9 +187,9 @@ module PatchELF
|
|
179
187
|
private
|
180
188
|
|
181
189
|
def log_or_raise(msg, exception = PatchELF::PatchError)
|
182
|
-
raise exception, msg
|
190
|
+
raise exception, msg if @on_error == :exception
|
183
191
|
|
184
|
-
PatchELF::Logger.warn(msg)
|
192
|
+
PatchELF::Logger.warn(msg) if @on_error == :log
|
185
193
|
end
|
186
194
|
|
187
195
|
def interpreter_
|
data/lib/patchelf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patchelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- david942j
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elftools
|