prm 0.0.2 → 0.0.3
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/prm.rb +2 -0
- data/prm/repo.rb +14 -2
- metadata +3 -3
data/prm.rb
CHANGED
@@ -12,6 +12,7 @@ opts = Trollop::options do
|
|
12
12
|
opt :component, "Component name for repository (Multi component supported by comma)", :type => :string, :required => :true, :short => "-c"
|
13
13
|
opt :release, "Release name for repository (Multi release supported by comma)", :type => :string, :required => true, :short => "-r"
|
14
14
|
opt :arch, "Architecture for repository (Multi arch supported by comma)", :type => :string, :require => true, :short => "-a"
|
15
|
+
opt :gpg, "Sign release files with a GPG key (Expects GPG key to be available)", :default => false
|
15
16
|
opt :generate, "Create new repository", :short => "-g"
|
16
17
|
end
|
17
18
|
|
@@ -24,6 +25,7 @@ r.release = opts[:release]
|
|
24
25
|
r.arch = opts[:arch]
|
25
26
|
r.type = opts[:type]
|
26
27
|
r.path = opts[:path]
|
28
|
+
r.gpg = opts[:gpg]
|
27
29
|
|
28
30
|
if opts[:generate]
|
29
31
|
r.create
|
data/prm/repo.rb
CHANGED
@@ -6,7 +6,7 @@ require 'peach'
|
|
6
6
|
require 'erb'
|
7
7
|
|
8
8
|
module Debian
|
9
|
-
def build_apt_repo(path, component, arch, release)
|
9
|
+
def build_apt_repo(path, component, arch, release, gpg)
|
10
10
|
release.each { |r|
|
11
11
|
component.each { |c|
|
12
12
|
arch.each { |a|
|
@@ -23,6 +23,10 @@ module Debian
|
|
23
23
|
}
|
24
24
|
}
|
25
25
|
generate_release(path,r,component,arch)
|
26
|
+
|
27
|
+
if gpg == true
|
28
|
+
generate_release_gpg(path,r)
|
29
|
+
end
|
26
30
|
}
|
27
31
|
end
|
28
32
|
|
@@ -111,6 +115,13 @@ module Debian
|
|
111
115
|
release_file.puts erb
|
112
116
|
release_file.close
|
113
117
|
end
|
118
|
+
|
119
|
+
# We expect that GPG is installed and a key has already been made
|
120
|
+
def generate_release_gpg(path,release)
|
121
|
+
Dir.chdir("#{path}/dists/#{release}") do
|
122
|
+
system "gpg --yes --output Release.gpg -ba Release"
|
123
|
+
end
|
124
|
+
end
|
114
125
|
end
|
115
126
|
|
116
127
|
class PRM
|
@@ -122,12 +133,13 @@ class PRM
|
|
122
133
|
attr_accessor :component
|
123
134
|
attr_accessor :arch
|
124
135
|
attr_accessor :release
|
136
|
+
attr_accessor :gpg
|
125
137
|
|
126
138
|
def create
|
127
139
|
parch,pcomponent,prelease = _parse_vars(arch,component,release)
|
128
140
|
|
129
141
|
if "#{@type}" == "deb"
|
130
|
-
build_apt_repo(path,pcomponent,parch,prelease)
|
142
|
+
build_apt_repo(path,pcomponent,parch,prelease,gpg)
|
131
143
|
elsif "#{@type}" == "rpm"
|
132
144
|
# add rpm stuff here
|
133
145
|
end
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brett Gailey
|