dr 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dr +28 -3
- data/dr.spec +5 -5
- data/lib/dr/gitpackage.rb +5 -2
- data/lib/dr/logger.rb +37 -12
- data/lib/dr/version.rb +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba4035bfe641151aba4792cf6ebedbc80d1fd2e6
|
4
|
+
data.tar.gz: 715befd405538961117520a551330201fb57c22b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcc322d82a50e31a7c230fc5f7bf9ec66beb1206f4a8c79bd4a427a3a2b931f32ff14183a37f71bfad47d5cd5025ed3759bb0726fbd85ba5cffb43c547301dfb
|
7
|
+
data.tar.gz: e2b1950538b9f104945f86efcaa55a471a2fbbabca3cc8c1f76b27e5e61c5037f7a99e6d6cd63a6951d9c225d2d4723e551fa64a17deb1e5138916da3f940ace
|
data/bin/dr
CHANGED
@@ -17,10 +17,18 @@ require "dr/shellcmd"
|
|
17
17
|
require "dr/logger"
|
18
18
|
require "dr/config"
|
19
19
|
|
20
|
+
|
20
21
|
class ExtendedThor < Thor
|
21
22
|
private
|
22
23
|
include Dr::Logger
|
23
24
|
|
25
|
+
|
26
|
+
def initialize(*args)
|
27
|
+
super
|
28
|
+
Dr::Logger::set_verbosity options[:verbosity]
|
29
|
+
end
|
30
|
+
|
31
|
+
|
24
32
|
def get_repo_handle
|
25
33
|
if options.has_key? "repo"
|
26
34
|
Dr::Repo.new options["repo"]
|
@@ -35,6 +43,7 @@ class ExtendedThor < Thor
|
|
35
43
|
end
|
36
44
|
end
|
37
45
|
|
46
|
+
|
38
47
|
class Archive < ExtendedThor
|
39
48
|
#desc "save TAG", "make a snapshot of the current archive"
|
40
49
|
#def save(tag)
|
@@ -50,6 +59,7 @@ class Archive < ExtendedThor
|
|
50
59
|
#end
|
51
60
|
end
|
52
61
|
|
62
|
+
|
53
63
|
class List < ExtendedThor
|
54
64
|
desc "packages", "Show a list of source packages in the repo"
|
55
65
|
def packages()
|
@@ -61,6 +71,7 @@ class List < ExtendedThor
|
|
61
71
|
end
|
62
72
|
end
|
63
73
|
|
74
|
+
|
64
75
|
desc "versions PACKAGE", "Show the history of all available versions for a package"
|
65
76
|
def versions(pkg_name)
|
66
77
|
repo = get_repo_handle
|
@@ -82,7 +93,7 @@ class List < ExtendedThor
|
|
82
93
|
line << " " + open + metadata["branch"].fg("blue") + close
|
83
94
|
end
|
84
95
|
|
85
|
-
subpkgs = debs.map { |p|
|
96
|
+
subpkgs = debs.map { |p| File.basename(p).split("_")[0] }
|
86
97
|
end
|
87
98
|
|
88
99
|
open = "[".fg "dark-grey"
|
@@ -120,6 +131,7 @@ class List < ExtendedThor
|
|
120
131
|
end
|
121
132
|
end
|
122
133
|
|
134
|
+
|
123
135
|
desc "suite SUITE", "Show the names and versions of packages in the suite"
|
124
136
|
def suite(suite)
|
125
137
|
repo = get_repo_handle
|
@@ -150,8 +162,11 @@ class List < ExtendedThor
|
|
150
162
|
end
|
151
163
|
end
|
152
164
|
|
165
|
+
|
153
166
|
class RepoCLI < ExtendedThor
|
154
167
|
class_option :repo, :type => :string, :aliases => "-r"
|
168
|
+
class_option :verbosity, :type => :string, :aliases => "-v", :default => "verbose"
|
169
|
+
|
155
170
|
|
156
171
|
desc "init [LOCATION]", "setup a whole new repository from scratch"
|
157
172
|
def init(location=".")
|
@@ -176,7 +191,7 @@ class RepoCLI < ExtendedThor
|
|
176
191
|
distro_map = {}
|
177
192
|
puts " Distribution [pick one]: "
|
178
193
|
Dr::config.distros.each_with_index do |distro, index|
|
179
|
-
distro_name
|
194
|
+
distro_name = distro[0]
|
180
195
|
distro_map[index+1] = distro_name
|
181
196
|
|
182
197
|
distro_name = distro_name.fg "yellow" if distro_name == repo_conf[:distro]
|
@@ -215,7 +230,7 @@ class RepoCLI < ExtendedThor
|
|
215
230
|
end
|
216
231
|
|
217
232
|
components = ask " Components [#{repo_conf[:components].join(" ").fg("yellow")}]:"
|
218
|
-
repo_conf[:components] = components.split
|
233
|
+
repo_conf[:components] = components.split(/\s+/) if components.length > 0
|
219
234
|
|
220
235
|
repo_conf[:gpg_name] = ""
|
221
236
|
while repo_conf[:gpg_name].length == 0
|
@@ -242,6 +257,7 @@ class RepoCLI < ExtendedThor
|
|
242
257
|
r.setup repo_conf
|
243
258
|
end
|
244
259
|
|
260
|
+
|
245
261
|
desc "add", "introduce a new package to the build system"
|
246
262
|
method_option :git, :aliases => "-g",
|
247
263
|
:desc => "Add source package managed in a git repo"
|
@@ -267,6 +283,7 @@ class RepoCLI < ExtendedThor
|
|
267
283
|
end
|
268
284
|
end
|
269
285
|
|
286
|
+
|
270
287
|
desc "build [pkg-name]", "build a package from the sources"
|
271
288
|
method_option :branch, :aliases => "-b", :type => :string,
|
272
289
|
:desc => "build from a different branch"
|
@@ -300,6 +317,7 @@ class RepoCLI < ExtendedThor
|
|
300
317
|
end
|
301
318
|
end
|
302
319
|
|
320
|
+
|
303
321
|
desc "push [pkg-name]", "push a built package to a specified suite"
|
304
322
|
method_option :suite, :aliases => "-s", :type => :string,
|
305
323
|
:desc => "the target suite (defaults to testing)"
|
@@ -319,12 +337,14 @@ class RepoCLI < ExtendedThor
|
|
319
337
|
repo.push pkg_name, version, suite, options["force"] == true
|
320
338
|
end
|
321
339
|
|
340
|
+
|
322
341
|
desc "unpush [pkg-name] [suite]", "remove a built package from a suite"
|
323
342
|
def unpush(pkg_name, suite)
|
324
343
|
repo = get_repo_handle
|
325
344
|
repo.unpush pkg_name, suite
|
326
345
|
end
|
327
346
|
|
347
|
+
|
328
348
|
desc "list SUBCOMMAND [ARGS]", "show information about packages"
|
329
349
|
map "l" => :list, "ls" => :list
|
330
350
|
subcommand "list", List
|
@@ -337,6 +357,7 @@ class RepoCLI < ExtendedThor
|
|
337
357
|
repo.remove pkg_name, options["force"] == true
|
338
358
|
end
|
339
359
|
|
360
|
+
|
340
361
|
desc "rmbuild [pkg-name] [version]", "remove a built version of a package"
|
341
362
|
method_option :force, :aliases => "-f", :type => :boolean,
|
342
363
|
:desc => "force removal even if the build is still used"
|
@@ -376,6 +397,7 @@ class RepoCLI < ExtendedThor
|
|
376
397
|
log :info, "Updated #{updated.to_s.fg "blue"} packages in #{suite.fg "blue"}"
|
377
398
|
end
|
378
399
|
|
400
|
+
|
379
401
|
desc "git-tag-release", "Mark relased packages' repositories"
|
380
402
|
method_option :force, :aliases => "-f", :type => :boolean,
|
381
403
|
:desc => "Force override existing tags"
|
@@ -410,6 +432,7 @@ class RepoCLI < ExtendedThor
|
|
410
432
|
end
|
411
433
|
end
|
412
434
|
|
435
|
+
|
413
436
|
desc "release", "Push all the packages from testing to release"
|
414
437
|
method_option :force, :aliases => "-f", :type => :boolean,
|
415
438
|
:desc => "Force-push all released packages"
|
@@ -434,6 +457,7 @@ class RepoCLI < ExtendedThor
|
|
434
457
|
end
|
435
458
|
end
|
436
459
|
|
460
|
+
|
437
461
|
desc "force-sync", "Force cloning the sources repository from scratch again"
|
438
462
|
def force_sync(pkg_name)
|
439
463
|
repo = get_repo_handle
|
@@ -458,6 +482,7 @@ class RepoCLI < ExtendedThor
|
|
458
482
|
end
|
459
483
|
end
|
460
484
|
|
485
|
+
|
461
486
|
begin
|
462
487
|
Dr::check_dependencies [
|
463
488
|
"git", "reprepro", "gzip", "debuild", "debootstrap", "qemu-*-static",
|
data/dr.spec
CHANGED
@@ -25,11 +25,11 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
|
-
spec.add_dependency "thor", "~> 0.18
|
29
|
-
spec.add_dependency "tco", "~> 0.
|
30
|
-
spec.add_dependency "octokit"
|
28
|
+
spec.add_dependency "thor", "~> 0.18"
|
29
|
+
spec.add_dependency "tco", "~> 0.1"
|
30
|
+
spec.add_dependency "octokit", "~> 3.3"
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.5"
|
33
|
-
spec.add_development_dependency "rake"
|
34
|
-
spec.add_development_dependency "rspec"
|
33
|
+
spec.add_development_dependency "rake", "~> 10.3"
|
34
|
+
spec.add_development_dependency "rspec", "~> 3.1"
|
35
35
|
end
|
data/lib/dr/gitpackage.rb
CHANGED
@@ -185,7 +185,10 @@ module Dr
|
|
185
185
|
FileUtils.cp_r src_dir, build_dir
|
186
186
|
|
187
187
|
# Make orig tarball
|
188
|
-
|
188
|
+
all_files = Dir["#{build_dir}/*"] + Dir["#{build_dir}/.*"]
|
189
|
+
excluded_files = ['.', '..', '.git']
|
190
|
+
selected_files = all_files.select { |path| !excluded_files.include?(File.basename(path)) }
|
191
|
+
files = selected_files.map { |f| "\"#{File.basename f}\"" }.join " "
|
189
192
|
log :info, "Creating orig source tarball"
|
190
193
|
tar = "tar cz -C #{build_dir} --exclude=debian " +
|
191
194
|
"-f #{br}/#{@name}_#{version.upstream}.orig.tar.gz " +
|
@@ -322,7 +325,7 @@ EOS
|
|
322
325
|
def get_repo_url
|
323
326
|
git_cmd = "git --git-dir #{@git_dir} config --get remote.origin.url"
|
324
327
|
git = ShellCmd.new git_cmd, :tag => "git"
|
325
|
-
git.out
|
328
|
+
git.out.strip
|
326
329
|
end
|
327
330
|
|
328
331
|
def get_version(changelog_file)
|
data/lib/dr/logger.rb
CHANGED
@@ -73,30 +73,55 @@ Tco::reconfigure tco_conf
|
|
73
73
|
|
74
74
|
module Dr
|
75
75
|
module Logger
|
76
|
-
@@
|
76
|
+
@@message_types = {
|
77
77
|
:info => "info",
|
78
78
|
:warn => "warn",
|
79
79
|
:err => "err",
|
80
80
|
:debug => "debug"
|
81
81
|
}
|
82
82
|
|
83
|
-
|
83
|
+
@@verbosity = :verbose
|
84
|
+
@@logger_verbosity_levels = {
|
85
|
+
:essential => 0,
|
86
|
+
:important => 1,
|
87
|
+
:informative => 2,
|
88
|
+
:verbose => 3
|
89
|
+
}
|
90
|
+
|
91
|
+
def self.set_verbosity(level)
|
92
|
+
msg = "Message verbosity level not recognised (#{})."
|
93
|
+
raise msg unless @@logger_verbosity_levels.has_key? level.to_sym
|
94
|
+
|
95
|
+
@@verbosity = level.to_sym
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.log(msg_type, msg, verbosity=nil)
|
84
99
|
out = "dr".style("log-head") << " "
|
85
100
|
|
86
|
-
case
|
87
|
-
when :info
|
88
|
-
|
89
|
-
|
90
|
-
when :
|
101
|
+
case msg_type
|
102
|
+
when :info
|
103
|
+
out << "info".style(@@message_types[:info])
|
104
|
+
verbosity = :informative unless verbosity
|
105
|
+
when :warn
|
106
|
+
out << "WARN".style(@@message_types[:warn])
|
107
|
+
verbosity = :informative unless verbosity
|
108
|
+
when :err
|
109
|
+
out << "ERR!".style(@@message_types[:err])
|
110
|
+
verbosity = :essential unless verbosity
|
111
|
+
when :debug
|
112
|
+
out << "dbg?".style(@@message_types[:debug])
|
113
|
+
verbosity = :verbose unless verbosity
|
91
114
|
end
|
92
115
|
|
93
|
-
|
94
|
-
|
95
|
-
|
116
|
+
if verbosity <= @@verbosity
|
117
|
+
out << " " << msg.chomp
|
118
|
+
puts out
|
119
|
+
STDOUT.flush
|
120
|
+
end
|
96
121
|
end
|
97
122
|
|
98
|
-
def log(
|
99
|
-
Logger::log
|
123
|
+
def log(msg_type, msg)
|
124
|
+
Logger::log msg_type, msg
|
100
125
|
end
|
101
126
|
|
102
127
|
def tag(tag, msg)
|
data/lib/dr/version.rb
CHANGED
metadata
CHANGED
@@ -1,99 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Radek Pazdera
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.18
|
19
|
+
version: '0.18'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.18
|
26
|
+
version: '0.18'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tco
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: '0.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: octokit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '10.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '10.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '3.1'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '3.1'
|
97
97
|
description: |-
|
98
98
|
dr works with distribution-level packaging
|
99
99
|
tools and helps you make and distribute your own
|
@@ -107,7 +107,7 @@ executables:
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
-
- .gitignore
|
110
|
+
- ".gitignore"
|
111
111
|
- Gemfile
|
112
112
|
- LICENSE.txt
|
113
113
|
- README.md
|
@@ -138,17 +138,17 @@ require_paths:
|
|
138
138
|
- lib
|
139
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- -
|
141
|
+
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
|
-
- -
|
146
|
+
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.2.2
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: dr stands for debian-repository. It is a packaging tool that helps you make,
|