3 Replies Latest reply on Apr 15, 2014 11:29 AM by rich.peters

    Karaf console commands for osgi

    rich.peters

      Hi,

       

      we have had a hard time working around installing some updates to osgi bundles that our security required we make.

       

      Life would be a lot easier if there were two new features:

       

        1.  There was an osgi command to query the bundle id of a package name in the maven format:

                     osgi:bundle org.springframework/spring-core/3.1.4.RELEASE

             currently there is no way to get the bundle id of a package easily

       

        2.  The osgi:install command accepted a bundle bundle-level as an optional parameter (as in the osgi:bundle-level command)

             if you do 1.  you dont absolutely need 1, but it would be convenient

       

      These two features would make scripting upgrades easier

       

      thanks

      Rich

        • 1. Re: Karaf console commands for osgi
          davsclaus

          The Karaf console is like the unix shell so you can pipe commands,

           

              list -l | grep -i " org.springframework/spring-core"

           

          Yeah I guess there isn't a sed/awk to grab what you then need.

           

          You are welcome to make a suggestion at the Apache Karaf project as this is karaf specific

          http://karaf.apache.org/index/community/discussion-forums.html

          1 of 1 people found this helpful
          • 2. Re: Karaf console commands for osgi
            janstey

            Agree, those would be nice features to add to Karaf. If it helps, here is some ugly scripting I recently used to upgrade Spring 3.1 libs to 3.2:

             

            #!/bin/bash

            ./bin/client -u admin -p admin "osgi:list -s" | grep org.springframework | grep 3.1 | grep -v asm | sed 's/\[ \([0-9]*\).*/\1/' |

            while read id

            do (

               name=`./bin/client -u admin -p admin "osgi:headers --force $id" | grep Symbolic | sed 's/.*= \(.*\)/\1/'`

               echo "Updating $name to 3.2.4.RELEASE"

               ./bin/client -u admin -p admin "osgi:update --force $id mvn:org.springframework/$name/3.2.4.RELEASE"

            )

            done

            1 of 1 people found this helpful
            • 3. Re: Karaf console commands for osgi
              rich.peters

              Claus,

               

              thanks I did post it on the Karaf forum

               

              Rich