license_finder 6.14.2 → 6.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34d77567442f9c47fcc7b150b7ffc32d2c7db0a76841ac3732f6e2af4887bc37
4
- data.tar.gz: 1ae0dec6f2a8902bddfbfc3f0e466a7f26e9b19d304b40eef4d1a7a76a56cd5a
3
+ metadata.gz: e0f3198afeab037eb2406cca40c96d108109195d56061b050d71885d034b2e3f
4
+ data.tar.gz: ffd412a79598a92e58ae9283a3edc3ed69e18fabfda33bc3edafcc5045b51391
5
5
  SHA512:
6
- metadata.gz: 5a6e40dca9d5f3a91ab6cfba5e002ef14b3974fd6caeb6e3489d4bfc17b16897d0126e6c9f7edc35b28a0ec087bf9b68c3eb739ae583ccc6dcffb29b0d901ae5
7
- data.tar.gz: 06d1bf8e227ce2db790f7ced5d53e507f384cdc7d582037bcb8be4574e7a483a550a34ba10c589c53b3513b24809900ba554da778de9b6cdb5437896c51a7b12
6
+ metadata.gz: 2ffa007a078fcc4f805c8d8b2ab5f0310d11977e3ab0c890dbf200cebca6a687bbde42a1159cb971897162882821f2663278ee2e7f24652f3ecb550b6f42894a
7
+ data.tar.gz: e3a8f9809ab13005912da13899d1b9f6078d918afa83ad4f5a11766e00813df1539d42d2b0103807a81f362ac4b15c0bf6b3ad7a8a1d7984b43c826f788baf1b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # [6.15.0] / 2021-12-17
2
+
3
+ ### Fixed
4
+ * Fix docker Conan and swift - [66031df9](https://github.com/pivotal/LicenseFinder/commit/66031df912c2e1e21aa794a4b897fc61c9ec6b02)
5
+
1
6
  # [6.14.2] / 2021-10-27
2
7
 
3
8
  ### Added
@@ -979,3 +984,4 @@ Bugfixes:
979
984
  [6.13.0]: https://github.com/pivotal/LicenseFinder/compare/v6.12.2...v6.13.0
980
985
  [6.14.1]: https://github.com/pivotal/LicenseFinder/compare/v6.13.0...v6.14.1
981
986
  [6.14.2]: https://github.com/pivotal/LicenseFinder/compare/v6.14.1...v6.14.2
987
+ [6.15.0]: https://github.com/pivotal/LicenseFinder/compare/v6.14.2...v6.15.0
data/Dockerfile CHANGED
@@ -137,7 +137,9 @@ RUN apt-get install -y python-dev && \
137
137
  --ignore-installed requests --ignore-installed chardet \
138
138
  --ignore-installed urllib3 \
139
139
  --upgrade setuptools && \
140
- pip install --no-cache-dir -Iv conan==1.11.2
140
+ pip install --no-cache-dir -Iv conan==1.43.0 && \
141
+ conan config install https://github.com/conan-io/conanclientcert.git
142
+
141
143
 
142
144
  # install NuGet (w. mono)
143
145
  # https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools#macoslinux
@@ -211,7 +213,7 @@ ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
211
213
  ARG SWIFT_PLATFORM=ubuntu18.04
212
214
  ARG SWIFT_BRANCH=swift-5.3.3-release
213
215
  ARG SWIFT_VERSION=swift-5.3.3-RELEASE
214
- ARG SWIFT_WEBROOT=https://swift.org/builds/
216
+ ARG SWIFT_WEBROOT=https://download.swift.org
215
217
 
216
218
  ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
217
219
  SWIFT_PLATFORM=$SWIFT_PLATFORM \
@@ -221,7 +223,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
221
223
 
222
224
  COPY swift-all-keys.asc .
223
225
  RUN set -e; \
224
- SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
226
+ SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)" \
225
227
  && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
226
228
  && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
227
229
  # - Grab curl here so we cache better up above
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.14.2
1
+ 6.15.0
data/dlf CHANGED
@@ -1,10 +1,14 @@
1
1
  #!/bin/bash
2
2
  if `which docker > /dev/null`; then
