Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[HEAD-183] add support for configure-branches file.

  • Loading branch information...
commit 5c081b579ae866a7d6f3bb1593ba9d1ed1938ee5 1 parent adca1c1
@joshwilsdon joshwilsdon authored
Showing with 44 additions and 2 deletions.
  1. +1 −0  .gitignore
  2. +4 −2 Makefile
  3. +39 −0 configure
View
1  .gitignore
@@ -1,4 +1,5 @@
/configure.*
+/configure-branches
/output
/projects
/proto
View
6 Makefile
@@ -3,6 +3,7 @@
ROOT=$(PWD)
PROTO=$(ROOT)/proto
PATH=/opt/local/bin:/opt/local/sbin:/opt/local/gcc34/bin:/usr/xpg4/bin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin
+LOCAL_SUBDIRS="ur-agent"
world: 0-illumos-stamp 0-extra-stamp 0-livesrc-stamp 0-local-stamp 0-tools-stamp
@@ -14,9 +15,10 @@ update:
@(git pull --rebase)
@(cd projects/illumos; git pull --rebase)
@(cd projects/illumos-extra; git pull --rebase)
+ [ ! -d projects/local ] || for dir in $(LOCAL_SUBDIRS); do (cd projects/local/$${dir} && git pull --rebase); done
0-local-stamp:
- [ ! -d projects/local ] || (cd projects/local && gmake && gmake DESTDIR=$(PROTO) install)
+ [ ! -d projects/local ] || for dir in $(LOCAL_SUBDIRS); do (cd projects/local/$${dir} && gmake && gmake DESTDIR=$(PROTO) install); done
0-illumos-stamp:
(cd $(ROOT) && ./tools/build_illumos)
@@ -43,7 +45,7 @@ tools/cryptpass: tools/cryptpass.c
clean:
(cd $(ROOT)/src && gmake clean)
(cd $(ROOT)/projects/illumos-extra && gmake clean)
- [ ! -d projects/local ] || (cd projects/local && gmake clean)
+ [ ! -d projects/local ] || for dir in $(LOCAL_SUBDIRS); do (cd projects/local/$${dir} && gmake clean); done
(cd $(ROOT) && rm -rf $(PROTO))
(cd $(ROOT) && mkdir -p $(PROTO))
rm -f 0-*-stamp
View
39 configure
@@ -204,6 +204,45 @@ gsed -i -e "s|^PARENT_ROOT=.*$|PARENT_ROOT="${ROOT}/proto"; export PARENT_ROOT|"
# For some reason this disappeared before
touch ${ROOT}/projects/illumos/usr/src/tools/findunref/exception_list.unknown
+function update_branch
+{
+ target_dir=$1
+ target=$2
+
+ oldwd=$(pwd)
+ cd ${target_dir}
+ current=$(git branch | grep "^*" | cut -d' ' -f2)
+ if [[ "${current}" != "${target}" ]]; then
+ if [[ -n $(git branch | grep " ${target}$") ]]; then
+ # have branch already, checkout
+ git checkout ${target}
+ else
+ # don't have, add to tracking and checkout
+ git checkout --track -b ${target} origin/${target}
+ fi
+ fi
+ cd ${oldwd}
+
+ return 0
+}
+
+# Setup branches
+if [[ -f ${ROOT}/configure-branches ]]; then
+ branch=$(grep "^illumos-live: " ${ROOT}/configure-branches | cut -d' ' -f2)
+ [[ -z ${branch} ]] && update_branch "${ROOT}" ${branch}
+ branch=$(grep "^illumos-extra: " ${ROOT}/configure-branches | cut -d' ' -f2)
+ [[ -z ${branch} ]] && update_branch "${ROOT}/projects/illumos-extra" ${branch}
+ branch=$(grep "^illumos-joyent: " ${ROOT}/configure-branches | cut -d' ' -f2)
+ [[ -z ${branch} ]] && update_branch "${ROOT}/projects/illumos" ${branch}
+ branch=$(grep "^ur-agent: " ${ROOT}/configure-branches | cut -d' ' -f2)
+ [[ -z ${branch} ]] && update_branch "${ROOT}/projects/local/ur-agent" ${branch}
+else
+ echo ""
+ echo "WARNING! No configure-branches file!!! Using master branch for everything!"
+ echo ""
+ sleep 3
+fi
+
echo ""
echo "Configuration complete. You should now be able to build a live image using 'make world && make live'"
echo ""
Please sign in to comment.
Something went wrong with that request. Please try again.