aptly_cli 0.3.3 → 0.3.4
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 +8 -8
- data/bin/aptly-cli +3 -1
- data/lib/aptly_cli/version.rb +1 -1
- data/lib/aptly_load.rb +16 -11
- data/lib/aptly_repo.rb +7 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yzc1NGY3OGE5NjE5Y2YwMWE1YjQ2MTI4NWNlZDllZDQ5ODBkZjRjYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjc5ZjU5ZWU4ZGM5NjlkNmQwMTk3NmQxY2IyNGVmZjY4MDJhNWJhZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWE1NTM2YWNhMTViMzg0YTBhMGM2MGEyNzI2ZjM2NzhmNmY2OGZjMzI3ZDA3
|
10
|
+
MjVhMTJiMzRhZDY4Y2EzYTRlMDBjNjdmNGNkN2ZlNGJlOTdjZjA5YzkzMzNk
|
11
|
+
MmMzY2I5MDk4MDZiODNmOGQ5M2E5NDQ0MzU3NjUxM2UzODM5ZmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDY3MWQ2OWY3NGMzMzg4OGFjMmU5M2ZkOWFiMGE1NzNiMjVjMDExOWRkZWZj
|
14
|
+
OTI4MjQ1OGQwZmE2M2NmYjU1NWFhNGJmNTkzZmM0YzIzMWUzOWY3YzA1ZDJm
|
15
|
+
ZjM2M2Q4NDEyMGM0NTFiYTVmY2MyMGFmMDk3YzE1ODVlYjBkMTc=
|
data/bin/aptly-cli
CHANGED
@@ -18,7 +18,9 @@ $debug = false
|
|
18
18
|
global_option('-c', '--config FILE', 'Path to YAML config file') do |config_file|
|
19
19
|
$config_file = config_file
|
20
20
|
end
|
21
|
-
|
21
|
+
global_option('--no-config', 'Don\'t try to read YAML config file') do |config_file|
|
22
|
+
$config_file = nil
|
23
|
+
end
|
22
24
|
global_option('-s', '--server SERVER', 'Host name or IP address of Aptly API server') do |server|
|
23
25
|
$server = server
|
24
26
|
end
|
data/lib/aptly_cli/version.rb
CHANGED
data/lib/aptly_load.rb
CHANGED
@@ -34,18 +34,23 @@ module AptlyCli
|
|
34
34
|
|
35
35
|
# Configure through yaml file
|
36
36
|
def configure_with(path_to_yaml_file)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
37
|
+
if path_to_yaml_file
|
38
|
+
begin
|
39
|
+
config = YAML.load(IO.read(path_to_yaml_file))
|
40
|
+
rescue Errno::ENOENT
|
41
|
+
@log.warn(
|
42
|
+
"YAML configuration file couldn\'t be found at " \
|
43
|
+
"#{path_to_yaml_file}. Using defaults.")
|
44
|
+
return @config
|
45
|
+
rescue Psych::SyntaxError
|
46
|
+
@log.warn(
|
47
|
+
'YAML configuration file contains invalid syntax. Using defaults.')
|
48
|
+
return @config
|
49
|
+
end
|
50
|
+
else
|
51
|
+
config = {}
|
48
52
|
end
|
53
|
+
|
49
54
|
configure(config)
|
50
55
|
end
|
51
56
|
end
|
data/lib/aptly_repo.rb
CHANGED
@@ -3,6 +3,7 @@ require 'aptly_command'
|
|
3
3
|
require 'aptly_load'
|
4
4
|
require 'httmultiparty'
|
5
5
|
require 'json'
|
6
|
+
require 'uri'
|
6
7
|
|
7
8
|
module AptlyCli
|
8
9
|
# Aptly class to work with Repo API
|
@@ -58,15 +59,12 @@ module AptlyCli
|
|
58
59
|
else
|
59
60
|
uri = '/repos/' + repo_options[:name] + '/packages'
|
60
61
|
end
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
else
|
68
|
-
''
|
69
|
-
end
|
62
|
+
|
63
|
+
qs_hash = {}
|
64
|
+
qs_hash['q'] = repo_options[:query] if repo_options[:query]
|
65
|
+
qs_hash['format'] = repo_options[:format] if repo_options[:format]
|
66
|
+
qs_hash['withDeps'] = 1 if repo_options[:with_deps]
|
67
|
+
uri += '?' + URI.encode_www_form(qs_hash) if qs_hash
|
70
68
|
self.class.get uri
|
71
69
|
end
|
72
70
|
|