autobuild 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02fbd561a58e387234abbd68df3dcc0cfdad031d
4
- data.tar.gz: 4a64a4a2c63cd4d91782577167c92e31f863e14c
3
+ metadata.gz: 22c8d45a3b5f47a9c2e2544358bc594b3eb5dfe2
4
+ data.tar.gz: 5f1ccfc0fe622f6c17ab2eabc0c3d90c258af70d
5
5
  SHA512:
6
- metadata.gz: 843b80f0b1e84fbf70f687ba6ec597bafa249b14b0dba06c4886d8e6b5874f315a3ba4055df40360f6279f6f3c5eaedf8cd662c0778f9e211c25b98acccbb181
7
- data.tar.gz: c018435f7acc876f5c9d0e4e0aa9acbb97c0842d7646eaabf62e64520765bff3e623ccca22a3dbedfb3fb1bc9bf3d9fc25a8c2e0e5c7df9d777816187482e941
6
+ metadata.gz: 549a6b22ef745f3e0927250b7eb983afa681c08198ccf3f7814bc1299be9f5d29060237e43f35bf30f5986b86472fece8df17e0bb9aa2ede01b4837ec6d5a7e9
7
+ data.tar.gz: 2e49c8313b488d6b3f7c8930fccbc2d64df77ba03ed529a1e27ec0e447438fa931103a47d45ff61680bdff62edc78ebce1cdbc5d18db3d8920165846dfb896f5
@@ -284,14 +284,14 @@ class Importer
284
284
  def apply(package, path, patch_level = 0); call_patch(package, false, path, patch_level) end
285
285
  def unapply(package, path, patch_level = 0); call_patch(package, true, path, patch_level) end
286
286
 
287
- def parse_patch_list(package, patches_file)
287
+ def parse_patch_list(patches_file)
288
288
  File.readlines(patches_file).map do |line|
289
289
  line = line.rstrip
290
290
  if line =~ /^(.*)\s+(\d+)$/
291
- path = File.expand_path($1, package.srcdir)
291
+ path = $1
292
292
  level = Integer($2)
293
293
  else
294
- path = File.expand_path(line, package.srcdir)
294
+ path = line
295
295
  level = 0
296
296
  end
297
297
  [path, level, File.read(path)]
@@ -301,12 +301,12 @@ class Importer
301
301
  def currently_applied_patches(package)
302
302
  patches_file = patchlist(package)
303
303
  if File.exists?(patches_file)
304
- return parse_patch_list(package, patches_file)
304
+ return parse_patch_list(patches_file)
305
305
  end
306
306
 
307
307
  patches_file = File.join(package.importdir, "patches-autobuild-stamp")
308
308
  if File.exists?(patches_file)
309
- cur_patches = parse_patch_list(package, patches_file)
309
+ cur_patches = parse_patch_list(patches_file)
310
310
  save_patch_state(package, cur_patches)
311
311
  FileUtils.rm_f patches_file
312
312
  return currently_applied_patches(package)
@@ -319,9 +319,7 @@ class Importer
319
319
  # Get the list of already applied patches
320
320
  cur_patches = currently_applied_patches(package)
321
321
 
322
- cur_patches_state = cur_patches.map { |_, level, content| [level, content] }
323
- patches_state = patches.map { |_, level, content| [level, content] }
324
- if cur_patches_state == patches_state
322
+ if cur_patches.map(&:last) == patches.map(&:last)
325
323
  return false
326
324
  end
327
325
 
@@ -359,18 +357,14 @@ class Importer
359
357
  patch_dir = patchdir(package)
360
358
  FileUtils.mkdir_p patch_dir
361
359
  cur_patches = cur_patches.each_with_index.map do |(path, level, content), idx|
362
- path = File.join(patch_dir, idx.to_s)
363
- File.open(path, 'w') do |patch_io|
364
- patch_io.write content
365
- end
366
- [path, level]
360
+ path = File.join(patch_dir, idx.to_s)
361
+ File.open(path, 'w') do |patch_io|
362
+ patch_io.write content
363
+ end
364
+ [path, level]
367
365
  end
368
366
  File.open(patchlist(package), 'w') do |f|
369
- patch_state = cur_patches.map do |path, level|
370
- path = Pathname.new(path).relative_path_from(package.srcdir).to_s
371
- "#{path} #{level}"
372
- end
373
- f.write(patch_state.join("\n"))
367
+ f.write(cur_patches.map { |p, l| "#{p} #{l}" }.join("\n"))
374
368
  end
375
369
  end
376
370
 
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.8.0" unless defined? Autobuild::VERSION
2
+ VERSION = "1.8.1" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux