awrb commented on code in PR #1713:
URL: https://github.com/apache/karaf/pull/1713#discussion_r1099753821


##########
bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java:
##########
@@ -82,15 +82,26 @@ public Object execute() throws Exception {
         for (URI url : urls) {
             try {
                 Bundle bundle = bundleContext.installBundle(url.toString(), 
null);
-                if 
(!"2".equals(bundle.getHeaders().get(Constants.BUNDLE_MANIFESTVERSION))) {
+                String manifestVersion = 
bundle.getHeaders().get(Constants.BUNDLE_MANIFESTVERSION);
+
+                if (!"2".equals(manifestVersion)) {
                     if (allowR3) {
                         if (!r3warned) {
                             System.err.println("WARNING: use of OSGi r3 
bundles is discouraged");
                             r3warned = true;
                         }
                     } else {
+                        String error;
+                        if (manifestVersion == null) {

Review Comment:
   Actually this needs to be checked independently of `allowR3` because with 
--allowR3 this will let non-OSGi bundles through.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to