fix filtering of VPP package for hc2vpp-pkg-push script 57/19257/1
authorMichal Cmarada <mcmarada@cisco.com>
Tue, 30 Apr 2019 11:21:48 +0000 (13:21 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Tue, 30 Apr 2019 11:21:48 +0000 (13:21 +0200)
Change-Id: I52caea21f55fda75def9540b5ea384f6e1901552
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
jjb/hc2vpp/include-raw-hc2vpp-pkg-push.sh

index 2f5e3d4..fbf06c0 100644 (file)
@@ -23,7 +23,10 @@ if [[ "${STREAM}" == "master" ]]; then
     else
         # Determine VPP Java API version used in maven build
         JVPP_VERSION=`apt list --installed | grep vpp-api-java | awk '{ printf $2; }'`
-        VERSION=`apt-cache showpkg vpp-api-java |grep "$JVPP_VERSION" |grep vpp | sed "s/.*(. //" | sed "s/).*//"`
+        # get vpp-api-java package dependencies
+        JVPP_DEPS=`apt-cache show vpp-api-java=${JVPP_VERSION} |grep Depends: | sed "s/Depends: //"`
+        # separate deps with newline, then find VPP dependency and filter out the version
+        VERSION=`echo ${JVPP_DEPS}| sed "s/, /\\n/" |grep "vpp " | sed "s/).*//" |sed "s/.* //"`
 
         # Write a file that will echo VPP dependencies
         echo -n 'echo' > vpp_dependencies