Compare commits

...

No commits in common. "c9s" and "c8s-stream-201801" have entirely different histories.

5 changed files with 49 additions and 319 deletions

8
.gitignore vendored
View File

@ -1,7 +1 @@
jline-0.9.94.zip SOURCES/jline-2.14.6.tar.gz
jline-1.0.zip
/jline-2.10.tar.xz
/jline-2.12.1.tar.xz
/jline-2.13.tar.xz
/jline-2.14.6.tar.gz
/jline-parent-3.18.0.tar.gz

View File

@ -1 +1 @@
c65d525fa1b762604f2c14bf7506d48d938fe2fd jline-parent-3.18.0.tar.gz 9c060a752498e68b70a91ae29c915093f6f75927 SOURCES/jline-2.14.6.tar.gz

View File

@ -1,218 +1,84 @@
Name: jline Name: jline
Version: 3.18.0 Version: 2.14.6
Release: 2%{?dist} Release: 2%{?dist}
Summary: Java library for handling console input Summary: JLine is a Java library for handling console input
License: BSD License: BSD
URL: https://github.com/jline/jline3 URL: https://github.com/jline/jline2
BuildArch: noarch BuildArch: noarch
Source0: %{url}/archive/jline-parent-%{version}.tar.gz Source0: https://github.com/jline/jline2/archive/jline-%{version}.tar.gz
# Adapt to newer versions of apache-sshd
Patch0: %{name}-apache-sshd.patch
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: mvn(com.googlecode.juniversalchardet:juniversalchardet)
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.java.dev.jna:jna)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
BuildRequires: mvn(org.apache.sshd:sshd-core)
BuildRequires: mvn(org.apache.sshd:sshd-scp)
BuildRequires: mvn(org.apache.sshd:sshd-sftp)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.easymock:easymock) BuildRequires: mvn(org.easymock:easymock)
BuildRequires: mvn(org.fusesource.jansi:jansi) BuildRequires: mvn(org.fusesource.jansi:jansi)
BuildRequires: mvn(org.powermock:powermock-api-easymock)
BuildRequires: mvn(org.powermock:powermock-module-junit4)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
%global _desc %{expand: Obsoletes: jline2 < %{version}-%{release}
JLine is a Java library for handling console input. It is similar in Provides: jline2 = %{version}-%{release}
functionality to BSD editline and GNU readline but with additional
features that bring it in par with the ZSH line editor. Those familiar
with the readline/editline capabilities for modern shells (such as bash
and tcsh) will find most of the command editing features of JLine to be
familiar.}
%description %_desc %description
JLine is a Java library for handling console input. It is similar
This package contains the parent POM for the jline project in functionality to BSD editline and GNU readline. People familiar
with the readline/editline capabilities for modern shells (such as
bash and tcsh) will find most of the command editing features of
JLine to be familiar.
%package javadoc %package javadoc
Summary: Javadocs for %{name} Summary: Javadocs for %{name}
Obsoletes: jline2-javadoc < %{version}-%{release}
Provides: jline2-javadoc = %{version}-%{release}
%description javadoc %_desc %description javadoc
This package contains the API documentation for %{name}. This package contains the API documentation for %{name}.
%package terminal
Summary: JLine terminal
%description terminal %_desc
This package contains the basic terminal support for JLine.
%package terminal-jansi
Summary: JLine terminal with JANSI
Requires: %{name}-terminal = %{version}-%{release}
%description terminal-jansi %_desc
This package contains a functioning terminal based on JANSI.
%package terminal-jna
Summary: JLine terminal with JNA
Requires: %{name}-terminal = %{version}-%{release}
%description terminal-jna %_desc
This package contains a functioning terminal based on JNA.
%package reader
Summary: JLine reader
Requires: %{name}-terminal = %{version}-%{release}
%description reader %_desc
This package supports reading lines from a console with customizable key
bindings and input editing.
%package style
Summary: JLine style
Requires: %{name}-terminal = %{version}-%{release}
%description style %_desc
This package contains a style processor for JLine, which can apply
colors to strings, for example.
%package builtins
Summary: JLine builtins
Requires: %{name}-reader = %{version}-%{release}
Requires: %{name}-style = %{version}-%{release}
Recommends: mvn(com.googlecode.juniversalchardet:juniversalchardet)
%description builtins %_desc
This package contains keybindings to emulate popular tools such as nano
and less.
%package console
Summary: JLine console
Requires: %{name}-builtins = %{version}-%{release}
%description console %_desc
This package contains a console with command and script execution
support, and tab completion.
%package remote-ssh
Summary: JLine remote SSH
Requires: %{name}-builtins = %{version}-%{release}
Recommends: mvn(org.apache.sshd:sshd-core)
Recommends: mvn(org.apache.sshd:sshd-scp)
Recommends: mvn(org.apache.sshd:sshd-sftp)
%description remote-ssh %_desc
This package contains an ssh client.
%package remote-telnet
Summary: JLine remote telnet
Requires: %{name}-builtins = %{version}-%{release}
Recommends: mvn(org.apache.sshd:sshd-core)
%description remote-telnet %_desc
This package contains a telnet client.
%prep %prep
%autosetup -n jline3-jline-parent-%{version} -p0 %setup -q -n jline2-jline-%{version}
# remove unnecessary dependency on parent POM # Remove maven-shade-plugin usage
%pom_remove_parent %pom_remove_plugin "org.apache.maven.plugins:maven-shade-plugin"
# Remove animal sniffer plugin in order to reduce deps
%pom_remove_plugin "org.codehaus.mojo:animal-sniffer-maven-plugin"
# We don't need the bundle # Remove unavailable and unneeded deps
%pom_disable_module jline %pom_xpath_remove "pom:build/pom:extensions"
%pom_remove_plugin :maven-site-plugin
# Missing dependencies in Fedora %pom_remove_plugin :maven-enforcer-plugin
%pom_disable_module demo
%pom_disable_module groovy
%pom_disable_module graal
%pom_remove_plugin :gmavenplus-plugin
%pom_remove_dep :graal-sdk
# Unnecessary plugins for an rpm build
%pom_remove_plugin :maven-javadoc-plugin %pom_remove_plugin :maven-javadoc-plugin
%pom_remove_plugin :maven-release-plugin
%pom_remove_plugin :native-image-maven-plugin # Makes the build fail on deprecation warnings from jansi
%pom_xpath_remove 'pom:arg[text()="-Werror"]'
# Do not import non-existing internal package
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Import-Package"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions" "<Import-Package>javax.swing;resolution:=optional,org.fusesource.jansi,!org.fusesource.jansi.internal</Import-Package>"
# Be sure to export jline.internal, but not org.fusesource.jansi.
# See https://bugzilla.redhat.com/show_bug.cgi?id=1317551
%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Export-Package" "jline.*;-noimport:=true"
# For some reason these directories do not exist, failing compilation due to -Werror
mkdir -p target/generated-sources/annotations
mkdir -p target/generated-test-sources/test-annotations
# nondeterministic
find -name TerminalFactoryTest.java -delete
%build %build
%mvn_build -s %mvn_build
%install %install
%mvn_install %mvn_install
%files -f .mfiles-jline-parent %files -f .mfiles
%doc changelog.md README.md
%license LICENSE.txt
%files javadoc -f .mfiles-javadoc %files javadoc -f .mfiles-javadoc
%doc changelog.md README.md
%license LICENSE.txt
%files terminal -f .mfiles-jline-terminal
%doc changelog.md README.md
%license LICENSE.txt
%files terminal-jansi -f .mfiles-jline-terminal-jansi
%files terminal-jna -f .mfiles-jline-terminal-jna
%files reader -f .mfiles-jline-reader
%files style -f .mfiles-jline-style
%files builtins -f .mfiles-jline-builtins
%files console -f .mfiles-jline-console
%files remote-ssh -f .mfiles-jline-remote-ssh
%files remote-telnet -f .mfiles-jline-remote-telnet
%changelog %changelog
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.18.0-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Dec 14 2020 Jerry James <loganjerry@gmail.com> - 3.18.0-1
- Version 3.18.0
- Remove package name from Summary
- Add patch to adapt to recent versions of apache-sshd
- Break up into subpackages to control dependencies
* Sun Aug 09 2020 Fabio Valentini <decathorpe@gmail.com> - 2.14.6-10
- Drop useless parent POM and powermock build dependencies.
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 2.14.6-8
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Thu Jun 25 2020 Alexander Kurtakov <akurtako@redhat.com> 2.14.6-7
- Fix Java 11 build.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 29 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.14.6-2 * Fri Jun 29 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.14.6-2
- Remove explicit invocation of maven-javadoc-plugin - Remove explicit invocation of maven-javadoc-plugin

