autobuild 1.4.6 → 1.4.7

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.
@@ -1,3 +1,6 @@
1
+ == Version 1.4.7
2
+ * have the git importer update the autobuild remote on update.
3
+
1
4
  == Version 1.4.6
2
5
  * add missing importer/archive.rb file
3
6
 
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.4.6" unless defined? Autobuild::VERSION
2
+ VERSION = "1.4.7" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -84,18 +84,36 @@ module Autobuild
84
84
  def fetch_remote(package)
85
85
  validate_srcdir(package)
86
86
  Dir.chdir(package.srcdir) do
87
- if commit # we are checking out a specific commit. We just call git fetch
88
- Subprocess.run(package, :import, Autobuild.tool('git'), 'fetch', repository)
87
+ # Update the remote definition
88
+ Subprocess.run(package, :import, Autobuild.tool('git'), 'config',
89
+ "--replace-all", "remote.autobuild.url", repository)
90
+ Subprocess.run(package, :import, Autobuild.tool('git'), 'config',
91
+ "--replace-all", "remote.autobuild.fetch", "+refs/heads/*:refs/remotes/autobuild/*")
92
+
93
+ # We are checking out a specific commit. We just call git fetch
94
+ if commit
95
+ Subprocess.run(package, :import, Autobuild.tool('git'), 'fetch', 'autobuild')
89
96
  else
90
97
  Subprocess.run(package, :import, Autobuild.tool('git'), 'fetch', repository, branch || tag)
91
98
  end
92
- if File.readable?( File.join('.git', 'FETCH_HEAD') )
99
+
100
+ # Now get the actual commit ID from the FETCH_HEAD file, and
101
+ # return it
102
+ commit_id = if File.readable?( File.join('.git', 'FETCH_HEAD') )
93
103
  fetch_commit = File.readlines( File.join('.git', 'FETCH_HEAD') ).
94
104
  delete_if { |l| l =~ /not-for-merge/ }
95
105
  if !fetch_commit.empty?
96
106
  fetch_commit.first.split(/\s+/).first
97
107
  end
98
108
  end
109
+
110
+ # Update the remote tag if needs be
111
+ if branch && commit_id
112
+ Subprocess.run(package, :import, Autobuild.tool('git'), 'update-ref',
113
+ "-m", "updated by autobuild", "refs/remotes/autobuild/#{branch}", commit_id)
114
+ end
115
+
116
+ commit_id
99
117
  end
100
118
  end
101
119
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-24 00:00:00 +01:00
12
+ date: 2010-01-08 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 2.3.3
63
+ version: 2.4.0
64
64
  version:
65
65
  description: |-
66
66
  This work is licensed under the GPLv2 license. See License.txt for details