[SCM] ci-tooling packaging branch, master, updated. 98c8bd0b3b72af08e3191b4b3ca02693f3db41ea
Rohan Garg
rohangarg-guest at moszumanska.debian.org
Wed Dec 17 18:18:42 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=98c8bd0
The following commit has been merged in the master branch:
commit 98c8bd0b3b72af08e3191b4b3ca02693f3db41ea
Author: Rohan Garg <rohan at kde.org>
Date: Wed Dec 17 19:18:31 2014 +0100
Add extra repo logic in source builds too
---
dci/source.rb | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dci/source.rb b/dci/source.rb
index 36ec8ac..660b22d 100644
--- a/dci/source.rb
+++ b/dci/source.rb
@@ -1,12 +1,26 @@
require 'date'
require 'fileutils'
require 'logger'
+require 'optparse'
+require 'json'
require_relative '../lib/debian/changelog'
require_relative '../lib/debian/control'
raise "No workspace dir defined!" unless ARGV[1]
raise "No release defined!" unless ARGV[2]
+options = {}
+OptionParser.new do | opts |
+ opts.banner = "Usage: dci.rb build -c repo1,repo2 file.changes"
+ opts.on('-r r1,r2,r3', '--repos REPOS', Array, 'Comma separated repositories to add to the schroot before build') do |repos|
+ options[:repos] ||= repos
+ end
+
+ opts.on('-w dir', '--workspace dir', 'Workspace dir to find repository mappings') do |dir|
+ options[:workspace] ||= dir
+ end
+end.parse!
+
$logger = Logger.new(STDOUT)
def run_cmd(cmd)
@@ -26,6 +40,22 @@ def run_cmd(cmd)
end
end
+logger.info("Adding custom repos #{options[:list]}")
+if !options[:repos].nil?
+ File.delete('/etc/apt/sources.list.d/extra_repos.list') if File.exist?('/etc/apt/sources.list.d/extra_repos.list')
+
+ Dir.chdir(options[:workspace]) do
+ EXTRA_REPOS = 'extra_repos.json'
+ if File.exists? EXTRA_REPOS
+ extra_repos = JSON::parse(File.read(EXTRA_REPOS))
+ options[:repos].each do |repo|
+ system("echo '#{repo['url']} #{package_release} main' >> /etc/apt/sources.list.d/extra_repos.list")
+ system("echo '#{repo['key']}' | apt-key add -")
+ end
+ end
+ end
+end
+
# These should never fail
run_cmd('apt-get update && apt-get -y dist-upgrade')
run_cmd('apt-get -y install devscripts lsb-release locales')
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list