autobuild 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autobuild/import/archive.rb +1 -0
- data/lib/autobuild/import/cvs.rb +2 -1
- data/lib/autobuild/import/darcs.rb +2 -1
- data/lib/autobuild/import/git.rb +13 -8
- data/lib/autobuild/import/hg.rb +2 -1
- data/lib/autobuild/import/svn.rb +3 -2
- data/lib/autobuild/importer.rb +10 -4
- data/lib/autobuild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ce3568c8ac2227a5496cedd32858be2b6b9771
|
4
|
+
data.tar.gz: 5ab665b1155ffa2f15490eaeca333a4b82c82e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186dda2d01191d23ca7ab44da613c71f1d772ac27192029691284748044c92d72c41dd5e7e741307f3f1dcb073c68d2975a5bf2f05cfb6d70a237b0920084e7e
|
7
|
+
data.tar.gz: adbc3984308b9a06cd15851859944dd1a2f67ef625a56459f20b2876fcba4e480a9e9af82710e9ebe957fa4da2eb0449ad916de6f57649fefa772a0573ad464b
|
@@ -333,6 +333,7 @@ def update(package, options = Hash.new) # :nodoc:
|
|
333
333
|
if needs_update || archive_changed?(package)
|
334
334
|
checkout(package, allow_interactive: options[:allow_interactive])
|
335
335
|
end
|
336
|
+
(needs_update || archive_changed?(package))
|
336
337
|
rescue OpenURI::HTTPError
|
337
338
|
raise Autobuild::Exception.new(package.name, :import)
|
338
339
|
end
|
data/lib/autobuild/import/cvs.rb
CHANGED
@@ -36,7 +36,7 @@ def modulename; @module end
|
|
36
36
|
def update(package, options = Hash.new) # :nodoc:
|
37
37
|
if options[:only_local]
|
38
38
|
package.warn "%s: the CVS importer does not support local updates, skipping"
|
39
|
-
return
|
39
|
+
return false
|
40
40
|
end
|
41
41
|
|
42
42
|
if !File.exist?("#{package.srcdir}/CVS/Root")
|
@@ -59,6 +59,7 @@ def update(package, options = Hash.new) # :nodoc:
|
|
59
59
|
end
|
60
60
|
package.run(:import, Autobuild.tool(:cvs), 'up', *@options_up,
|
61
61
|
retry: true, working_directory: package.importdir)
|
62
|
+
true # no easy way to check if package was updated, keep previous behavior and consider updated
|
62
63
|
end
|
63
64
|
|
64
65
|
def checkout(package, options = Hash.new) # :nodoc:
|
@@ -25,7 +25,7 @@ def initialize(source, options = {})
|
|
25
25
|
def update(package, options = Hash.new) # :nodoc:
|
26
26
|
if options[:only_local]
|
27
27
|
package.warn "%s: the darcs importer does not support local updates, skipping"
|
28
|
-
return
|
28
|
+
return false
|
29
29
|
end
|
30
30
|
if !File.directory?( File.join(package.srcdir, '_darcs') )
|
31
31
|
raise ConfigException.new(package, 'import'),
|
@@ -34,6 +34,7 @@ def update(package, options = Hash.new) # :nodoc:
|
|
34
34
|
|
35
35
|
package.run(:import, @program,
|
36
36
|
'pull', '--all', "--repodir=#{package.srcdir}", '--set-scripts-executable', @source, *@pull, retry: true)
|
37
|
+
true # no easy to know if package was updated, keep previous behavior
|
37
38
|
end
|
38
39
|
|
39
40
|
def checkout(package, options = Hash.new) # :nodoc:
|
data/lib/autobuild/import/git.rb
CHANGED
@@ -926,7 +926,7 @@ def reset_head_to_commit(package, target_commit, fetch_commit, options = Hash.ne
|
|
926
926
|
status_to_target = head_to_target.status
|
927
927
|
|
928
928
|
if status_to_target == Status::UP_TO_DATE
|
929
|
-
return
|
929
|
+
return false
|
930
930
|
elsif status_to_target == Status::SIMPLE_UPDATE
|
931
931
|
run_git(package, 'merge', target_commit)
|
932
932
|
elsif !options[:force]
|
@@ -956,6 +956,7 @@ def reset_head_to_commit(package, target_commit, fetch_commit, options = Hash.ne
|
|
956
956
|
run_git(package, 'checkout', local_branch)
|
957
957
|
raise
|
958
958
|
end
|
959
|
+
true
|
959
960
|
end
|
960
961
|
|
961
962
|
def determine_target_state(package, only_local: false)
|
@@ -1000,7 +1001,7 @@ def update(package, options = Hash.new)
|
|
1000
1001
|
if !has_local_branch?(package)
|
1001
1002
|
package.message "%%s: checking out branch %s" % [local_branch]
|
1002
1003
|
run_git(package, 'checkout', '-b', local_branch, target_commit)
|
1003
|
-
return
|
1004
|
+
return false
|
1004
1005
|
end
|
1005
1006
|
|
1006
1007
|
if !on_local_branch?(package)
|
@@ -1013,26 +1014,29 @@ def update(package, options = Hash.new)
|
|
1013
1014
|
current_head = rev_parse(package, 'HEAD')
|
1014
1015
|
if reset
|
1015
1016
|
if current_head == pinned_state
|
1016
|
-
return
|
1017
|
+
return false
|
1017
1018
|
end
|
1018
1019
|
elsif commit_present_in?(package, pinned_state, current_head)
|
1019
|
-
return
|
1020
|
+
return false
|
1020
1021
|
elsif merge_if_simple(package, pinned_state)
|
1021
|
-
return
|
1022
|
+
return true
|
1022
1023
|
end
|
1023
1024
|
end
|
1024
1025
|
|
1026
|
+
did_update = false
|
1025
1027
|
fetch_commit ||= current_remote_commit(
|
1026
1028
|
package, only_local: only_local, refspec: [remote_branch, tag])
|
1027
1029
|
if reset
|
1028
|
-
reset_head_to_commit(package, target_commit, fetch_commit, force: (reset == :force))
|
1030
|
+
did_update = reset_head_to_commit(package, target_commit, fetch_commit, force: (reset == :force))
|
1029
1031
|
else
|
1030
|
-
merge_if_simple(package, target_commit)
|
1032
|
+
did_update = merge_if_simple(package, target_commit)
|
1031
1033
|
end
|
1032
1034
|
|
1033
1035
|
if with_submodules?
|
1034
1036
|
run_git(package, "submodule", "update", '--init')
|
1037
|
+
did_update = true
|
1035
1038
|
end
|
1039
|
+
did_update
|
1036
1040
|
end
|
1037
1041
|
|
1038
1042
|
# @api private
|
@@ -1043,8 +1047,9 @@ def merge_if_simple(package, target_commit)
|
|
1043
1047
|
raise PackageException.new(package, 'import'), "the local branch '#{local_branch}' and the remote branch #{branch} of #{package.name} have diverged, and I therefore refuse to update automatically. Go into #{package.importdir} and either reset the local branch or merge the remote changes"
|
1044
1048
|
end
|
1045
1049
|
run_git(package, 'merge', target_commit)
|
1046
|
-
true
|
1050
|
+
return true
|
1047
1051
|
end
|
1052
|
+
false
|
1048
1053
|
end
|
1049
1054
|
|
1050
1055
|
def each_alternate_path(package)
|
data/lib/autobuild/import/hg.rb
CHANGED
@@ -52,11 +52,12 @@ def validate_importdir(package)
|
|
52
52
|
def update(package, options = Hash.new)
|
53
53
|
if options[:only_local]
|
54
54
|
package.warn "%s: the Mercurial importer does not support local updates, skipping"
|
55
|
-
return
|
55
|
+
return false
|
56
56
|
end
|
57
57
|
validate_importdir(package)
|
58
58
|
package.run(:import, Autobuild.tool('hg'), 'pull', repository, retry: true, working_directory: package.importdir)
|
59
59
|
package.run(:import, Autobuild.tool('hg'), 'update', branch, working_directory: package.importdir)
|
60
|
+
true # no easy to know if package was updated, keep previous behavior
|
60
61
|
end
|
61
62
|
|
62
63
|
def checkout(package, options = Hash.new)
|
data/lib/autobuild/import/svn.rb
CHANGED
@@ -197,7 +197,7 @@ def svn_info(package)
|
|
197
197
|
def update(package, options = Hash.new) # :nodoc:
|
198
198
|
if options[:only_local]
|
199
199
|
package.warn "%s: the svn importer does not support local updates, skipping"
|
200
|
-
return
|
200
|
+
return false
|
201
201
|
end
|
202
202
|
|
203
203
|
url = svn_url(package)
|
@@ -212,11 +212,12 @@ def update(package, options = Hash.new) # :nodoc:
|
|
212
212
|
elsif revision
|
213
213
|
# Don't update if the current revision is greater-or-equal
|
214
214
|
# than the target revision
|
215
|
-
return
|
215
|
+
return false
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
219
219
|
run_svn(package, 'up', "--non-interactive", *options_up)
|
220
|
+
true
|
220
221
|
end
|
221
222
|
|
222
223
|
def checkout(package, options = Hash.new) # :nodoc:
|
data/lib/autobuild/importer.rb
CHANGED
@@ -301,14 +301,22 @@ def perform_update(package,only_local=false)
|
|
301
301
|
retry_count = 0
|
302
302
|
package.progress_start "updating %s"
|
303
303
|
begin
|
304
|
-
update(package,only_local)
|
304
|
+
did_update = update(package,only_local)
|
305
305
|
execute_post_hooks(package)
|
306
|
+
message = if did_update == false
|
307
|
+
Autobuild.color('already up-to-date', :green)
|
308
|
+
else
|
309
|
+
Autobuild.color('updated', :yellow)
|
310
|
+
end
|
311
|
+
|
306
312
|
rescue Interrupt
|
313
|
+
message = Autobuild.color('interrupted', :red)
|
307
314
|
if last_error
|
308
315
|
raise last_error
|
309
316
|
else raise
|
310
317
|
end
|
311
318
|
rescue ::Exception => original_error
|
319
|
+
message = Autobuild.color('update failed', :red)
|
312
320
|
last_error = original_error
|
313
321
|
# If the package is patched, it might be that the update
|
314
322
|
# failed because we needed to unpatch first. Try it out
|
@@ -336,13 +344,11 @@ def perform_update(package,only_local=false)
|
|
336
344
|
package.message "update failed in #{package.importdir}, retrying (#{retry_count}/#{self.retry_count})"
|
337
345
|
retry
|
338
346
|
ensure
|
339
|
-
package.progress_done "
|
347
|
+
package.progress_done "#{message} %s"
|
340
348
|
end
|
341
349
|
|
342
350
|
patch(package)
|
343
351
|
package.updated = true
|
344
|
-
rescue Interrupt
|
345
|
-
raise
|
346
352
|
rescue Autobuild::Exception => e
|
347
353
|
fallback(e, package, :import, package)
|
348
354
|
end
|
data/lib/autobuild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|