mixlib-install 2.1.2 → 2.1.3
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +27 -0
- data/lib/mixlib/install/backend/package_router.rb +14 -10
- data/lib/mixlib/install/options.rb +6 -0
- data/lib/mixlib/install/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d424a33019d3bd912eefa7331d2dd448ae56d648
|
4
|
+
data.tar.gz: b0ea47fa486e2022d427652dd8d5a7540ea614c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e75ad628d8ca9b39f2e0e02ef40b25c8eb754bb70c4ce075e610161436bb1a07318307dfb18c50e9412cb035739767e0e222c74f18cfd835283ab404ac06c2
|
7
|
+
data.tar.gz: 19226b6e4115a5c0e8b9c272cfc150281f33528ddd1d3440110ed1d941a4308f559df3b0d16e0a63d9f19d43d522c56e8a1454af0ea1128c690ac18af1246d5d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -103,6 +103,33 @@ Mixlib::Install.available_versions("chef", "stable")
|
|
103
103
|
# => ["12.13.3", "12.13.7"]
|
104
104
|
```
|
105
105
|
|
106
|
+
### Collecting Software Dependencies and License Content
|
107
|
+
Collecting software dependencies and license content for ArtifactInfo instances
|
108
|
+
requires additional requests to the repository server. By default, collection is disabled.
|
109
|
+
To return that data for instances methods `software_dependencies` and `license_content`, the `include_metadata` option must be enabled.
|
110
|
+
|
111
|
+
```
|
112
|
+
options = {
|
113
|
+
channel: :current,
|
114
|
+
product_name: 'chef',
|
115
|
+
product_version: :latest,
|
116
|
+
platform: 'mac_os_x',
|
117
|
+
platform_version: '10.9',
|
118
|
+
architecture: 'x86_64',
|
119
|
+
include_metadata: true,
|
120
|
+
}
|
121
|
+
|
122
|
+
artifact = Mixlib::Install.new(options).artifact_info
|
123
|
+
|
124
|
+
artifact.license_content.class
|
125
|
+
# => String
|
126
|
+
artifact.software_dependencies.class
|
127
|
+
# => Hash
|
128
|
+
|
129
|
+
# By default, the instance methods return nil
|
130
|
+
|
131
|
+
```
|
132
|
+
|
106
133
|
## Development
|
107
134
|
VCR is a tool that helps cache and replay http responses. When these responses change or when you add more tests you might need to update cached responses. Check out [spec_helper.rb](https://github.com/chef/mixlib-install/blob/master/spec/spec_helper.rb) for instructions on how to do this.
|
108
135
|
|
@@ -174,17 +174,21 @@ Can not find any builds for #{options.product_name} in #{endpoint}.
|
|
174
174
|
artifact_map["filename"]
|
175
175
|
)
|
176
176
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
177
|
+
if options.include_metadata?
|
178
|
+
# retrieve the metadata using the standardized path
|
179
|
+
begin
|
180
|
+
metadata = get("#{chef_standard_path}.metadata.json")
|
181
|
+
license_content = metadata["license_content"]
|
182
|
+
software_dependencies = metadata["version_manifest"]["software"]
|
183
|
+
rescue Net::HTTPServerException => e
|
184
|
+
if e.message =~ /404/
|
185
|
+
license_content, software_dependencies = nil
|
186
|
+
else
|
187
|
+
raise e
|
188
|
+
end
|
187
189
|
end
|
190
|
+
else
|
191
|
+
license_content, software_dependencies = nil
|
188
192
|
end
|
189
193
|
|
190
194
|
# create the download path with the correct endpoint
|
@@ -38,6 +38,7 @@ module Mixlib
|
|
38
38
|
:product_version,
|
39
39
|
:shell_type,
|
40
40
|
:platform_version_compatibility_mode,
|
41
|
+
:include_metadata,
|
41
42
|
]
|
42
43
|
|
43
44
|
def initialize(options)
|
@@ -76,6 +77,10 @@ module Mixlib
|
|
76
77
|
product_version.to_sym == :latest
|
77
78
|
end
|
78
79
|
|
80
|
+
def include_metadata?
|
81
|
+
include_metadata.to_s == "true"
|
82
|
+
end
|
83
|
+
|
79
84
|
#
|
80
85
|
# Set the platform info on the instance
|
81
86
|
# info [Hash]
|
@@ -96,6 +101,7 @@ module Mixlib
|
|
96
101
|
shell_type: :sh,
|
97
102
|
platform_version_compatibility_mode: false,
|
98
103
|
product_version: :latest,
|
104
|
+
include_metadata: false,
|
99
105
|
}
|
100
106
|
end
|
101
107
|
|