3
- if [ $# -eq 0 ]; then
4
- docker run -v $PWD:/scan -it licensefinder/license_finder
5
- else
6
- docker run -v $PWD:/scan -it licensefinder/license_finder /bin/bash -lc "cd /scan && `echo $@`"
7
- fi
3
+ if [ $# -eq 0 ]; then
4
+ docker run -v $PWD:/scan -it licensefinder/license_finder
5
+ else
6
+ escaped_params=""
7
+ for p in "$@"; do
8
+ escaped_params="$escaped_params \"$p\""
9
+ done
10
+ docker run -v $PWD:/scan -it licensefinder/license_finder /bin/bash -lc "cd /scan && $escaped_params"
11
+ fi
8
12
  else
9
13
  echo "You do not have docker installed. Please install it:"
10
14
  echo " https://docs.docker.com/engine/installation/"
@@ -5,6 +5,7 @@ module LicenseFinder
5
5
  module Text
6
6
  SPACES = /\s+/.freeze
7
7
  QUOTES = /['`"]{1,2}/.freeze
8
+ YEAR_PLACEHOLDERS = /<year>/.freeze
8
9
  PLACEHOLDERS = /<[^<>]+>/.freeze
9
10
  SPECIAL_SINGLE_QUOTES = /[‘’]/.freeze
10
11
  SPECIAL_DOUBLE_QUOTES = /[“”„«»]/.freeze
@@ -32,6 +33,7 @@ module LicenseFinder
32
33
 
33
34
  def self.compile_to_regex(text)
34
35
  Regexp.new(Regexp.escape(normalize_punctuation(text))
36
+ .gsub(YEAR_PLACEHOLDERS, '(\S*)')
35
37
  .gsub(PLACEHOLDERS, '(.*)')
36
38
  .gsub(',', '(,)?')
37
39
  .gsub('HOLDER', '(HOLDER|OWNER)')
@@ -18,10 +18,10 @@ module LicenseFinder
18
18
 
19
19
  deps = info_parser.parse(info_output)
20
20
  deps.map do |dep|
21
- name, version = dep['name'].split('@').first.split('/')
21
+ name, version = dep['name'].split('/')
22
22
  url = dep['URL']
23
23
  license_file_path = Dir.glob("#{project_path}/licenses/#{name}/**/LICENSE*").first
24
- ConanPackage.new(name, version, File.open(license_file_path).read, url) unless name == 'PROJECT'
24
+ ConanPackage.new(name, version, File.open(license_file_path).read, url) unless name == 'conanfile.txt'
25
25
  end.compact
26
26
  end
27
27
  end
@@ -9,7 +9,7 @@ module LicenseFinder
9
9
  end
10
10
 
11
11
  def current_packages
12
- cmd = "#{Yarn::SHELL_COMMAND}#{production_flag}"
12
+ cmd = "#{Yarn::SHELL_COMMAND}#{yarn1_production_flag}"
13
13
  suffix = " --cwd #{project_path}" unless project_path.nil?
14
14
  cmd += suffix unless suffix.nil?
15
15
 
@@ -39,7 +39,7 @@ module LicenseFinder
39
39
  end
40
40
 
41
41
  def prepare
42
- prep_cmd = "#{prepare_command}#{production_flag}"
42
+ prep_cmd = prepare_command.to_s
43
43
  _stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(prep_cmd) }
44
44
  return if status.success?
45
45
 
@@ -56,11 +56,33 @@ module LicenseFinder
56
56
  end
57
57
 
58
58
  def prepare_command
59
- 'yarn install --ignore-engines --ignore-scripts'
59
+ if yarn2_project?
60
+ yarn2_prepare_command
61
+ else
62
+ yarn1_prepare_command
63
+ end
60
64
  end
61
65
 
62
66
  private
63
67
 
68
+ def yarn2_prepare_command
69
+ "#{yarn2_production_flag}yarn install"
70
+ end
71
+
72
+ def yarn1_prepare_command
73
+ "yarn install --ignore-engines --ignore-scripts#{yarn1_production_flag}"
74
+ end
75
+
76
+ def yarn2_project?
77
+ Dir.chdir(project_path) do
78
+ version_string, stderr_str, status = Cmd.run('yarn -v')
79
+ raise "Command 'yarn -v' failed to execute: #{stderr_str}" unless status.success?
80
+
81
+ version = version_string.split('.').map(&:to_i)
82
+ return version[0] >= 2
83
+ end
84
+ end
85
+
64
86
  def packages_from_json(json_data)
65
87
  body = json_data['body']
66
88
  head = json_data['head']
@@ -98,10 +120,16 @@ module LicenseFinder
98
120
  all_packages - [yarn_internal_package]
99
121
  end
100
122
 
101
- def production_flag
123
+ def yarn1_production_flag
102
124
  return '' if @ignored_groups.nil?
103
125
 
104
126
  @ignored_groups.include?('devDependencies') ? ' --production' : ''
105
127
  end
128
+
129
+ def yarn2_production_flag
130
+ return '' if @ignored_groups.nil?
131
+
132
+ @ignored_groups.include?('devDependencies') ? 'yarn plugin import workspace-tools && yarn workspaces focus --all --production && ' : ''
133
+ end
106
134
  end
107
135
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.14.2
4
+ version: 6.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Collins
@@ -27,7 +27,7 @@ authors:
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2021-10-27 00:00:00.000000000 Z
30
+ date: 2021-12-17 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: bundler
@@ -537,7 +537,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
537
537
  - !ruby/object:Gem::Version
538
538
  version: '0'
539
539
  requirements: []
540
- rubygems_version: 3.2.30
540
+ rubygems_version: 3.2.33
541
541
  signing_key:
542
542
  specification_version: 4
543
543
  summary: Audit the OSS licenses of your application's dependencies.