#!/bin/sh set -e if [ -e "setup.py" ] then ROOT_DIR="$PWD" elif [ -e "../setup.py" ] then ROOT_DIR="$PWD/../" else echo "Unable to locate 'setup.py' file that should" \ "exist in the cloud-init root directory." exit 1 fi CHNG_LOG="$ROOT_DIR/ChangeLog" if [ ! -e "$CHNG_LOG" ] then echo "Unable to find 'ChangeLog' file located at $CHNG_LOG" exit 1 fi VERSION=$(grep -P "\d+.\d+.\d+:" $CHNG_LOG | cut -f1 -d ":" | head -n 1) echo $VERSION