prm 0.0.13 → 0.1.0
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.
- data/bin/prm +5 -1
- data/lib/prm/repo.rb +35 -1
- metadata +75 -62
data/bin/prm
CHANGED
@@ -10,7 +10,7 @@ rescue LoadError
|
|
10
10
|
require 'prm'
|
11
11
|
end
|
12
12
|
|
13
|
-
version_info = "0.0
|
13
|
+
version_info = "0.1.0"
|
14
14
|
|
15
15
|
class Main < Clamp::Command
|
16
16
|
option ["-t", "--type"], "TYPE", "Type of repo to create", :required => true
|
@@ -20,6 +20,7 @@ class Main < Clamp::Command
|
|
20
20
|
option ["-a", "--arch"], "ARCH", "Architecture of repo contents", :required => true
|
21
21
|
option ["--accesskey"], "ACCESS KEY", "DHO/S3 Access Key", :default => false
|
22
22
|
option ["--secretkey"], "SECRET KEY", "DHO/S3 Secret Key", :default => false
|
23
|
+
option ["-s", "--snapshot"], "COMPONENT", "Creates a snapshot of a component", :default => false
|
23
24
|
option ["-k", "--gpg"], :flag, "Sign release files with users GPG key", :default => false
|
24
25
|
option ["-g", "--generate"], :flag , "Generate new repository"
|
25
26
|
|
@@ -39,6 +40,9 @@ class Main < Clamp::Command
|
|
39
40
|
unless secretkey.nil?
|
40
41
|
r.secretkey = secretkey
|
41
42
|
end
|
43
|
+
unless snapshot.nil?
|
44
|
+
r.snapshot = snapshot
|
45
|
+
end
|
42
46
|
|
43
47
|
r.create
|
44
48
|
end
|
data/lib/prm/repo.rb
CHANGED
@@ -137,6 +137,34 @@ module Debian
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
+
module SNAP
|
141
|
+
def snapshot_to(path,component,release,snapname,type)
|
142
|
+
if type != "deb"
|
143
|
+
puts "Only deb supported"
|
144
|
+
return
|
145
|
+
end
|
146
|
+
|
147
|
+
release.each do |r|
|
148
|
+
time = Time.new
|
149
|
+
now = time.strftime("%Y-%m-%d-%H-%M")
|
150
|
+
new_snap = "#{snapname}-#{now}"
|
151
|
+
|
152
|
+
if File.exists?("#{path}/dists/#{r}/#{snapname}")
|
153
|
+
puts "Snapshot target is a filesystem, remove it or rename your snap target"
|
154
|
+
return
|
155
|
+
end
|
156
|
+
|
157
|
+
unless File.exists?("#{path}/dists/#{r}/#{new_snap}/")
|
158
|
+
Dir.mkdir("#{path}/dists/#{r}/#{new_snap}")
|
159
|
+
end
|
160
|
+
|
161
|
+
FileUtils.cp_r(Dir["#{path}/dists/#{r}/#{component}/*"], "#{path}/dists/#{r}/#{new_snap}")
|
162
|
+
FileUtils.ln_s "#{new_snap}", "#{path}/dists/#{r}/#{snapname}", :force => true
|
163
|
+
puts "Created #{snapname} snapshot of #{component}\n"
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
140
168
|
module DHO
|
141
169
|
def sync_to_dho(path, accesskey, secretkey,pcomponent,prelease)
|
142
170
|
component = pcomponent.join
|
@@ -191,6 +219,7 @@ module PRM
|
|
191
219
|
class PRM::Repo
|
192
220
|
include Debian
|
193
221
|
include DHO
|
222
|
+
include SNAP
|
194
223
|
|
195
224
|
attr_accessor :path
|
196
225
|
attr_accessor :type
|
@@ -200,12 +229,17 @@ module PRM
|
|
200
229
|
attr_accessor :gpg
|
201
230
|
attr_accessor :secretkey
|
202
231
|
attr_accessor :accesskey
|
232
|
+
attr_accessor :snapshot
|
203
233
|
|
204
234
|
def create
|
205
235
|
parch,pcomponent,prelease = _parse_vars(arch,component,release)
|
206
236
|
|
207
237
|
if "#{@type}" == "deb"
|
208
|
-
|
238
|
+
if snapshot
|
239
|
+
snapshot_to(path,pcomponent,prelease,snapshot,type)
|
240
|
+
else
|
241
|
+
build_apt_repo(path,pcomponent,parch,prelease,gpg)
|
242
|
+
end
|
209
243
|
elsif "#{@type}" == "sync"
|
210
244
|
sync_to_dho(path, accesskey, secretkey,pcomponent,prelease)
|
211
245
|
elsif "#{@type}" == "rpm"
|
metadata
CHANGED
@@ -1,98 +1,111 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: prm
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Brett Gailey
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-04-26 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: peach
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: aws-s3
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
25
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: aws-s3
|
39
37
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: clamp
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
54
47
|
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: clamp
|
55
51
|
prerelease: false
|
56
|
-
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
53
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
63
|
+
description: PRM (Package Repository Manager) is an Operating System independent Package Repository tool. PRM supports Repository syncing to DreamObjects
|
64
64
|
email: brett.gailey@dreamhost.com
|
65
|
-
executables:
|
65
|
+
executables:
|
66
66
|
- prm
|
67
67
|
extensions: []
|
68
|
+
|
68
69
|
extra_rdoc_files: []
|
69
|
-
|
70
|
+
|
71
|
+
files:
|
70
72
|
- lib/prm/repo.rb
|
71
73
|
- lib/prm.rb
|
72
74
|
- templates/deb_release.erb
|
73
75
|
- bin/prm
|
76
|
+
has_rdoc: true
|
74
77
|
homepage: https://github.com/dnbert/prm
|
75
78
|
licenses: []
|
79
|
+
|
76
80
|
post_install_message:
|
77
81
|
rdoc_options: []
|
78
|
-
|
82
|
+
|
83
|
+
require_paths:
|
79
84
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
86
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
95
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
version: "0"
|
92
103
|
requirements: []
|
104
|
+
|
93
105
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.
|
106
|
+
rubygems_version: 1.3.7
|
95
107
|
signing_key:
|
96
108
|
specification_version: 3
|
97
109
|
summary: Package Repository Manager
|
98
110
|
test_files: []
|
111
|
+
|