package_cloud 0.3.09 → 0.3.11
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/lib/package_cloud/cli/entry.rb +8 -16
- data/lib/package_cloud/validator.rb +13 -0
- data/lib/package_cloud/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: 6b5523eccf8d9b23c5a3b222818a680bd585560c2e898bee15a88a7c35b969f0
|
|
4
|
+
data.tar.gz: ab27f540c2bd98e2a312ad0b8ed34ff036a78b3ef440355d0b65a0812fb2b6a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b7f861f0cebb2a24d4ed81c1119656198638b7b574f2d72fdc07efb68564b42b5b4a850b8980483fcca18cac817ea7c9302803ba439dd755f36e5dfe622269b
|
|
7
|
+
data.tar.gz: 9034cef17e319ab4e4d962e55e8488d6e3a31df096f38f371bc40c71adbe02f1476401eac44f812e2ebf761be1c41efa95a3c98b20f068d02de782dfa2a61d0c
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module PackageCloud
|
|
2
2
|
module CLI
|
|
3
3
|
JAVA_EXTS = ["jar", "aar", "war"]
|
|
4
|
-
PY_EXTS = ["gz", "bz2", "z", "tar", "egg-info", "
|
|
4
|
+
PY_EXTS = ["gz", "bz2", "z", "tar", "egg-info", "whl", "egg"]
|
|
5
5
|
ANYFILE_EXTS = ["asc"]
|
|
6
|
-
NODE_EXTS = [
|
|
7
|
-
|
|
6
|
+
NODE_EXTS = []
|
|
7
|
+
AMBIGUOUS_EXTS = ["tgz", "apk", "zip"]
|
|
8
|
+
SUPPORTED_EXTS = JAVA_EXTS + PY_EXTS + ANYFILE_EXTS + AMBIGUOUS_EXTS + ["gem", "deb", "rpm", "dsc"]
|
|
8
9
|
|
|
9
10
|
class Entry < Base
|
|
10
11
|
desc "repository SUBCMD ...ARGS", "manage repositories"
|
|
@@ -111,7 +112,6 @@ module PackageCloud
|
|
|
111
112
|
package_files << package_file
|
|
112
113
|
|
|
113
114
|
exts = package_files.map { |f| f.split(".").last }.uniq
|
|
114
|
-
exts = handle_special_exts(repo, exts)
|
|
115
115
|
|
|
116
116
|
if package_files.length > 1 && exts.length > 1
|
|
117
117
|
abort("You can't push multiple packages of different types at the same time.\nFor example, use *.deb to push all your debs at once.".color(:red))
|
|
@@ -130,7 +130,8 @@ module PackageCloud
|
|
|
130
130
|
invalid_packages.each do |p|
|
|
131
131
|
message << " #{p}\n"
|
|
132
132
|
end
|
|
133
|
-
message << "\npackage_cloud only supports node.js, deb, gem, java, python,
|
|
133
|
+
message << "\npackage_cloud only supports node.js, deb, gem, java, python, "\
|
|
134
|
+
"rpm, alpine, helm, anyfile (.zip, .asc) packages".color(:red)
|
|
134
135
|
abort(message)
|
|
135
136
|
end
|
|
136
137
|
|
|
@@ -154,6 +155,8 @@ module PackageCloud
|
|
|
154
155
|
elsif JAVA_EXTS.include?(exts.first.downcase)
|
|
155
156
|
abort_if_snapshot!(package_files)
|
|
156
157
|
dist_id = validator.distribution_id(repo, package_files, 'jar')
|
|
158
|
+
elsif AMBIGUOUS_EXTS.include?(exts.first.downcase)
|
|
159
|
+
dist_id = validator.distribution_id_from_repo_url(repo, package_files)
|
|
157
160
|
else
|
|
158
161
|
dist_id = validator.distribution_id(repo, package_files, exts.first)
|
|
159
162
|
end
|
|
@@ -199,17 +202,6 @@ module PackageCloud
|
|
|
199
202
|
end
|
|
200
203
|
|
|
201
204
|
private
|
|
202
|
-
def handle_special_exts(repo, exts)
|
|
203
|
-
exts.map do |elem|
|
|
204
|
-
case elem
|
|
205
|
-
when 'apk'
|
|
206
|
-
elem = repo.include?("alpine") ? "alpine" : elem
|
|
207
|
-
else
|
|
208
|
-
elem
|
|
209
|
-
end
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
|
|
213
205
|
def expand_dist_shortcut(dist)
|
|
214
206
|
case dist
|
|
215
207
|
when 'java'
|
|
@@ -4,6 +4,19 @@ module PackageCloud
|
|
|
4
4
|
@client = client
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
+
def distribution_id_from_repo_url(repo, filenames)
|
|
8
|
+
_,_,dist_sel,ver_sel = repo.split("/")
|
|
9
|
+
package_type = dist_sel
|
|
10
|
+
puts "ambiguous extensions, so using repo url to deduce package_type, package_type: #{package_type}".color(:red)
|
|
11
|
+
|
|
12
|
+
# NOTE: The distributions pulled from API uses "py" (package_type) as key for "python"
|
|
13
|
+
# so we need to map "python" to "py"
|
|
14
|
+
# See PackageCloud::Validator#distributions
|
|
15
|
+
package_type = package_type == "python" ? "py": package_type
|
|
16
|
+
|
|
17
|
+
distribution_id(repo, filenames, package_type)
|
|
18
|
+
end
|
|
19
|
+
|
|
7
20
|
def distribution_id(repo, filenames, package_type)
|
|
8
21
|
if distributions[package_type]
|
|
9
22
|
_,_,dist_sel,ver_sel = repo.split("/")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: package_cloud
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joe Damato
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|