dr 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,16 +78,16 @@ module Dr
78
78
  log :info, "Re-downloading the source repository of " +
79
79
  "#{@name.style "pkg-name"}"
80
80
  Dir.mktmpdir do |tmp|
81
- git_cmd = "git clone --mirror --branch #{@default_branch} " +
81
+ git_cmd = "git clone --mirror --branch #{branch} " +
82
82
  "#{git_addr} #{tmp}/git"
83
83
  ShellCmd.new git_cmd, :tag => "git", :show_out => true
84
84
 
85
85
  src_dir = "#{tmp}/src"
86
86
  FileUtils.mkdir_p src_dir
87
87
 
88
- checkout branch, src_dir
88
+ checkout branch, src_dir, "#{tmp}/git"
89
89
 
90
- unless File.exists? "#{tmp}/src/debian/control"
90
+ unless File.exists? "#{src_dir}/debian/control"
91
91
  log :err, "The debian packaging files not found in the repository"
92
92
  raise "Adding a package from #{git_addr} failed"
93
93
  end
@@ -143,6 +143,11 @@ module Dr
143
143
 
144
144
  version = nil
145
145
 
146
+ unless get_rev branch
147
+ log :err, "Branch #{branch.fg "blue"} not found in #{@name.style "pkg-name"}"
148
+ raise "The requested branch doesn't exist in the repository!"
149
+ end
150
+
146
151
  orig_rev, curr_rev = update_from_origin branch
147
152
  log :info, "Branch #{branch.fg "blue"}, revision #{curr_rev[0..7].fg "blue"}"
148
153
  unless force
@@ -205,7 +210,7 @@ module Dr
205
210
  end
206
211
 
207
212
  if repo_arches.length == 0
208
- log :error, "#{@name.style "pkg-name"} cannot be build for any of " +
213
+ log :err, "#{@name.style "pkg-name"} cannot be build for any of " +
209
214
  "the architectures supported by this repository"
210
215
  raise "Unable to build the package for this repository"
211
216
  end
@@ -424,9 +429,9 @@ EOS
424
429
  end
425
430
  end
426
431
 
427
- def checkout(branch, dir)
432
+ def checkout(branch, dir, override_git_dir=@git_dir)
428
433
  log :info, "Extracting the sources"
429
- git_cmd ="git --git-dir #{@git_dir} --bare archive " +
434
+ git_cmd ="git --git-dir #{override_git_dir} --bare archive " +
430
435
  "--format tar #{branch} | tar x -C #{dir}"
431
436
  ShellCmd.new git_cmd, :tag => "git", :show_out => true
432
437
  end
@@ -12,6 +12,9 @@ module Dr
12
12
  @date = 0 # integer
13
13
  @build = 0 # integer
14
14
 
15
+ # Make sure the version is string
16
+ version_string = version_string.to_s
17
+
15
18
  v = version_string.split ":"
16
19
  if v.length > 1
17
20
  @epoch = v[0].to_i
@@ -9,6 +9,7 @@ require "dr/logger"
9
9
  require "dr/gnupg"
10
10
  require "dr/buildroot"
11
11
  require "dr/utils"
12
+ require "dr/pkgversion"
12
13
 
13
14
  require "fileutils"
14
15
  require "yaml"
@@ -251,7 +252,8 @@ module Dr
251
252
 
252
253
  is_of_higher_version = true
253
254
  names.each do |name|
254
- if used_versions.has_key?(name) && version <= used_versions[name]
255
+ if used_versions.has_key?(name) &&
256
+ PkgVersion.new(version) <= PkgVersion.new(used_versions[name])
255
257
  is_of_higher_version = false
256
258
  end
257
259
  end
@@ -2,5 +2,5 @@
2
2
  # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
3
3
 
4
4
  module Dr
5
- VERSION = "1.0.3"
5
+ VERSION = "1.0.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-24 00:00:00.000000000 Z
12
+ date: 2015-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor