licensed 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/licensed/source/cabal.rb +17 -11
- data/lib/licensed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 877368e57ede0682327f09bcfcea106b6f34ac3a
|
4
|
+
data.tar.gz: 44e24e3dab3df7507ff805cd3eccc10591827586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7891002cbec39b405c48498b93be1fe6b261ef88815673f5efc2b0a0fdf9410afbfb374bc41f2bf3030e4afe3505cc2ea9002d969693c32e78960e7044d01855
|
7
|
+
data.tar.gz: 3f254744732b945cd9df93f1c113ca424844200c1cc5686687108af7907cc2cc5d37a719b4b94800703b0f25f52eeabd4c535c0e3b54415e60c36e5afc8db684
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## 1.3.2 - 2018-08-15
|
10
|
+
### Fixed
|
11
|
+
- Fixed issue when multiple versions of a cabal package are found
|
12
|
+
|
9
13
|
## 1.3.1 - 2018-08-01
|
10
14
|
### Fixed
|
11
15
|
- Fixed regression finding ruby gems by path
|
@@ -64,4 +68,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
64
68
|
|
65
69
|
Initial release :tada:
|
66
70
|
|
67
|
-
[Unreleased]: https://github.com/github/licensed/compare/1.3.
|
71
|
+
[Unreleased]: https://github.com/github/licensed/compare/1.3.2...HEAD
|
@@ -66,7 +66,7 @@ module Licensed
|
|
66
66
|
|
67
67
|
# Returns a `Set` of the package ids for all cabal dependencies
|
68
68
|
def package_ids
|
69
|
-
recursive_dependencies(
|
69
|
+
recursive_dependencies(cabal_file_dependency_ids)
|
70
70
|
end
|
71
71
|
|
72
72
|
# Recursively finds the dependencies for each cabal package.
|
@@ -151,29 +151,35 @@ module Licensed
|
|
151
151
|
end
|
152
152
|
|
153
153
|
# Returns a set containing the top-level dependencies found in cabal files
|
154
|
+
def cabal_file_dependency_ids
|
155
|
+
cabal_file_dependencies.map { |target| cabal_package_id(target) }.compact
|
156
|
+
end
|
157
|
+
|
154
158
|
def cabal_file_dependencies
|
155
|
-
cabal_files.each_with_object(Set.new) do |cabal_file,
|
159
|
+
@cabal_file_dependencies ||= cabal_files.each_with_object(Set.new) do |cabal_file, targets|
|
156
160
|
content = File.read(cabal_file)
|
157
161
|
next if content.nil? || content.empty?
|
158
162
|
|
159
163
|
# add any dependencies for matched targets from the cabal file.
|
160
164
|
# by default this will find executable and library dependencies
|
161
165
|
content.scan(cabal_file_regex).each do |match|
|
162
|
-
# match[1] is a string of "," separated dependencies
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
id = cabal_package_id(dep.split(/\s/)[0])
|
168
|
-
packages.add(id) if id
|
169
|
-
end
|
166
|
+
# match[1] is a string of "," separated dependencies.
|
167
|
+
# dependency packages might have a version specifier, remove them
|
168
|
+
# to get the full id specifier for each package
|
169
|
+
dependencies = match[1].split(",").map { |dep| dep.strip.split(/\s/)[0] }
|
170
|
+
targets.merge(dependencies)
|
170
171
|
end
|
171
172
|
end
|
172
173
|
end
|
173
174
|
|
174
175
|
# Returns an installed package id for the package.
|
175
176
|
def cabal_package_id(package_name)
|
176
|
-
|
177
|
+
# using the first returned id assumes that package resolvers
|
178
|
+
# order returned package information in the same order that it would
|
179
|
+
# be used during build
|
180
|
+
field = ghc_pkg_field_command(package_name, ["id"]).lines.first
|
181
|
+
return unless field
|
182
|
+
|
177
183
|
id = field.split(":", 2)[1]
|
178
184
|
id.strip if id
|
179
185
|
end
|
data/lib/licensed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: licensed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: licensee
|