From 09f7ad16806f320f8dcdee6c0e3d5e2c781dc134 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 22 May 2026 09:20:35 -0400 Subject: [PATCH] xo-cmake: xo-build + git subtree for satellites xo-build --add-umbrella-remote XONAME --pull-umbrella-remote XONAME --push-umbrella-remote XONAME --- bin/xo-build.in | 84 +++++++++++++++++++++++++++++++++++++++---- etc/xo/subsystem-list | 1 + 2 files changed, 78 insertions(+), 7 deletions(-) diff --git a/bin/xo-build.in b/bin/xo-build.in index 9c36b43..4f1caf9 100644 --- a/bin/xo-build.in +++ b/bin/xo-build.in @@ -6,10 +6,12 @@ usage() { cat < 0 ]]; do case "$1" in @@ -98,9 +107,6 @@ while [[ $# > 0 ]]; do --xoname=*) xoname="${1#*=}" ;; - --repo) - repo_flag=1 - ;; --clone) clone_flag=1 ;; @@ -137,6 +143,18 @@ while [[ $# > 0 ]]; do --with-vulkan=*) with_vulkan="${1#*=}" ;; + --repo) + repo_flag=1 + ;; + --add-umbrella-remote) + add_umbrella_remote_flag=1 + ;; + --pull-umbrella-remote) + pull_umbrella_remote_flag=1 + ;; + --push-umbrella-remote) + push_umbrella_remote_flag=1 + ;; xo-*) xoname="$1" ;; @@ -169,7 +187,12 @@ subsystem_list() { cat ${SUBSYSTEMLIST_FILE} } -XO_REPO_STEM="https://github.com/Rconybea" +XO_REPO_STEM= +if [[ $(whoami) == "roland" ]]; then + XO_REPO_STEM="git@github.com:Rconybea" +else + XO_REPO_STEM="https://github.com/Rconybea" +fi printrepo() { xoname=$1 @@ -222,6 +245,52 @@ if [[ $repo_flag -eq 1 ]]; then fi fi +if [[ $add_umbrella_remote_flag -eq 1 ]]; then + if [[ $clone_flag -eq 1 || $configure_flag -eq 1 || $build_flag -eq 1 || $build_docs_flag -eq 1 || $install_flag -eq 1 || $realclean_flag -eq 1 ]]; then + 2>&1 echo "error: xo-build: repo operation --add-umbrella-remote conflicts with" + 2>&1 echo " build operation --clone|--configure|--build|--build-docs|--install|--realclean" + exit 1 + fi + + if [[ -n "$xoname" ]]; then + url=$(printrepo $xoname) + + cmd="git remote add $xoname $url" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $pull_umbrella_remote_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + branch=$(git branch --show-current) + cmd="git subtree pull --prefix=$xoname $xoname ${branch}" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $push_umbrella_remote_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + branch=$(git branch --show-current) + cmd="git subtree push --prefix=$xoname $xoname ${branch}" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + if [[ $clone_flag -eq 1 ]]; then if [[ -n "$xoname" ]]; then url=$(printrepo $xoname) @@ -243,6 +312,7 @@ if [[ $configure_flag -eq 1 ]]; then testingarg="-DENABLE_TESTING=1" fi + asmarg= if [[ $with_asm -eq 1 ]]; then asmarg="-DENABLE_ASM=1" fi diff --git a/etc/xo/subsystem-list b/etc/xo/subsystem-list index 555bd2e..900cbb1 100644 --- a/etc/xo/subsystem-list +++ b/etc/xo/subsystem-list @@ -4,6 +4,7 @@ xo-alloc xo-object xo-refcnt xo-subsys +xo-testutil xo-randomgen xo-ordinaltree xo-pyutil