aptly-watcher 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0075d97cdbdfb1ee8109e056d10b3394d24e1543
4
- data.tar.gz: 10514a3381747764025f9e24aa82d257490315f3
3
+ metadata.gz: 4aad45eba38cd86eeed010e57bf5badec8173f82
4
+ data.tar.gz: f9a3764bd2d38f9e0b3c7ea10329a1f152add3d6
5
5
  SHA512:
6
- metadata.gz: 65e14eac20a518b06f3f503c605554ed89dfa89310626c17cc8590aa3c9ebe3d86b047916996359fae1cf906d99116c1a35a8be4fdff5959e2f249b7e0a64f57
7
- data.tar.gz: 67405c474d1fcb2d3a9fd1ebacde3cf6bf86f7782273d721e0c7bbada222492c6c16e2e0331e4715a71678952a6b2be761e6028f75fce13845d8012c8f168074
6
+ metadata.gz: 11f8130fd522beb170524ced1a20100f1a05fd3f20d51bca24494ac8d3d14378f6fad608b55f6aec9c5896d98b18e7ba646f922df09ae3ab9b6339a44e618a55
7
+ data.tar.gz: f7e3b07cdd5921dfba0dc6aa285370b7e20e8e8417d8549b626af89506edce75c5035633f494008f364b2f3313a15f72085f4665998666ed97636f67fa962df7
@@ -12,16 +12,16 @@ module Aptly
12
12
  def create
13
13
  repo_list = `aptly repo list --raw`
14
14
 
15
+ # create a repo for each component
15
16
  @components.each do |repo|
16
- next if repo_list.include? repo
17
- output = `aptly repo create #{distrib} #{config} #{component(repo)} #{repo}`
17
+ next if repo_list.include? repo # avoid raising an error
18
+ output = `aptly repo create #{distrib} #{config} #{component(repo)} #{repo} 2>&1`
18
19
  raise StandardError, "Failed to create repo #{repo}\n#{output}" unless $?.success?
19
20
  end
20
21
 
21
- published_list = `aptly publish list --raw`
22
-
23
- unless published_list.include? @name
24
- output = `aptly publish repo #{config} #{distrib} #{component(:all)} #{component(:all, ' ')}`
22
+ # publish the repos for the first time (empty)
23
+ unless `aptly publish list --raw`.include? @name # avoid raising an error
24
+ output = `aptly publish repo #{config} #{distrib} #{component(:all)} #{@components.join(' ')} 2>&1`
25
25
  raise StandardError, "Failed to publish #{@name} for the first time\n#{output}" unless $?.success?
26
26
  end
27
27
  end
@@ -30,7 +30,7 @@ module Aptly
30
30
  # TODO: check if the file has already been added
31
31
  # TODO: check that the file is a Debian package
32
32
  output = `aptly repo add -remove-files=true #{config} #{repo} #{path} 2>&1`
33
- raise StandardError, "Failed to add #{path} to #{repo(component)}\n#{output}" unless $?.success?
33
+ raise StandardError, "Failed to add #{path} to #{repo}\n#{output}" unless $?.success?
34
34
  end
35
35
 
36
36
  def publish
@@ -39,8 +39,8 @@ module Aptly
39
39
 
40
40
  private
41
41
 
42
- def component(repo, joiner=',')
43
- repo = @components.join(joiner) if repo == :all
42
+ def component(repo)
43
+ repo = @components.join(',') if repo == :all
44
44
  "-component=#{repo}"
45
45
  end
46
46
 
@@ -1,5 +1,5 @@
1
1
  module Aptly
2
2
  module Watcher
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptly-watcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert McLeod
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.4.2
125
+ rubygems_version: 2.4.8
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Watches folders and adds them to their relative aptly repository