prm 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/prm +0 -2
  2. data/lib/prm/repo.rb +22 -31
  3. metadata +4 -4
data/bin/prm CHANGED
@@ -10,8 +10,6 @@ rescue LoadError
10
10
  require 'prm'
11
11
  end
12
12
 
13
- version_info = "0.1.5"
14
-
15
13
  class Main < Clamp::Command
16
14
  option ["-t", "--type"], "TYPE", "Type of repo to create", :required => true
17
15
  option ["-p", "--path"], "PATH", "Path to repo location", :required => true
@@ -278,17 +278,15 @@ module Debian
278
278
  release_info = Hash.new()
279
279
  unreasonable_array = Array.new
280
280
  unreasonable_array = ["Packages", "Packages.gz", "Release"]
281
-
282
- component.clear
283
-
281
+ component_ar = Array.new
284
282
  Dir.glob(path + "/dists/" + release + "/*").select { |f|
285
283
  f.slice!(path + "/dists/" + release + "/")
286
284
  unless f == "Release" or f == "Release.gpg"
287
- component << f
285
+ component_ar << f
288
286
  end
289
287
  }
290
288
 
291
- component.each do |c|
289
+ component_ar.each do |c|
292
290
  arch.each do |ar|
293
291
  unreasonable_array.each do |unr|
294
292
  tmp_path = "#{path}/dists/#{release}/#{c}/binary-#{ar}"
@@ -355,13 +353,10 @@ module SNAP
355
353
  Dir.mkdir("#{path}/dists/#{r}/#{new_snap}")
356
354
  end
357
355
 
358
- if File.exists?("#{path}/dists/#{r}/#{snapname}")
359
- FileUtils.rm("#{path}/dists/#{r}/#{snapname}")
360
- end
361
-
362
356
  if recent
363
357
  component.each do |c|
364
- arch.each do |a|
358
+ arch_ar = arch.split(",")
359
+ arch_ar.each do |a|
365
360
  source_dir = "#{path}/dists/#{r}/#{c}/binary-#{a}"
366
361
  target_dir = "#{path}/dists/#{r}/#{new_snap}/binary-#{a}"
367
362
  pfiles = Dir.glob("#{source_dir}/*").sort_by { |f| File.mtime(f) }
@@ -394,21 +389,17 @@ module SNAP
394
389
  end
395
390
 
396
391
  end
397
-
398
- FileUtils.ln_s "#{new_snap}", "#{path}/dists/#{r}/#{snapname}", :force => true
399
- puts "Created #{snapname} snapshot of #{component} with --recent flag\n"
400
- self.component = snapshot
401
- self.snapshot = false
402
- self.create
403
392
  end
404
393
  else
405
- FileUtils.cp_r(Dir["#{path}/dists/#{r}/#{component}/*"], "#{path}/dists/#{r}/#{new_snap}")
406
- if File.exists?("#{path}/dists/#{r}/#{snapname}")
407
- FileUtils.rm("#{path}/dists/#{r}/#{snapname}")
408
- end
409
- FileUtils.ln_s "#{new_snap}", "#{path}/dists/#{r}/#{snapname}", :force => true
410
- puts "Created #{snapname} snapshot of #{component}\n"
394
+ FileUtils.cp_r(Dir["#{path}/dists/#{r}/#{component}/*"], "#{path}/dists/#{r}/#{new_snap}")
395
+ end
396
+
397
+ if File.exists?("#{path}/dists/#{r}/#{snapname}")
398
+ FileUtils.rm("#{path}/dists/#{r}/#{snapname}")
411
399
  end
400
+
401
+ FileUtils.ln_s "#{new_snap}", "#{path}/dists/#{r}/#{snapname}", :force => true
402
+ puts "Created #{snapname} snapshot of #{component}\n"
412
403
  end
413
404
  end
414
405
  end
@@ -487,17 +478,17 @@ module PRM
487
478
  parch,pcomponent,prelease = _parse_vars(arch,component,release)
488
479
  if snapshot
489
480
  snapshot_to(path,pcomponent,prelease,snapshot,type,recent)
490
- else
491
- if directory
492
- silent = true
493
- build_apt_repo(path,pcomponent,parch,prelease,gpg,silent)
494
- if move_packages(path,pcomponent,parch,prelease,directory) == false
495
- return
496
- end
497
- end
498
- silent = false
481
+ pcomponent = snapshot
482
+ end
483
+ if directory
484
+ silent = true
499
485
  build_apt_repo(path,pcomponent,parch,prelease,gpg,silent)
486
+ if move_packages(path,pcomponent,parch,prelease,directory) == false
487
+ return
488
+ end
500
489
  end
490
+ silent = false
491
+ build_apt_repo(path,pcomponent,parch,prelease,gpg,silent)
501
492
  elsif "#{@type}" == "sync"
502
493
  sync_to_dho(path, accesskey, secretkey,pcomponent,prelease)
503
494
  elsif "#{@type}" == "rpm"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brett Gailey
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-07-18 00:00:00 -07:00
18
+ date: 2013-07-19 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency