[SCM] ci-tooling packaging branch, master, updated. 4cd64936d318d785028be4bf71d83bdf0b73d405

Rohan Garg rohangarg-guest at moszumanska.debian.org
Wed Dec 17 23:04:02 UTC 2014


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=4cd6493

The following commit has been merged in the master branch:
commit 4cd64936d318d785028be4bf71d83bdf0b73d405
Author: Rohan Garg <rohan at kde.org>
Date:   Thu Dec 18 00:03:35 2014 +0100

    Add workaround for ruby optparsing being shit
---
 dci/build.rb  | 8 +++++---
 dci/source.rb | 5 ++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dci/build.rb b/dci/build.rb
index f950221..2325a21 100644
--- a/dci/build.rb
+++ b/dci/build.rb
@@ -15,11 +15,11 @@ 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
+      options[:repos] = repos
     end
 
     opts.on('-w dir', '--workspace dir', 'Workspace dir to find repository mappings') do |dir|
-        options[:workspace] ||= dir
+        options[:workspace] = dir
     end
 end.parse!
 
@@ -36,7 +36,9 @@ else
 
     logger.info("Starting build for #{package_name}")
     logger.info("Adding custom repos #{options[:list]}")
-    if !options[:repos].nil?
+    # Skip if there is only one repo in the options, since thats the 'default' config
+    # FIXME: This is a workaround till I figure out how to make ruby parse empty values for options
+    if !options[:repos].nil? && options[:repos].count > 1
         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
diff --git a/dci/source.rb b/dci/source.rb
index 1826dc0..d395b6f 100644
--- a/dci/source.rb
+++ b/dci/source.rb
@@ -49,7 +49,10 @@ def run_cmd(cmd)
 end
 
 $logger.info("Adding custom repos #{options[:repos]}")
-if !options[:repos].nil? && !options[:repos].empty?
+
+# Skip if there is only one repo in the options, since thats the 'default' config
+# FIXME: This is a workaround till I figure out how to make ruby parse empty values for options
+if !options[:repos].nil? && options[:repos].count > 1
     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

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list