dply 0.2.17 → 0.2.18

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: 980e8598ba0b980d03dc89def37df554f890d201
4
- data.tar.gz: c098dab6fa8887ca688a00af615adb76b02e2a36
3
+ metadata.gz: a4d1e103de385380812dbb80962948bdada9d958
4
+ data.tar.gz: 06a06f6e1bd0b850633493580109c1477108dfc5
5
5
  SHA512:
6
- metadata.gz: bad6a7d76cfd0e00cb0e72c6a803194b11ba187e96e0468a2e72354c669a3e01099c123a7650e83dc21300a7b2c38ffa79d30df1b0766617014ae94706f1017c
7
- data.tar.gz: 4c0121676d58fa36a703948e1f45275006c24d9367183c08b614c77eccd8380d5f78b86d911bd80a70824052ddba0b18807d4ad2202d8efe4eb4bdb0529c163d
6
+ metadata.gz: 4e01402487708e257bd4c94c739f059798b1d4597e4ff06986be7c44a005a055349d9c32d6faed36c103c7a778ab6d079c63e32f2e1d8552467e8a9aca319c22
7
+ data.tar.gz: 04971dda86f69b50af9f26ee4c9303416b69ddd1b20fbba88af279417960955b0433a795016fcad109f449b9d1580e7d88509315e6441191ad485d09bebd2c01
@@ -34,7 +34,7 @@ module Dply
34
34
  def cleanup
35
35
  logger.trace "cleaning tmp/archive"
36
36
  files = [ path, checksum_path ]
37
- files.each { |f| FileUtils.rm f if File.exists? f }
37
+ files.each { |f| FileUtils.rm f if File.exist? f }
38
38
  end
39
39
 
40
40
  def download_file
@@ -78,14 +78,23 @@ module Dply
78
78
  end
79
79
 
80
80
  def dynamic_libs(file)
81
+ path = Pathname.new(file)
81
82
  Elf::File.open(file) do |ef|
82
83
  return [] if not ef.has_section? ".dynamic"
83
- ef[".dynamic"].needed_libraries.keys
84
+ dynamic = ef[".dynamic"].needed_libraries.keys
85
+ rpath = ef[".dynamic"].rpath.map { |i| i.sub("$ORIGIN", "#{path.dirname}") }
86
+ external = dynamic.reject { |l| lib_in_rpath? l, rpath }
87
+ logger.debug { "[#{file}]: dynamic:#{dynamic.size} rpath:#{dynamic.size - external.size} ext:#{external.size}" } if logger.debug?
88
+ external
84
89
  end
85
90
  rescue Exception
86
91
  return []
87
92
  end
88
93
 
94
+ def lib_in_rpath?(lib, rpath)
95
+ rpath.any? { |i| File.exist? "#{i}/#{lib}" }
96
+ end
97
+
89
98
  def rpm
90
99
  @rpm ||= Rpm.new
91
100
  end
@@ -1,3 +1,3 @@
1
1
  module Dply
2
- VERSION = "0.2.17"
2
+ VERSION = "0.2.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-07 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-elf