#2 Port to OSGI 7.0.0
Merged 7 days ago by churchyard. Opened a month ago by churchyard.
rpms/ churchyard/aqute-bnd osgi  into  master

@@ -0,0 +1,117 @@ 

+ From e9469ae2ca9f3d64fd88e0d8aaf8ebeea7bb937d Mon Sep 17 00:00:00 2001

+ From: Marian Koncek <mkoncek@redhat.com>

+ Date: Fri, 12 Apr 2019 14:59:30 +0200

+ Subject: [PATCH] Port to OSGI 7.0.0

+ 

+ ---

+  .../src/aQute/bnd/main/ReporterLogger.java    | 16 +++++++++

+  .../src/aQute/bnd/testing/TestingLog.java     | 35 +++++++++++++++++++

+  2 files changed, 51 insertions(+)

+ 

+ diff --git a/biz.aQute.bnd/src/aQute/bnd/main/ReporterLogger.java b/biz.aQute.bnd/src/aQute/bnd/main/ReporterLogger.java

+ index ce86cd6..735db9c 100644

+ --- a/biz.aQute.bnd/src/aQute/bnd/main/ReporterLogger.java

+ +++ b/biz.aQute.bnd/src/aQute/bnd/main/ReporterLogger.java

+ @@ -1,5 +1,6 @@

+  package aQute.bnd.main;

+  

+ +import org.osgi.framework.Bundle;

+  import org.osgi.framework.ServiceReference;

+  import org.osgi.service.log.LogService;

+  import org.slf4j.Logger;

+ @@ -8,6 +9,7 @@ import org.slf4j.LoggerFactory;

+  import aQute.service.reporter.Reporter;

+  

+  public class ReporterLogger implements LogService {

+ +	private final static RuntimeException UNSUPPORTED = new UnsupportedOperationException("This method is provided for backwards compatibility");

+  	private final static Logger	logger	= LoggerFactory.getLogger(ReporterLogger.class);

+  

+  	private Reporter	reporter;

+ @@ -108,4 +110,18 @@ public class ReporterLogger implements LogService {

+  		}

+  	}

+  

+ +	@Override

+ +	public org.osgi.service.log.Logger getLogger(String name) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public org.osgi.service.log.Logger getLogger(Class< ? > clazz) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends org.osgi.service.log.Logger> L getLogger(String name, Class<L> loggerType) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends org.osgi.service.log.Logger> L getLogger(Class< ? > clazz, Class<L> loggerType) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends org.osgi.service.log.Logger> L getLogger(Bundle bundle, String name, Class<L> loggerType) {throw UNSUPPORTED;}

+  }

+ diff --git a/biz.aQute.bndlib/src/aQute/bnd/testing/TestingLog.java b/biz.aQute.bndlib/src/aQute/bnd/testing/TestingLog.java

+ index d9c3e78..ec7dd27 100644

+ --- a/biz.aQute.bndlib/src/aQute/bnd/testing/TestingLog.java

+ +++ b/biz.aQute.bndlib/src/aQute/bnd/testing/TestingLog.java

+ @@ -8,7 +8,9 @@ import java.util.regex.Pattern;

+  

+  import org.osgi.framework.Bundle;

+  import org.osgi.framework.ServiceReference;

+ +import org.osgi.service.log.Logger;

+  import org.osgi.service.log.LogEntry;

+ +import org.osgi.service.log.LogLevel;

+  import org.osgi.service.log.LogService;

+  

+  import aQute.bnd.annotation.component.Activate;

+ @@ -26,6 +28,8 @@ import aQute.bnd.testing.TestingLog.Config;

+  @Component(designate = Config.class)

+  @SuppressWarnings("rawtypes")

+  public class TestingLog implements LogService {

+ +	private final static RuntimeException UNSUPPORTED = new UnsupportedOperationException("This method is provided for backwards compatibility");

+ +

+  	boolean			stacktrace;

+  	boolean			direct;

+  	int				level;

+ @@ -125,6 +129,22 @@ public class TestingLog implements LogService {

+  					return sb.toString();

+  				}

+  			}

+ +

+ +			@Override

+ +			public LogLevel getLogLevel() {throw UNSUPPORTED;}

+ +

+ +			@Override

+ +			public String getLoggerName() {throw UNSUPPORTED;}

+ +

+ +			@Override

+ +			public long getSequence() {throw UNSUPPORTED;}

+ +

+ +			@Override

+ +			public String getThreadInfo() {throw UNSUPPORTED;}

+ +

+ +			@Override

+ +			public StackTraceElement getLocation() {throw UNSUPPORTED;}

+ +

+  		};

+  		entries.add(entry);

+  		if (direct)

+ @@ -197,4 +217,19 @@ public class TestingLog implements LogService {

+  		return n != 0;

+  	}

+  

+ +	@Override

+ +	public Logger getLogger(String name) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public Logger getLogger(Class< ? > clazz) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends Logger> L getLogger(String name, Class<L> loggerType) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends Logger> L getLogger(Class< ? > clazz, Class<L> loggerType) {throw UNSUPPORTED;}

+ +

+ +	@Override

