Compare commits

..

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

4 changed files with 25 additions and 172 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/jansi-project-1.18.tar.gz
SOURCES/jansi-project-1.17.1.tar.gz

View File

@ -1 +1 @@
9351d9d21aeef3a8db731718dca8a64e79addb63 SOURCES/jansi-project-1.18.tar.gz
384bb41e1ec4118ec0aaf61e14f7e6812456b741 SOURCES/jansi-project-1.17.1.tar.gz

View File

@ -1,132 +0,0 @@
From 9267e184753020dbe436868ac4c6377f58e4500f Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 5 Nov 2019 15:41:45 +0100
Subject: [PATCH] Drop dependency on native library
---
.../org/fusesource/jansi/AnsiConsole.java | 64 ++-----------------
1 file changed, 6 insertions(+), 58 deletions(-)
diff --git a/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java b/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
index d7a37b0..6e0d316 100644
--- a/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
+++ b/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
@@ -15,10 +15,6 @@
*/
package org.fusesource.jansi;
-import static org.fusesource.jansi.internal.CLibrary.STDERR_FILENO;
-import static org.fusesource.jansi.internal.CLibrary.STDOUT_FILENO;
-import static org.fusesource.jansi.internal.CLibrary.isatty;
-
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -75,36 +71,20 @@ public class AnsiConsole {
@Deprecated
public static OutputStream wrapOutputStream(final OutputStream stream) {
- try {
- return wrapOutputStream(stream, STDOUT_FILENO);
- } catch (Throwable ignore) {
- return wrapOutputStream(stream, 1);
- }
+ return wrapOutputStream(stream, 1);
}
public static PrintStream wrapSystemOut(final PrintStream ps) {
- try {
- return wrapPrintStream(ps, STDOUT_FILENO);
- } catch (Throwable ignore) {
- return wrapPrintStream(ps, 1);
- }
+ return wrapPrintStream(ps, 1);
}
@Deprecated
public static OutputStream wrapErrorOutputStream(final OutputStream stream) {
- try {
- return wrapOutputStream(stream, STDERR_FILENO);
- } catch (Throwable ignore) {
- return wrapOutputStream(stream, 2);
- }
+ return wrapOutputStream(stream, 2);
}
public static PrintStream wrapSystemErr(final PrintStream ps) {
- try {
- return wrapPrintStream(ps, STDERR_FILENO);
- } catch (Throwable ignore) {
- return wrapPrintStream(ps, 2);
- }
+ return wrapPrintStream(ps, 2);
}
@Deprecated
@@ -124,22 +104,6 @@ public class AnsiConsole {
return new AnsiOutputStream(stream);
}
- if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW_XTERM) {
-
- // On windows we know the console does not interpret ANSI codes..
- try {
- jansiOutputType = JansiOutputType.WINDOWS;
- return new WindowsAnsiOutputStream(stream, fileno == STDOUT_FILENO);
- } catch (Throwable ignore) {
- // this happens when JNA is not in the path.. or
- // this happens when the stdout is being redirected to a file.
- }
-
- // Use the ANSIOutputStream to strip out the ANSI escape sequences.
- jansiOutputType = JansiOutputType.STRIP_ANSI;
- return new AnsiOutputStream(stream);
- }
-
// We must be on some Unix variant, including Cygwin or MSYS(2) on Windows...
try {
// If the jansi.force property is set, then we force to output
@@ -147,7 +111,7 @@ public class AnsiConsole {
boolean forceColored = Boolean.getBoolean("jansi.force");
// If we can detect that stdout is not a tty.. then setup
// to strip the ANSI sequences..
- if (!forceColored && isatty(fileno) == 0) {
+ if (!forceColored && System.console() == null) {
jansiOutputType = JansiOutputType.STRIP_ANSI;
return new AnsiOutputStream(stream);
}
@@ -202,22 +166,6 @@ public class AnsiConsole {
return new AnsiPrintStream(ps);
}
- if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW_XTERM) {
-
- // On windows we know the console does not interpret ANSI codes..
- try {
- jansiOutputType = JansiOutputType.WINDOWS;
- return new WindowsAnsiPrintStream(ps, fileno == STDOUT_FILENO);
- } catch (Throwable ignore) {
- // this happens when JNA is not in the path.. or
- // this happens when the stdout is being redirected to a file.
- }
-
- // Use the AnsiPrintStream to strip out the ANSI escape sequences.
- jansiOutputType = JansiOutputType.STRIP_ANSI;
- return new AnsiPrintStream(ps);
- }
-
// We must be on some Unix variant, including Cygwin or MSYS(2) on Windows...
try {
// If the jansi.force property is set, then we force to output
@@ -225,7 +173,7 @@ public class AnsiConsole {
boolean forceColored = Boolean.getBoolean("jansi.force");
// If we can detect that stdout is not a tty.. then setup
// to strip the ANSI sequences..
- if (!forceColored && isatty(fileno) == 0) {
+ if (!forceColored && System.console() == null) {
jansiOutputType = JansiOutputType.STRIP_ANSI;
return new AnsiPrintStream(ps);
}
--
2.21.0

View File

@ -1,19 +1,20 @@
Name: jansi
Version: 1.18
Release: 4%{?dist}
Version: 1.17.1
Release: 1%{?dist}
Summary: Jansi is a java library for generating and interpreting ANSI escape sequences
License: ASL 2.0
URL: http://fusesource.github.io/jansi/
BuildArch: noarch
Source0: https://github.com/fusesource/jansi/archive/jansi-project-%{version}.tar.gz
Patch0: 0001-Drop-dependency-on-native-library.patch
BuildArch: noarch
BuildRequires: maven-local-openjdk8
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.fusesource:fusesource-pom:pom:)
BuildRequires: mvn(org.fusesource.hawtjni:hawtjni-runtime)
BuildRequires: mvn(org.fusesource.jansi:jansi-native)
%description
Jansi is a small java library that allows you to use ANSI escape sequences
@ -21,12 +22,14 @@ in your Java console applications. It implements ANSI support on platforms
which don't support it like Windows and provides graceful degradation for
when output is being sent to output devices which cannot support ANSI sequences.
%{?module_package}
%{?javadoc_package}
%package javadoc
Summary: Javadocs for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n jansi-jansi-project-%{version}
%patch0 -p1
%pom_disable_module example
%pom_xpath_remove "pom:build/pom:extensions"
@ -46,43 +49,25 @@ pushd jansi
# it's there only to be bundled in uberjar and we disable uberjar generation
%pom_remove_dep :jansi-linux32
%pom_remove_dep :jansi-linux64
#
%pom_remove_dep :jansi-native
%pom_remove_dep :hawtjni-runtime
popd
# javadoc generation fails due to strict doclint in JDK 8
%pom_remove_plugin -r :maven-javadoc-plugin
rm -f jansi/src/{main,test}/java/org/fusesource/jansi/{WindowsSupport,WindowsAnsiOutputStream,WindowsAnsiPrintStream,WindowsSupportTest,AnsiMain}.java
%build
%mvn_build
%install
%mvn_install
%files -n %{?module_prefix}%{name} -f .mfiles
%files -f .mfiles
%license license.txt
%doc readme.md changelog.md
%files javadoc -f .mfiles-javadoc
%license license.txt
%changelog
* Sat Jan 25 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-4
- Build with OpenJDK 8
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-3
- Mass rebuild for javapackages-tools 201902
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-2
- Remove dependency on jansi-native and hawtjni
* Mon Jul 22 2019 Marian Koncek <mkoncek@redhat.com> - 1.18-1
- Update to upstream version 1.18
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.17.1-2
- Mass rebuild for javapackages-tools 201901
* Tue Jun 05 2018 Michael Simacek <msimacek@redhat.com> - 1.17.1-1
- Update to upstream version 1.17.1