#!/bin/bash if [[ ! -f $GVM_ROOT/go ]]; then echo "ERROR: No Go version selected" exit 1 fi if [[ ! -f $GVM_ROOT/pkgs ]]; then echo "ERROR: No package set selected" exit 1 fi CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'` CUR_PKGSET=`readlink $GVM_ROOT/pkgs | awk '{ n=split($1,path,"/"); print path[n] }'` echo " gvm packages $CUR_PKGSET@$CUR_VER" echo for package in $GVM_ROOT/pkgs/pkg.gvm/*; do if [ $package == "$GVM_ROOT/pkgs/pkg.gvm/*" ]; then break fi package_name=`echo $package | awk '{ n=split($1,path,"/"); print path[n] }'` output=$package_name" (" first=true for version in $package/*; do version=`echo $version | awk '{ n=split($1,path,"/"); print path[n] }'` if [ "$version" != "current" ]; then if [ $first == true ]; then first=false else output=$output", " fi version=`echo $version | awk '{ n=split($1,path,"/"); print path[n] }'` output=$output$version fi done output=$output")" echo $output done echo