Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: release-201211…
Fetching contributors…

Cannot retrieve contributors at this time

executable file 49 lines (41 sloc) 1.28 kb
#!/bin/bash
if [[ -z ${ROOT} ]]; then
ROOT=$(pwd)
fi
function get_status()
{
dir=$1
if [[ -z ${dir} ]]; then
echo "WARNING: skilling empty \$dir"
return 0
fi
oldpwd=$(pwd)
cd ${dir}
branch=$(git branch | grep "^* " | cut -d ' ' -f2)
rev=$(git rev-parse HEAD)
if [[ -n ${branch} ]] && [[ -n ${rev} ]]; then
echo "\"branch\": \"${branch}\", \"rev\": \"${rev}\""
else
echo "\"branch\": \"unknown\""
fi
cd ${oldpwd}
}
function get_status_extra()
{
extra_tarball=$(basename `ls ${ROOT}/illumos-extra*.tgz |tail -n1`)
if [[ -n ${extra_tarball} ]]; then
branch=$(echo ${extra_tarball} | /usr/bin/cut -d '-' -f 3)
rev=$(echo ${extra_tarball} | cut -d '-' -f 5 | cut -d '.' -f 1 | sed -e 's/.//')
echo "\"branch\": \"${branch}\", \"rev\": \"${rev}\""
else
get_status ${ROOT}/projects/illumos-extra
fi
}
echo "["
echo " { \"repo\": \"illumos-live\", $(get_status ${ROOT}) }"
echo " , { \"repo\": \"illumos-extra\", $(get_status_extra) }"
echo " , { \"repo\": \"illumos-joyent\", $(get_status ${ROOT}/projects/illumos) }"
if [[ -d ${ROOT}/projects/local/ur-agent ]]; then
echo " , { \"repo\": \"ur-agent\", $(get_status ${ROOT}/projects/local/ur-agent) }"
fi
echo "]"
Jump to Line
Something went wrong with that request. Please try again.