[SCM] ci-tooling packaging branch, master, updated. 7063248ee7f1405760182962dc0df60e90624ea5

Rohan Garg rohangarg-guest at moszumanska.debian.org
Fri Mar 13 15:42:35 UTC 2015


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

The following commit has been merged in the master branch:
commit 7063248ee7f1405760182962dc0df60e90624ea5
Author: Rohan Garg <rohan at garg.io>
Date:   Fri Mar 13 16:42:10 2015 +0100

    Some rubocop fixes, make sure we don't change the constant var
---
 dci/source.rb | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/dci/source.rb b/dci/source.rb
index 6029e38..8117480 100644
--- a/dci/source.rb
+++ b/dci/source.rb
@@ -5,6 +5,7 @@ require 'json'
 require 'tmpdir'
 require_relative '../lib/debian/changelog'
 require_relative '../lib/debian/control'
+require_relative '../lib/debian/source'
 require_relative '../lib/logger'
 require_relative '../lib/dci'
 
@@ -62,7 +63,6 @@ dci_run_cmd('apt-get -y install devscripts lsb-release locales libdistro-info-pe
 
 Dir.chdir(ARGV[1]) do
   # Get source name and what not
-  PACKAGING_DIR = nil
   if File.exist?('source/debian/source/format')
     if File.readlines('source/debian/source/format').contains? 'native'
       PACKAGING_DIR = 'source/'
@@ -73,32 +73,33 @@ Dir.chdir(ARGV[1]) do
     FORMAT = :quilt
   end
 
-  fail 'Source contains packaging but is not a native package' if PACKAGING_DIR.nil?
+  fail 'Source contains packaging but is not a native package' unless defined? PACKAGING_DIR
 
+  cl = nil
   Dir.chdir(PACKAGING_DIR) do
-    $changelog = Changelog.new
-    $control = DebianControl.new
-    $control.parse!
+    cl = Changelog.new
+    c = DebianControl.new
+    c.parse!
     build_depends = []
-    $control.source['build-depends'].each do |dep|
+    c.source['build-depends'].each do |dep|
       build_depends << dep.name
     end
 
-    unless $control.source['build-depends-indep'].nil?
-      $control.source['build-depends-indep'].each do |dep|
+    unless c.source['build-depends-indep'].nil?
+      c.source['build-depends-indep'].each do |dep|
         build_depends << dep.name
       end
     end
 
     system("apt-get -y install #{build_depends.join(' ')}")
-    $logger.fatal("Failed to install build deps!") unless $?.success?
+    $logger.fatal('Failed to install build deps!') unless $?.success?
     exit 1 unless $?.success?
   end
 
-  source_name = $changelog.name
+  source_name = cl.name
   version_suffix = "+git#{DateTime.now.strftime('%Y%m%d.%H%M')}"
-  version = "#{$changelog.version(Changelog::EPOCH | Changelog::BASE)}#{version_suffix}" # <-- needs git version and bzr version possibly
-  tar_version = "#{$changelog.version(Changelog::BASE)}#{version_suffix}"
+  version = "#{cl.version(Changelog::EPOCH | Changelog::BASE)}#{version_suffix}" # <-- needs git version and bzr version possibly
+  tar_version = "#{cl.version(Changelog::BASE)}#{version_suffix}"
   version += '-1'
 
   Dir.chdir('source/') do

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list