+ +	public <L extends Logger> L getLogger(Bundle bundle, String name, Class<L> loggerType) {throw UNSUPPORTED;}

+ +

+  }

+ -- 

+ 2.20.1

+ 

file modified
+6 -23

@@ -1,9 +1,7 @@ 

- %bcond_without ant_tasks

- %bcond_without maven_plugin

  

  Name:           aqute-bnd

  Version:        3.5.0

- Release:        5%{?dist}

+ Release:        6%{?dist}

  Summary:        BND Tool

  # Part of jpm is under BSD, but jpm is not included in binary RPM

  License:        ASL 2.0

@@ -24,6 +22,7 @@ 

  

  Patch0:         0001-Disable-removed-commands.patch

  Patch1:         0002-Fix-ant-compatibility.patch

+ Patch2:         0001-Port-to-OSGI-7.0.0.patch

  

  BuildRequires:  maven-local

  BuildRequires:  mvn(org.osgi:osgi.annotation)

@@ -31,10 +30,7 @@ 

  BuildRequires:  mvn(org.osgi:osgi.core)

  BuildRequires:  mvn(org.slf4j:slf4j-api)

  BuildRequires:  mvn(org.slf4j:slf4j-simple)

- %if %{with ant_tasks}

  BuildRequires:  mvn(org.apache.ant:ant)

- %endif

- %if %{with maven_plugin}

  BuildRequires:  mvn(junit:junit)

  BuildRequires:  mvn(org.apache.maven:maven-artifact)

  BuildRequires:  mvn(org.apache.maven:maven-compat)

@@ -45,7 +41,6 @@ 

  BuildRequires:  mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)

  BuildRequires:  mvn(org.eclipse.aether:aether-api)

  BuildRequires:  mvn(org.sonatype.plexus:plexus-build-api)

- %endif

  # Explicit javapackages-tools requires since bnd script uses

  # /usr/share/java-utils/java-functions

  Requires:       javapackages-tools

@@ -69,13 +64,11 @@ 

  %description -n aqute-bndlib

  %{summary}.

  

- %if %{with maven_plugin}

  %package -n bnd-maven-plugin

  Summary:        BND Maven plugin

  

  %description -n bnd-maven-plugin

  %{summary}.

- %endif

  

  %package javadoc

  Summary:        Javadoc for %{name}

@@ -90,6 +83,7 @@ 

  

  %patch0 -p1

  %patch1 -p1

+ %patch2 -p1

  

  # the commands pull in more dependencies than we want (felix-resolver, jetty)

  rm biz.aQute.bnd/src/aQute/bnd/main/{RemoteCommand,ResolveCommand}.java

@@ -97,13 +91,7 @@ 

  sed 's/@VERSION@/%{version}/' %SOURCE2 > pom.xml

  sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info

  

- %if %{without ant_tasks}

- rm -rf biz.aQute.bnd/src/aQute/bnd/ant

- %endif

  

- %if %{without maven_plugin}

- %pom_disable_module maven

- %endif

  

  # libg

  pushd aQute.libg

@@ -140,9 +128,7 @@ 

  %pom_add_dep biz.aQute.bnd:biz.aQute.bndlib:%{version}

  %pom_add_dep biz.aQute.bnd:aQute.libg:%{version}

  %pom_add_dep biz.aQute.bnd:biz.aQute.bnd.annotation:%{version}

- %if %{with ant_tasks}

  %pom_add_dep org.apache.ant:ant

- %endif

  %pom_add_dep org.osgi:osgi.annotation

  %pom_add_dep org.osgi:osgi.core

  %pom_add_dep org.osgi:osgi.cmpn

@@ -188,31 +174,28 @@ 

  %install

  %mvn_install

  

- %if %{with ant_tasks}

  install -d -m 755 %{buildroot}%{_sysconfdir}/ant.d

  echo "aqute-bnd slf4j/api slf4j/simple osgi-annotation osgi-core osgi-compendium" >%{buildroot}%{_sysconfdir}/ant.d/%{name}

- %endif

  

  %jpackage_script aQute.bnd.main.bnd "" "" aqute-bnd:slf4j/slf4j-api:slf4j/slf4j-simple:osgi-annotation:osgi-core:osgi-compendium bnd 1

  

  %files -f .mfiles

  %license LICENSE

  %{_bindir}/bnd

- %if %{with ant_tasks}

  %config(noreplace) %{_sysconfdir}/ant.d/*

- %endif

  

  %files -n aqute-bndlib -f .mfiles-bndlib

  %license LICENSE

  

- %if %{with maven_plugin}

  %files -n bnd-maven-plugin -f .mfiles-maven

- %endif

  

  %files javadoc -f .mfiles-javadoc

  %license LICENSE

  

  %changelog

+ * Fri Apr 12 2019 Marian Koncek <mkoncek@redhat.com> - 3.5.0-6

+ - Port to OSGI 7.0.0

+ 

  * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

no initial comment

Looks good, package successfully builds locally, and this fixes the FTBFS issues on fedora 30 / rawhide. Second opinion welcome :wink:

There was no second opinion. Merging.

Pull-Request has been merged by churchyard

7 days ago