[SCM] ci-tooling packaging branch, master, updated. 8fe5785fd2e67dd6583216e9c0f1d930731cb587

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue May 12 08:29:49 UTC 2015


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

The following commit has been merged in the master branch:
commit 12c255cb57383c249c805f555e670d12220caa32
Author: Harald Sitter <sitter at kde.org>
Date:   Tue May 12 10:23:26 2015 +0200

    port install_check to lib/apt
---
 kci/install_check.rb | 36 ++++++------------------------------
 1 file changed, 6 insertions(+), 30 deletions(-)

diff --git a/kci/install_check.rb b/kci/install_check.rb
index 5c13a28..40155b7 100755
--- a/kci/install_check.rb
+++ b/kci/install_check.rb
@@ -122,35 +122,19 @@ class CiPPA
     LOG.info "Installing PPA #{@type}."
     return false if packages.empty?
     pin!
-    args = []
-    args << 'ubuntu-minimal' << 'upstart'
+    args = %w(ubuntu-minimal)
     args += packages.map { |k, v| "#{k}=#{v}" }
-    apt(:install, args)
+    Apt.install(args)
   end
 
   def purge
     LOG.info "Purging PPA #{@type}."
     return false if packages.empty?
-    apt(:purge, packages.keys)
+    Apt.purge(packages.keys)
   end
 
   private
 
-  def run(cmd, args)
-    LOG.debug "#{cmd} #{args.join(' ')}" if LOG.debug?
-    system(cmd, *args)
-  end
-
-  def apt(cmd, caller_args = [])
-    args = []
-    args << '--force-yes'
-    args << '-y'
-    args << '-o' << 'Debug::pkgProblemResolver=true'
-    args << cmd.to_s
-    args += caller_args
-    run('apt-get', args)
-  end
-
   def pin!
     File.open('/etc/apt/preferences.d/superpin', 'w') do |file|
       file << "Package: *
"
@@ -161,13 +145,9 @@ class CiPPA
 
   def software_properties(cmd)
     to_remove = cmd == :remove
-    install_software_properties
-    args = []
-    args << '-y'
-    args << '-r' if to_remove
-    args << "ppa:kubuntu-ci/#{@type}"
-    run('apt-add-repository', args)
-    updated = apt(:update)
+    repo = Apt::Repository.new("ppa:kubuntu-ci/#{@type}")
+    to_remove ? repo.remove : repo.add
+    updated = Apt.update
     if !updated && !to_remove
       # Updated failed. Rip the PPA out again.
       LOG.error "#{@type} caused an apt update fail, removing it again..."
@@ -175,10 +155,6 @@ class CiPPA
     end
     !to_remove # Return whether or not this ppa is now added.
   end
-
-  def install_software_properties
-    apt(:install, %w(software-properties-common eatmydata)) unless @_installedsp
-  end
 end
 
 def install_fake_pkg(name)

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list