[SCM] ci-tooling packaging branch, master, updated. 5351e20cb881d848c51f47b5fe1c300a501169fc
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Tue Jun 30 07:14:34 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=c2b18ec
The following commit has been merged in the master branch:
commit c2b18ec8747afab4080890d517988489788dc6d9
Author: Harald Sitter <sitter at kde.org>
Date: Fri Jun 26 07:11:41 2015 +0200
add a script to copy all armhf packages only
---
kci/ppa_copy_armhf.rb | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/kci/ppa_copy_armhf.rb b/kci/ppa_copy_armhf.rb
new file mode 100755
index 0000000..2087a6e
--- /dev/null
+++ b/kci/ppa_copy_armhf.rb
@@ -0,0 +1,103 @@
+#!/usr/bin/env ruby
+#
+# Copyright (C) 2015 Harald Sitter <sitter at kde.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License or (at your option) version 3 or any later version
+# accepted by the membership of KDE e.V. (or its successor approved
+# by the membership of KDE e.V.), which shall act as a proxy
+# defined in Section 14 of version 3 of the license.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+require 'logger'
+require 'logger/colors'
+require 'optparse'
+require 'thwait'
+
+require_relative 'lib/lp'
+require_relative 'lib/thread_pool'
+
+class PPAString
+ class Error < Exception; end
+ class ParseError < Error; end
+ class PrefixError < ParseError; end
+
+ attr_reader :team
+ attr_reader :name
+
+ def initialize(string)
+ unless string.start_with?('ppa:')
+ fail PrefixError, 'No valid ppa identifier, needs to start with ppa:'
+ end
+ ppa_name = string.split('ppa:').last
+ @team, @name = ppa_name.split('/')
+ end
+end
+
+THREAD_COUNT = 9
+
+options = {}
+OptionParser.new do |opts|
+ opts.banner = "Usage: #{$PROGRAM_NAME} [options] ppa:PPA_IDENTIFIER"
+
+ opts.on('-s SERIES', '--series SERIES',
+ 'Ubuntu series to run on (or nil for all)') do |v|
+ options[:series] = v
+ end
+end.parse!
+
+fail 'Less than two ppa identifier given' if ARGV.size < 2
+fail 'More than two ppa identifier given' if ARGV.size > 2
+origin = PPAString.new(ARGV.shift)
+target = PPAString.new(ARGV.pop)
+
+Launchpad.authenticate
+origin_ppa = Launchpad::Rubber.from_path("~#{origin.team}/+archive/ubuntu/#{origin.name}")
+target_ppa = Launchpad::Rubber.from_path("~#{target.team}/+archive/ubuntu/#{target.name}")
+
+sources = []
+if options[:series]
+ series = Launchpad::Rubber.from_path("ubuntu/#{options[:series]}")
+ sources = origin_ppa.getPublishedSources(status: 'Published', distro_series: series)
+else
+ sources = origin_ppa.getPublishedSources(status: 'Published')
+end
+
+source_queue = Queue.new(sources)
+sources_to_copy_queue = Queue.new
+BlockingThreadPool.run do
+ until source_queue.empty?
+ source = source_queue.pop(true)
+ has_arm = false
+ source.getBuilds.each do |build|
+ has_arm = true and break if build.arch_tag == 'armhf'
+ end
+ next unless has_arm
+
+ sources_to_copy_queue << source
+ end
+end
+
+BlockingThreadPool.run do
+ log = Logger.new(STDOUT)
+ log.level = Logger::INFO
+ log.datetime_format = ''
+ until sources_to_copy_queue.empty?
+ source = sources_to_copy_queue.pop(true)
+ log.info "Copying #{source.source_package_name} to #{target_ppa.name}"
+ target_ppa.copyPackage!(from_archive: origin_ppa,
+ source_name: source.source_package_name,
+ version: source.source_package_version,
+ to_pocket: 'Release',
+ include_binaries: true)
+ end
+end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list