Hello community,
here is the log from the commit of package rubygem-yast-rake for
openSUSE:Factory checked in at 2020-05-05 18:53:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-yast-rake (Old)
and /work/SRC/openSUSE:Factory/.rubygem-yast-rake.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-yast-rake"
Tue May 5 18:53:30 2020 rev:31 rq:798707 version:0.2.37
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-yast-rake/rubygem-yast-rake.changes
2019-09-23 13:15:07.457129654 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-yast-rake.new.2738/rubygem-yast-rake.changes
2020-05-05 18:53:31.905172563 +0200
@@ -1,0 +2,11 @@
+Tue Apr 28 15:14:13 UTC 2020 - Dominique Leuenberger <[email protected]>
+
+- Only build gems for the default ruby version (boo#1169445).
+
+-------------------------------------------------------------------
+Wed Feb 5 08:32:16 UTC 2020 - Ladislav Slezák <[email protected]>
+
+- Added "rake server" task (bsc#1162826)
+- 0.2.37
+
+-------------------------------------------------------------------
Old:
----
yast-rake-0.2.36.gem
New:
----
yast-rake-0.2.37.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-yast-rake.spec ++++++
--- /var/tmp/diff_new_pack.xSqe6S/_old 2020-05-05 18:53:32.805174501 +0200
+++ /var/tmp/diff_new_pack.xSqe6S/_new 2020-05-05 18:53:32.809174510 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-yast-rake
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,8 +16,12 @@
#
+# Only build for the default-ruby version
+%define rb_build_versions %{rb_default_ruby}
+%define rb_build_ruby_abis %{rb_default_ruby_abi}
+
Name: rubygem-yast-rake
-Version: 0.2.36
+Version: 0.2.37
Release: 0
%define mod_name yast-rake
%define mod_full_name %{mod_name}-%{version}
@@ -25,7 +29,7 @@
BuildRequires: %{ruby}
BuildRequires: ruby-macros >= 5
BuildRequires: rubygem(%{rb_default_ruby_abi}:gem2rpm)
-Url: http://github.org/openSUSE/yast-rake
+URL: http://github.org/openSUSE/yast-rake
Source: http://rubygems.org/gems/%{mod_full_name}.gem
Summary: Rake tasks providing basic work-flow for Yast development
License: LGPL-2.1-only
++++++ yast-rake-0.2.36.gem -> yast-rake-0.2.37.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2019-09-06 13:27:01.000000000 +0200
+++ new/VERSION 2019-06-27 16:55:34.000000000 +0200
@@ -1 +1 @@
-0.2.36
+0.2.37
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/data/index.html new/data/index.html
--- old/data/index.html 1970-01-01 01:00:00.000000000 +0100
+++ new/data/index.html 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- This is a simple main page for the "rake server" task. -->
+<html>
+<head>
+ <title>Source Code Tarball Server</title>
+</head>
+<body>
+
+<h1>Source Code Tarball Server</h1>
+<p>This server provides dynamically generated source code tarballs.</p>
+
+<h2>Supported URL Paths</h2>
+<p>
+ <ul>
+ <li>
+ <b><a href = "/archive/current.tar.gz">/archive/current.tar.gz</a></b>
+ - dynamically generated tarball with the current source files
+ </li>
+ <li>
+ <b><a href = "/servers/index.json">/servers/index.json</a></b>
+ - index of other running servers on the machine
+ </li>
+ </ul>
+</p>
+
+</body>
+</html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/tasks/server.rake new/lib/tasks/server.rake
--- old/lib/tasks/server.rake 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/tasks/server.rake 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+#--
+# Yast rake
+#
+# Copyright (C) 2020, SUSE LLC
+# This library is free software; you can redistribute it and/or modify
+# it only under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library 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 Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#++
+
+require_relative "../yast/tarball_server"
+
+# Rake task for running a source code web server,
+# designed for the `yupdate` script.
+desc "Start an HTTP server providing dynamically generated source code tarball"
+task :server, [:port] do |_task, args|
+ server = Yast::TarballServer.new(args[:port])
+
+ puts "Starting tarball webserver:"
+ server.addresses.each { |a| puts " * #{a}" }
+ puts
+
+ server.start
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/yast/index_servlet.rb
new/lib/yast/index_servlet.rb
--- old/lib/yast/index_servlet.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/yast/index_servlet.rb 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+#--
+# Yast rake
+#
+# Copyright (C) 2020, SUSE LLC
+# This library is free software; you can redistribute it and/or modify
+# it only under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library 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 Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#++
+
+require "webrick"
+
+module Yast
+ # a webrick servlet which returns a basic HTML info about the server,
+ # just to avoid that nasty 404 error page when someone opens the
+ # server URL in a web browser
+ class IndexServlet < WEBrick::HTTPServlet::AbstractServlet
+ INDEX_FILE = File.expand_path("../../data/index.html", __dir__)
+
+ def do_GET(_request, response)
+ response.status = 200
+ response.content_type = "text/html"
+ response.body = File.read(INDEX_FILE)
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/yast/servers_servlet.rb
new/lib/yast/servers_servlet.rb
--- old/lib/yast/servers_servlet.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/yast/servers_servlet.rb 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,47 @@
+# frozen_string_literal: true
+
+#--
+# Yast rake
+#
+# Copyright (C) 2020, SUSE LLC
+# This library is free software; you can redistribute it and/or modify
+# it only under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library 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 Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#++
+
+require "json"
+require "webrick"
+
+module Yast
+ # a webrick servlet which lists all rake servers running on this machine
+ class ServersServlet < WEBrick::HTTPServlet::AbstractServlet
+ def do_GET(_request, response)
+ response.status = 200
+ response.content_type = "application/json"
+ response.body = servers.to_json
+ end
+
+ private
+
+ # find the locally running "rake server" processes
+ def servers
+ output = `pgrep -a -f "rake server \\([0-9]+,.*\\)"`
+ output.lines.map do |l|
+ l.match(/rake server \(([0-9]+),(.*)\)/)
+ {
+ port: Regexp.last_match[1],
+ dir: Regexp.last_match[2]
+ }
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/yast/tarball_server.rb
new/lib/yast/tarball_server.rb
--- old/lib/yast/tarball_server.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/yast/tarball_server.rb 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,109 @@
+# frozen_string_literal: true
+
+#--
+# Yast rake
+#
+# Copyright (C) 2020, SUSE LLC
+# This library is free software; you can redistribute it and/or modify
+# it only under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library 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 Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#++
+
+require "webrick"
+require "socket"
+
+require_relative "index_servlet"
+require_relative "servers_servlet"
+require_relative "tarball_servlet"
+
+module Yast
+ # a webrick server which provides the source tarballs
+ #
+ # the server handles these URL paths:
+ # - "/archive/current.tar.gz" - the generated source code tarball
+ # - "/servers/index.json" - index of the tarball servers running on this
machine
+ # - "/" - just a simple index page
+ #
+ # to stop the server press Ctrl+C
+ class TarballServer
+ # the default port number
+ DEFAULT_HTTP_PORT = 8000
+
+ attr_reader :port
+
+ # create all URLs valid for this machine, use all network interfaces
+ # (except the loop backs, the server will be used only from outside)
+ # @return [Array<String>] list of URLs
+ def addresses
+ # ignore the loopback addresses
+ hosts = Socket.ip_address_list.reject { |a| a.ipv4_loopback? ||
a.ipv6_loopback? }
+ # IPv6 addresses need to be closed in square brackets in URLs
+ hosts.map! { |a| a.ipv6? ? "[#{a.ip_address}]" : a.ip_address.to_s }
+ # include also the hostname to make it easier to write
+ hostname = Socket.gethostname
+ hosts << hostname if !hostname&.empty?
+ hosts.map! { |h| "http://#{h}:#{port}" }
+ end
+
+ # constructor
+ #
+ # @param port [Integer,nil] the port number, if nil the port will be found
automatically
+ #
+ def initialize(port = nil)
+ @port = port || find_port
+ end
+
+ # start the webserver, it can be closed by pressing Ctrl+C or by sending
SIGTERM signal
+ def start
+ dir = File.basename(Dir.pwd)
+ # change the process title so we can find the running
+ # servers and their ports just by simple grepping the running processes
+ Process.setproctitle("rake server (#{port},#{dir})")
+
+ # Use "*" to bind also the IPv6 addresses
+ server = WEBrick::HTTPServer.new(Port: port, BindAddress: "*")
+ server.mount("/archive/current.tar.gz", TarballServlet)
+ server.mount("/servers/index.json", ServersServlet)
+ server.mount("/", IndexServlet)
+
+ # stop the server when receiving a signal like Ctrl+C
+ # (inspired by the "un.rb" from the Ruby stdlib)
+ signals = ["TERM", "QUIT"]
+ signals.concat(["HUP", "INT"]) if $stdin.tty?
+ signals.each do |s|
+ trap(s) { server.shutdown }
+ end
+
+ server.start
+ end
+
+ private
+
+ # is the local port already taken by some other application?
+ # @param port [Integer] the port number
+ # @return [Boolean] true if the port is taken, false otherwise
+ def port_taken?(port)
+ # open the port and close it immediately, if that succeeds
+ # some other application is already using it
+ TCPSocket.new("localhost", port).close
+ true
+ rescue Errno::ECONNREFUSED
+ false
+ end
+
+ # find a free port starting from the default port number
+ # @return [Integer] the free port number
+ def find_port
+ DEFAULT_HTTP_PORT.step.find { |p| !port_taken?(p) }
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/yast/tarball_servlet.rb
new/lib/yast/tarball_servlet.rb
--- old/lib/yast/tarball_servlet.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/yast/tarball_servlet.rb 2019-06-27 16:55:34.000000000 +0200
@@ -0,0 +1,55 @@
+# frozen_string_literal: true
+
+#--
+# Yast rake
+#
+# Copyright (C) 2020, SUSE LLC
+# This library is free software; you can redistribute it and/or modify
+# it only under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library 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 Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#++
+
+require "webrick"
+
+module Yast
+ # a webrick servlet which dynamically creates a tarball
+ # with the content of the current Git checkout
+ class TarballServlet < WEBrick::HTTPServlet::AbstractServlet
+ def do_GET(_request, response)
+ response.status = 200
+ response.content_type = "application/gzip"
+ response.body = source_archive
+ end
+
+ private
+
+ # compress the current sources into a tarball,
+ # no caching to ensure we always provide the latest content
+ def source_archive
+ # pack all Git files (including the non-tracked files (-o),
+ # use --ignore-failed-read to not fail for removed files)
+ # -z and --null: NUL-delimited
+ git = "git ls-files --cached --others --exclude-standard -z"
+ tar = "tar --create --ignore-failed-read --null --files-from -"
+ `#{git} | #{tar} | #{gzip}`
+ end
+
+ # find which gzip is installed, use the faster parallel gzip ("pigz") if
it is available
+ # @return [String] "pigz or "gzip"
+ def gzip
+ return @gzip if @gzip
+
+ # parallel gzip installed?
+ @gzip = system("which pigz") ? "pigz" : "gzip"
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2019-09-06 13:27:01.000000000 +0200
+++ new/metadata 2020-03-05 17:06:27.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: yast-rake
version: !ruby/object:Gem::Version
- version: 0.2.36
+ version: 0.2.37
platform: ruby
authors:
- Josef Reidinger
autorequire:
bindir: bin
cert_chain: []
-date: 2019-09-06 00:00:00.000000000 Z
+date: 2020-03-05 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: packaging_rake_tasks
@@ -49,17 +49,23 @@
files:
- COPYING
- VERSION
+- data/index.html
- data/targets.yml
- lib/tasks/install.rake
- lib/tasks/pot.rake
- lib/tasks/rubocop.rake
- lib/tasks/run.rake
+- lib/tasks/server.rake
- lib/tasks/spell.yml
- lib/tasks/spellcheck.rake
- lib/tasks/spellcheck_task.rb
- lib/tasks/test_unit.rake
- lib/tasks/version.rake
+- lib/yast/index_servlet.rb
- lib/yast/rake.rb
+- lib/yast/servers_servlet.rb
+- lib/yast/tarball_server.rb
+- lib/yast/tarball_servlet.rb
- lib/yast/tasks.rb
homepage: https://github.com/yast/yast-rake
licenses:
@@ -80,7 +86,8 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.0.3
+rubyforge_project:
+rubygems_version: 2.7.6.2
signing_key:
specification_version: 4
summary: Rake tasks providing basic work-flow for Yast development