Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 49 lines (41 sloc) 1.28 kb
a5cddc9 @joshwilsdon [HEAD-84] include git data with platform builds.
joshwilsdon authored
1 #!/bin/bash
2
3 if [[ -z ${ROOT} ]]; then
4 ROOT=$(pwd)
5 fi
6
7 function get_status()
8 {
9 dir=$1
10
11 if [[ -z ${dir} ]]; then
12 echo "WARNING: skilling empty \$dir"
13 return 0
14 fi
15
16 oldpwd=$(pwd)
17 cd ${dir}
18 branch=$(git branch | grep "^* " | cut -d ' ' -f2)
19 rev=$(git rev-parse HEAD)
20
21 if [[ -n ${branch} ]] && [[ -n ${rev} ]]; then
22 echo "\"branch\": \"${branch}\", \"rev\": \"${rev}\""
23 else
24 echo "\"branch\": \"unknown\""
25 fi
26
27 cd ${oldpwd}
28 }
6f7bf23 @JohnSonnenschein [OS-862] Change /etc/release to say "SmartOS"
JohnSonnenschein authored
29 function get_status_extra()
30 {
31 extra_tarball=$(basename `ls ${ROOT}/illumos-extra*.tgz |tail -n1`)
32 if [[ -n ${extra_tarball} ]]; then
33 branch=$(echo ${extra_tarball} | /usr/bin/cut -d '-' -f 3)
34 rev=$(echo ${extra_tarball} | cut -d '-' -f 5 | cut -d '.' -f 1 | sed -e 's/.//')
35 echo "\"branch\": \"${branch}\", \"rev\": \"${rev}\""
36 else
37 get_status ${ROOT}/projects/illumos-extra
38 fi
39 }
a5cddc9 @joshwilsdon [HEAD-84] include git data with platform builds.
joshwilsdon authored
40
41 echo "["
42 echo " { \"repo\": \"illumos-live\", $(get_status ${ROOT}) }"
6f7bf23 @JohnSonnenschein [OS-862] Change /etc/release to say "SmartOS"
JohnSonnenschein authored
43 echo " , { \"repo\": \"illumos-extra\", $(get_status_extra) }"
a5cddc9 @joshwilsdon [HEAD-84] include git data with platform builds.
joshwilsdon authored
44 echo " , { \"repo\": \"illumos-joyent\", $(get_status ${ROOT}/projects/illumos) }"
6f7bf23 @JohnSonnenschein [OS-862] Change /etc/release to say "SmartOS"
JohnSonnenschein authored
45 if [[ -d ${ROOT}/projects/local/ur-agent ]]; then
46 echo " , { \"repo\": \"ur-agent\", $(get_status ${ROOT}/projects/local/ur-agent) }"
47 fi
a5cddc9 @joshwilsdon [HEAD-84] include git data with platform builds.
joshwilsdon authored
48 echo "]"
Something went wrong with that request. Please try again.