prm 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/prm/repo.rb +36 -1
- metadata +5 -5
data/prm/repo.rb
CHANGED
@@ -3,6 +3,7 @@ require 'fileutils'
|
|
3
3
|
require 'zlib'
|
4
4
|
require 'digest/md5'
|
5
5
|
require 'peach'
|
6
|
+
require 'erb'
|
6
7
|
|
7
8
|
module Debian
|
8
9
|
def build_apt_repo(path, component, arch, release)
|
@@ -21,6 +22,7 @@ module Debian
|
|
21
22
|
generate_packages_gz(fpath,pfpath,path,rfpath,r,c,a)
|
22
23
|
}
|
23
24
|
}
|
25
|
+
generate_release(path,r,component,arch)
|
24
26
|
}
|
25
27
|
end
|
26
28
|
|
@@ -74,7 +76,40 @@ module Debian
|
|
74
76
|
Zlib::GzipWriter.open(pfpath + ".gz") do |gz|
|
75
77
|
gz.write data
|
76
78
|
end
|
77
|
-
|
79
|
+
end
|
80
|
+
|
81
|
+
def generate_release(path,release,component,arch)
|
82
|
+
date = Time.now.utc
|
83
|
+
|
84
|
+
release_info = Hash.new()
|
85
|
+
unreasonable_array = Array.new
|
86
|
+
unreasonable_array = ["Packages", "Packages.gz", "Release"]
|
87
|
+
|
88
|
+
|
89
|
+
component.each do |c|
|
90
|
+
arch.each do |ar|
|
91
|
+
unreasonable_array.each do |unr|
|
92
|
+
tmp_path = "#{path}/dists/#{release}/#{c}/binary-#{ar}"
|
93
|
+
tmp_hash = Hash.new
|
94
|
+
filename = "#{c}/binary-#{ar}/#{unr}".chomp
|
95
|
+
|
96
|
+
byte_size = File.size("#{tmp_path}/#{unr}").to_s
|
97
|
+
md5sum = Digest::MD5.file("#{tmp_path}/#{unr}").to_s
|
98
|
+
|
99
|
+
tmp_hash['size'] = byte_size
|
100
|
+
tmp_hash['md5sum'] = md5sum
|
101
|
+
release_info[filename] = tmp_hash
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
erb = ERB.new(File.open('templates/deb_release.erb') { |file|
|
107
|
+
file.read
|
108
|
+
}).result(binding)
|
109
|
+
|
110
|
+
release_file = File.new("#{path}/dists/#{release}/Release","wb")
|
111
|
+
release_file.puts erb
|
112
|
+
release_file.close
|
78
113
|
end
|
79
114
|
end
|
80
115
|
|
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: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
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: 2012-12-
|
18
|
+
date: 2012-12-27 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: "0"
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
|
-
description: PRM (Package Repository Manager) is
|
35
|
+
description: PRM (Package Repository Manager) is an Operating System independent Package Repository tool
|
36
36
|
email: brett.gailey@dreamhost.com
|
37
37
|
executables:
|
38
38
|
- prm
|