pjam 0.0.3.pre → 0.0.4.pre

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.
Files changed (2) hide show
  1. data/bin/pjam +27 -25
  2. metadata +1 -1
data/bin/pjam CHANGED
@@ -18,7 +18,7 @@ where [options] are:
18
18
  EOS
19
19
 
20
20
  opt :p, "path to project", :type => :string
21
- opt :fast, "run is fast mode, skip some build steps", :default => false
21
+ opt :skip_pinto, "skipp adding distos to pinto", :default => false
22
22
  opt :only, "only build this projects", :type => :string, :default => nil
23
23
  end
24
24
 
@@ -42,49 +42,51 @@ else
42
42
  sources_list = config['sources'].select {|i| p_only.include? i }
43
43
  end
44
44
 
45
- sources_list.each do |src|
45
+ compile_list = []
46
+ compile_list_pp = {}
46
47
 
48
+ sources_list.each do |src|
47
49
 
48
- cmd = "cd #{project_id}/#{src} && rm -rf cpanlib && svn up"
50
+ cmd = "cd #{project_id}/#{src} && rm -rf cpanlib && svn up -q"
49
51
  st = system(cmd) == true or raise "failed do cmd: #{cmd}"
50
52
 
51
-
52
- cmd = "cd #{project_id}/#{src} && rm -rf *.gz && rm -rf MANIFEST && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null"
53
+ cmd = "cd #{project_id}/#{src} && rm -rf *.gz && rm -rf MANIFEST && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build realclean && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null"
53
54
  system(cmd) == true or raise "failed do cmd: #{cmd}"
54
55
 
55
- # cmd ="cd #{project_id}/#{src}/ && pinto list -s #{config['stack']} -D `ls *.gz` --format %f | grep `ls *.gz` -q"
56
- # distro_exists = system(cmd)
56
+ distro_name = `cd #{project_id}/#{src} && ls *.gz`.chomp!
57
57
 
58
- distro_exists = true
59
- if distro_exists == false
60
- puts dark { blue { bold { "add #{src} to pinto for the first time" } } }
61
- cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v `ls *.gz`"
62
- system(cmd) == true or raise "failed do cmd: #{cmd}"
63
- elsif distro_exists == true && opts[:fast] == false
58
+ if opts[:skip_pinto] == true
64
59
 
65
- puts dark { magenta { bold { "delete #{src} from pinto" } } }
66
- cmd ="cd #{project_id}/#{src}/ && pinto delete -v PINTO/`ls *.gz`"
67
- system(cmd) == true # or raise "failed do cmd: #{cmd}"
60
+ compile_list << distro_name
61
+ compile_list_pp[distro_name] = src
68
62
 
69
- puts dark { blue { bold { "add #{src} to pinto" } } }
70
- cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v `ls *.gz`"
71
- system(cmd) == true or raise "failed do cmd: #{cmd}"
72
- end
63
+ else
73
64
 
65
+ puts dark { magenta { bold { "add #{src} [#{distro_name}] to pinto" } } }
66
+
67
+ cmd ="cd #{project_id}/#{src} && pinto delete -v PINTO/#{distro_name}"
68
+ system(cmd) == true
74
69
 
70
+ cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v #{distro_name}"
71
+ system(cmd) == true or raise "failed do cmd: #{cmd}"
72
+
73
+ compile_list << distro_name
74
+ compile_list_pp[distro_name] = src
75
+
76
+ end
77
+
75
78
  end
76
79
 
77
80
 
78
- config['sources'].each do |src|
79
- puts blue { bold { "compile #{src}" } }
80
- cmd = "cd #{project_id}/#{src} && export PERL5LIB=/usr/local/rle/lib/perl5 && pinto install -s #{config['stack']} -L #{local_lib} -o 'q' PINTO/`ls *.gz`"
81
- puts cmd
81
+ compile_list.each do |d|
82
+ puts green { bold { "compile #{compile_list_pp[d]} [#{d}]" } }
83
+ cmd = "pinto install -s #{config['stack']} -l #{local_lib} -o 'q' PINTO/#{d}"
82
84
  system(cmd) == true or raise "failed do cmd: #{cmd}"
83
85
  end
84
86
 
85
87
 
86
88
  puts yellow { bold { "make distributive from #{config['application']}" } }
87
- cmd = "eval $(perl -Mlocal::lib=#{local_lib}) && cd #{project_id}/#{config['application']} && rm -rf cpanlib && mkdir cpanlib/ && cp -r #{local_lib}/* cpanlib/ && rm -rf *.gz && ./Build realclean --quiet 1>/dev/null && perl Build.PL --quiet 1>/dev/null && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null && ln -fs `ls #{project_id}/#{config['application']}/*.gz` #{project_id}/current.tar.gz && echo -n `ls *.gz` > #{project_id}/current.txt"
89
+ cmd = "cd #{project_id}/#{config['application']} && rm -rf cpanlib && mkdir cpanlib/ && cp -r #{local_lib}/* cpanlib/ && rm -rf *.gz && ./Build realclean --quiet 1>/dev/null && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null && ln -fs `ls #{project_id}/#{config['application']}/*.gz` #{project_id}/current.tar.gz && echo -n `ls *.gz` > #{project_id}/current.txt"
88
90
  system(cmd) == true or raise "failed do cmd: #{cmd}"
89
91
 
90
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pjam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.pre
4
+ version: 0.0.4.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: