summaryrefslogtreecommitdiff
path: root/dev-ruby/net-scp
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-ruby/net-scp
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-ruby/net-scp')
-rw-r--r--dev-ruby/net-scp/Manifest3
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-fix-common.path28
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test.patch21
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_2.patch25
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_3.patch15
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-fix-upload_tests.patch14
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors-net-ssh-4.0-compat.patch30
-rw-r--r--dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors.patch80
-rw-r--r--dev-ruby/net-scp/metadata.xml12
-rw-r--r--dev-ruby/net-scp/net-scp-1.2.1-r1.ebuild47
-rw-r--r--dev-ruby/net-scp/net-scp-2.0.0.ebuild44
-rw-r--r--dev-ruby/net-scp/net-scp-3.0.0.ebuild42
12 files changed, 361 insertions, 0 deletions
diff --git a/dev-ruby/net-scp/Manifest b/dev-ruby/net-scp/Manifest
new file mode 100644
index 000000000000..13402c80a4c0
--- /dev/null
+++ b/dev-ruby/net-scp/Manifest
@@ -0,0 +1,3 @@
+DIST net-scp-1.2.1.gem 32768 BLAKE2B 67abf0b66aa6e8f28bdfa314a20f594eedafc5aeaf5d0ae8884cb7e27203699a791623968da98aaebda1630d47bf5859cc3e38875fe17dc8c7ce7926b50848a5 SHA512 64645a4517d6e408e3acfdb24576c8ded3b6ff981035ca10a2e081f9e3ab093f97b4848da4acca03ade364483766677e31296d09a31db4c81eb40123fc966829
+DIST net-scp-2.0.0.tar.gz 27835 BLAKE2B 2f5c9504ade26226a31fd766869f4deef3b344e99e71f780f184361efc75cad880c0dd266779d7f2550f176a86e89740edf27943c9ed81691378e5c3bf3241f0 SHA512 cd3470dfb2afba91911c429828d158e97e4feb17e211807abb05ab251622dc066e392521de250a8f2d4cf9d53c79598d636ef70c559b6aca7e1e7aa59ea3b36e
+DIST net-scp-3.0.0.tar.gz 27947 BLAKE2B 78a1100b7602b9c09c8f06228b6e564fce15133c6cf8c9816613cb56b1d3805d9393700eb66c3710e482771e4116beae393c12ad12963b85428e21e7cf105218 SHA512 6d68b75124ccd2d387983f6d66a8b0e040132ba17d942631c806e899dff757ffae7a031a27ea0988166bf56e803c1a6175199845a848b92c7064388564e0ac79
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-fix-common.path b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-common.path
new file mode 100644
index 000000000000..ee262d238cbf
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-common.path
@@ -0,0 +1,28 @@
+--- test/common.rb 2018-01-21 16:23:07.384173147 +0100
++++ test/common.rb 2018-01-21 16:20:34.084172782 +0100
+@@ -1,11 +1,11 @@
+ require 'test/unit'
+ require 'mocha/setup'
+
+-begin
+- gem 'net-ssh', ">= 2.0.0"
+- require 'net/ssh'
+-rescue LoadError
+- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../net-ssh/lib"
++#begin
++# #gem 'net-ssh', ">= 2.0.0"
++# require 'net/ssh'
++#rescue LoadError
++# $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../net-ssh/lib"
+
+ begin
+ require 'net/ssh'
+@@ -14,7 +14,7 @@
+ rescue LoadError => e
+ abort "could not load net/ssh v2 (#{e.inspect})"
+ end
+-end
++#end
+
+ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test.patch
new file mode 100644
index 000000000000..a138fcdb5573
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test.patch
@@ -0,0 +1,21 @@
+--- test/test_download.rb 2018-01-22 02:08:00.000013728 +0100
++++ test/test_download.rb.1 2018-01-22 02:11:49.820014276 +0100
+@@ -70,12 +70,12 @@
+ end
+
+ error = nil
+- assert_scripted do
+- begin
+- scp.download!("/path/to/remote.txt")
+- rescue
+- error = $!
+- end
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ begin
++ scp.download!("/path/to/remote.txt")
++ rescue
++ error = $!
++ end
+ end
+ assert_equal Net::SCP::Error, error.class
+ assert_equal "SCP did not finish successfully (1): File not found: /path/to/remote.txt\n", error.message
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_2.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_2.patch
new file mode 100644
index 000000000000..55a8e5f16bcd
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_2.patch
@@ -0,0 +1,25 @@
+--- test/test_download.rb 2018-01-22 02:26:56.440016436 +0100
++++ test/test_download.rb 2018-01-22 02:32:46.076017270 +0100
+@@ -116,7 +116,9 @@
+
+ def test_download_io_with_recursive_should_raise_error
+ expect_scp_session "-f -r /path/to/remote.txt"
+- assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", StringIO.new, :recursive => true) }
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", StringIO.new, :recursive => true) }
++ end
+ end
+
+ def test_download_io_with_preserve_should_ignore_preserve
+@@ -154,8 +156,9 @@
+ channel.sends_ok
+ channel.gets_data "D0755 0 remote\n"
+ end
+-
+- assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote") }
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote") }
++ end
+ end
+
+ def test_download_should_raise_error_if_gets_not_ok
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_3.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_3.patch
new file mode 100644
index 000000000000..12df02c1f00e
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-download_test_3.patch
@@ -0,0 +1,15 @@
+--- test/test_download.rb 2018-01-22 02:35:45.200017696 +0100
++++ test/test_download.rb.1 2018-01-22 02:38:40.000018113 +0100
+@@ -217,8 +217,10 @@
+ channel.gets_data "E\n"
+ channel.sends_ok
+ end
+-
+- scp.download!("/path/to/remote", "/path/to/local", :recursive => true, :ssh => { :verbose => :debug })
++
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ scp.download!("/path/to/remote", "/path/to/local", :recursive => true, :ssh => { :verbose => :debug })
++ end
+ assert_equal "a" * 1234, file.io.string
+ end
+
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-fix-upload_tests.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-upload_tests.patch
new file mode 100644
index 000000000000..73c34359afc2
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-fix-upload_tests.patch
@@ -0,0 +1,14 @@
+--- test/test_upload.rb 2018-01-22 08:15:30.996002204 +0100
++++ test/test_upload.rb.1 2018-01-22 08:18:09.328002581 +0100
+@@ -155,8 +155,9 @@
+ expect_scp_session("-t /path/to/remote") do |channel|
+ channel.gets_ok
+ end
+-
+- assert_raises(Net::SCP::Error) { scp.upload!("/path/to/local", "/path/to/remote") }
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ assert_raises(Net::SCP::Error) { scp.upload!("/path/to/local", "/path/to/remote") }
++ end
+ end
+
+ def test_upload_empty_directory_should_create_directory_and_finish
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors-net-ssh-4.0-compat.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors-net-ssh-4.0-compat.patch
new file mode 100644
index 000000000000..3431f06b7cff
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors-net-ssh-4.0-compat.patch
@@ -0,0 +1,30 @@
+--- test/test_download.rb 2018-01-22 01:47:38.932010818 +0100
++++ test/test_download.rb.1 2018-01-22 01:49:14.552011046 +0100
+@@ -205,9 +205,11 @@
+ channel.sends_ok
+ channel.gets_data "\1"
+ end
+-
+- e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
+- assert_equal("\1", e.message)
++
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
++ assert_equal("\1", e.message)
++ end
+ end
+
+ def test_download_directory_should_raise_error_if_local_exists_and_is_not_directory
+@@ -223,8 +225,10 @@
+ channel.sends_ok
+ end
+
+- e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
+- assert_match(/exists and is not a directory/, e.message)
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
++ assert_match(/exists and is not a directory/, e.message)
++ end
+ end
+
+ def test_download_directory_should_create_directory_and_files_locally
diff --git a/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors.patch b/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors.patch
new file mode 100644
index 000000000000..a23164ef8185
--- /dev/null
+++ b/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors.patch
@@ -0,0 +1,80 @@
+--- README.rdoc
++++ README.rdoc
+@@ -42,7 +42,7 @@ In a nutshell:
+ data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
+
+ # use a persistent connection to transfer files
+- Net::SCP.start("remote.host.com", "username", :ssh => { :password => "password" }) do |scp|
++ Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
+ # upload a file to a remote server
+ scp.upload! "/local/path", "/remote/path"
+
+--- lib/net/scp.rb
++++ lib/net/scp.rb
+@@ -395,7 +395,7 @@ module Net
+ def await_response_state(channel)
+ return if channel[:buffer].available == 0
+ c = channel[:buffer].read_byte
+- raise "#{c.chr}#{channel[:buffer].read}" if c != 0
++ raise Net::SCP::Error, "#{c.chr}#{channel[:buffer].read}" if c != 0
+ channel[:next], channel[:state] = nil, channel[:next]
+ send("#{channel[:state]}_state", channel)
+ end
+--- lib/net/scp/download.rb
++++ lib/net/scp/download.rb
+@@ -129,7 +129,7 @@ module Net; class SCP
+ channel[:local] = File.join(channel[:local], directive[:name])
+
+ if File.exists?(channel[:local]) && !File.directory?(channel[:local])
+- raise "#{channel[:local]} already exists and is not a directory"
++ raise Net::SCP::Error, "#{channel[:local]} already exists and is not a directory"
+ elsif !File.exists?(channel[:local])
+ Dir.mkdir(channel[:local], directive[:mode] | 0700)
+ end
+@@ -162,4 +162,4 @@ module Net; class SCP
+ end
+ end
+
+-end; end
+\ No newline at end of file
++end; end
+--- test/test_download.rb
++++ test/test_download.rb
+@@ -158,6 +158,37 @@ class TestDownload < Net::SCP::TestCase
+ assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote") }
+ end
+
++ def test_download_should_raise_error_if_gets_not_ok
++ prepare_file("/path/to/local.txt", "")
++
++ expect_scp_session "-f /path/to/remote.txt" do |channel|
++ channel.sends_ok
++ channel.gets_data "C0666 0 remote.txt\n"
++ channel.sends_ok
++ channel.gets_data "\1"
++ end
++
++ e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
++ assert_equal("\1", e.message)
++ end
++
++ def test_download_directory_should_raise_error_if_local_exists_and_is_not_directory
++ File.stubs(:exists?).with("/path/to/local").returns(true)
++ File.stubs(:exists?).with("/path/to/local/remote").returns(true)
++ File.stubs(:directory?).with("/path/to/local/remote").returns(false)
++
++ expect_scp_session "-f -r /path/to/remote" do |channel|
++ channel.sends_ok
++ channel.gets_data "D0755 0 remote\n"
++ channel.sends_ok
++ channel.gets_data "E\n"
++ channel.sends_ok
++ end
++
++ e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
++ assert_match(/exists and is not a directory/, e.message)
++ end
++
+ def test_download_directory_should_create_directory_and_files_locally
+ file = nil
+ prepare_directory "/path/to/local" do |dir|
diff --git a/dev-ruby/net-scp/metadata.xml b/dev-ruby/net-scp/metadata.xml
new file mode 100644
index 000000000000..060d393033df
--- /dev/null
+++ b/dev-ruby/net-scp/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>ruby@gentoo.org</email>
+ <name>Gentoo Ruby Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">net-ssh/net-scp</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
diff --git a/dev-ruby/net-scp/net-scp-1.2.1-r1.ebuild b/dev-ruby/net-scp/net-scp-1.2.1-r1.ebuild
new file mode 100644
index 000000000000..d717fa4a1aa6
--- /dev/null
+++ b/dev-ruby/net-scp/net-scp-1.2.1-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+USE_RUBY="ruby23 ruby24 ruby25 ruby26"
+
+RUBY_FAKEGEM_EXTRADOC="CHANGES.txt README.rdoc"
+
+RUBY_FAKEGEM_TASK_TEST=""
+
+inherit ruby-fakegem
+
+DESCRIPTION="A pure Ruby implementation of the SCP client protocol"
+HOMEPAGE="https://github.com/net-ssh/net-scp"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RUBY_PATCHES=(
+ ${P}-raise-correct-errors.patch
+ ${P}-fix-common.path
+ ${P}-fix-download_test.patch
+ ${P}-fix-download_test_2.patch
+ ${P}-fix-download_test_3.patch
+ ${P}-fix-upload_tests.patch
+ ${P}-raise-correct-errors-net-ssh-4.0-compat.patch
+ )
+
+ruby_add_bdepend "
+ doc? ( || ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 ) )
+ test? (
+ || ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )
+ dev-ruby/mocha
+ )"
+
+ruby_add_rdepend "|| ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )"
+
+all_ruby_prepare() {
+ sed -i -e 's/>= 2.0.0/~> 2.0/' test/common.rb || die
+}
+
+each_ruby_test() {
+ ${RUBY} -Ilib:test test/test_all.rb || die
+}
diff --git a/dev-ruby/net-scp/net-scp-2.0.0.ebuild b/dev-ruby/net-scp/net-scp-2.0.0.ebuild
new file mode 100644
index 000000000000..8c3e84358cc6
--- /dev/null
+++ b/dev-ruby/net-scp/net-scp-2.0.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+USE_RUBY="ruby24 ruby25 ruby26"
+
+RUBY_FAKEGEM_EXTRADOC="CHANGES.txt README.rdoc"
+
+RUBY_FAKEGEM_TASK_TEST=""
+
+inherit ruby-fakegem
+
+DESCRIPTION="A pure Ruby implementation of the SCP client protocol"
+HOMEPAGE="https://github.com/net-ssh/net-scp"
+SRC_URI="https://github.com/net-ssh/net-scp/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RUBY_PATCHES=(
+ ${P}-raise-correct-errors.patch
+ ${P}-fix-common.path
+ ${P}-fix-download_test.patch
+ ${P}-fix-download_test_2.patch
+ ${P}-fix-download_test_3.patch
+ ${P}-fix-upload_tests.patch
+ ${P}-raise-correct-errors-net-ssh-4.0-compat.patch
+ )
+
+ruby_add_bdepend "
+ doc? ( || ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 ) )
+ test? (
+ || ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )
+ dev-ruby/mocha
+ )"
+
+ruby_add_rdepend "|| ( dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )"
+
+each_ruby_test() {
+ ${RUBY} -Ilib:test test/test_all.rb || die
+}
diff --git a/dev-ruby/net-scp/net-scp-3.0.0.ebuild b/dev-ruby/net-scp/net-scp-3.0.0.ebuild
new file mode 100644
index 000000000000..78ae6a9954b5
--- /dev/null
+++ b/dev-ruby/net-scp/net-scp-3.0.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+USE_RUBY="ruby24 ruby25 ruby26 ruby27"
+
+RUBY_FAKEGEM_EXTRADOC="CHANGES.txt README.rdoc"
+
+RUBY_FAKEGEM_TASK_TEST=""
+
+RUBY_FAKEGEM_GEMSPEC="net-scp.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A pure Ruby implementation of the SCP client protocol"
+HOMEPAGE="https://github.com/net-ssh/net-scp"
+SRC_URI="https://github.com/net-ssh/net-scp/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+ruby_add_bdepend "
+ doc? ( || ( dev-ruby/net-ssh:6 dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 ) )
+ test? (
+ || ( dev-ruby/net-ssh:6 dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )
+ dev-ruby/mocha
+ )"
+
+ruby_add_rdepend "|| ( dev-ruby/net-ssh:6 dev-ruby/net-ssh:5 dev-ruby/net-ssh:4 )"
+
+all_ruby_prepare() {
+ sed -e "s:_relative ': './:" \
+ -e 's/git ls-files -z/find -print0/' \
+ -i ${RUBY_FAKEGEM_GEMSPEC} || die
+}
+
+each_ruby_test() {
+ ${RUBY} -Ilib:test test/test_all.rb || die
+}