View File

@ -1,129 +0,0 @@
--- remote-ssh/src/main/java/org/jline/builtins/ssh/ShellCommand.java.orig 2020-12-11 02:25:01.000000000 -0700
+++ remote-ssh/src/main/java/org/jline/builtins/ssh/ShellCommand.java 2020-12-13 21:00:45.364500609 -0700
@@ -18,6 +18,7 @@ import java.util.logging.Logger;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
+import org.apache.sshd.server.channel.ChannelSession;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.session.ServerSession;
@@ -59,7 +60,7 @@ public class ShellCommand implements Com
this.session = session;
}
- public void start(final Environment env) throws IOException {
+ public void start(ChannelSession channel, final Environment env) throws IOException {
this.env = env;
new Thread(this::run).start();
}
@@ -84,7 +85,7 @@ public class ShellCommand implements Com
}
}
- public void destroy() {
+ public void destroy(ChannelSession session) {
}
}
--- remote-ssh/src/main/java/org/jline/builtins/ssh/ShellFactoryImpl.java.orig 2020-12-11 02:25:01.000000000 -0700
+++ remote-ssh/src/main/java/org/jline/builtins/ssh/ShellFactoryImpl.java 2020-12-13 21:00:45.365500608 -0700
@@ -15,14 +15,15 @@ import java.io.OutputStream;
import java.util.Map;
import java.util.function.Consumer;
-import org.apache.sshd.common.Factory;
import org.apache.sshd.common.channel.PtyMode;
import org.apache.sshd.server.Environment;
import org.apache.sshd.server.ExitCallback;
import org.apache.sshd.server.SessionAware;
import org.apache.sshd.server.Signal;
+import org.apache.sshd.server.channel.ChannelSession;
import org.apache.sshd.server.command.Command;
import org.apache.sshd.server.session.ServerSession;
+import org.apache.sshd.server.shell.ShellFactory;
import org.jline.terminal.Attributes;
import org.jline.terminal.Attributes.ControlChar;
import org.jline.terminal.Attributes.InputFlag;
@@ -36,7 +37,7 @@ import org.jline.terminal.TerminalBuilde
* SSHD {@link org.apache.sshd.server.command.Command} factory which provides access to
* Shell.
*/
-public class ShellFactoryImpl implements Factory<Command> {
+public class ShellFactoryImpl implements ShellFactory {
private final Consumer<Ssh.ShellParams> shell;
public ShellFactoryImpl(Consumer<Ssh.ShellParams> shell) {
@@ -63,7 +64,7 @@ public class ShellFactoryImpl implements
}
}
- public Command create() {
+ public Command createShell(ChannelSession channel) throws IOException {
return new ShellImpl();
}
@@ -100,7 +101,7 @@ public class ShellFactoryImpl implements
this.session = session;
}
- public void start(final Environment env) throws IOException {
+ public void start(ChannelSession channel, final Environment env) throws IOException {
try {
new Thread(() -> {
try {
@@ -216,7 +217,7 @@ public class ShellFactoryImpl implements
}
}
terminal.setAttributes(attr);
- env.addSignalListener(signals -> {
+ env.addSignalListener((channel, signal) -> {
terminal.setSize(new Size(Integer.parseInt(env.getEnv().get("COLUMNS")),
Integer.parseInt(env.getEnv().get("LINES"))));
terminal.raise(Terminal.Signal.WINCH);
@@ -229,6 +230,10 @@ public class ShellFactoryImpl implements
}
public void destroy() {
+ this.destroy(null);
+ }
+
+ public void destroy(ChannelSession session) {
if (!closed) {
closed = true;
flush(out, err);
--- remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java.orig 2020-12-11 02:25:01.000000000 -0700
+++ remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java 2020-12-13 21:00:45.366500608 -0700
@@ -20,8 +20,10 @@ import org.apache.sshd.client.channel.Cl
import org.apache.sshd.client.channel.ClientChannelEvent;
import org.apache.sshd.client.future.ConnectFuture;
import org.apache.sshd.client.session.ClientSession;
+import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.channel.PtyMode;
import org.apache.sshd.common.config.keys.FilePasswordProvider;
+import org.apache.sshd.common.session.SessionContext;
import org.apache.sshd.common.util.io.NoCloseInputStream;
import org.apache.sshd.common.util.io.NoCloseOutputStream;
import org.apache.sshd.server.SshServer;
@@ -362,7 +364,7 @@ public class Ssh {
server.setHost(ip);
server.setShellFactory(new ShellFactoryImpl(shell));
server.setCommandFactory(new ScpCommandFactory.Builder()
- .withDelegate(command -> new ShellCommand(execute, command)).build());
+ .withDelegate((channel, command) -> new ShellCommand(execute, command)).build());
server.setSubsystemFactories(Collections.singletonList(
new SftpSubsystemFactory.Builder().build()
));
@@ -390,8 +392,10 @@ public class Ssh {
}
@Override
- public String getPassword(String resourceKey) throws IOException {
- return readLine("Enter password for " + resourceKey + ":", false);
+ public String getPassword(SessionContext session, NamedResource resourceKey, int retryIndex) throws IOException {
+ if (retryIndex == 0)
+ return readLine("Enter password for " + resourceKey.getName() + ":", false);
+ return readLine("Enter password again for " + resourceKey.getName() + ":", false);
}
@Override

View File

@ -1 +0,0 @@
SHA512 (jline-parent-3.18.0.tar.gz) = 53bfa20d568b096e0cbb08c2af2b4de6a190853c0b458ab3ce6073e5cfac96b2af119dc8310ce825c81ad7448df3fe8a4f374678260d6f6b38c8083bd604934d