commit 46cf16c84096e8d6a905c9fbae877712182b3766 parent 35e8253b1d59545b03d037e8d5c441542b563ad6 Author: ccx <root@dorje.wpr.cz> Date: Wed, 10 Mar 2021 21:34:44 +0100 Create unified target directory for all submodules. Diffstat:
M | install | | | 24 | ++++++++++++++++++++---- |
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/install b/install @@ -50,17 +50,33 @@ make_installed() { } typeset -f -t make_installed +check_union() { + [[ -f ${sm_dst[.]}/.done ]] +} +make_union() { + mkdir -p ${sm_dst[.]} || exit $? + local sm union_from f + for sm union_from in "${(kv@)sm_dst}"; do + for f in $union_from/*; do + ln -s ../${union_from:t}/${f:t} ${sm_dst[.]}/ || exit $? + done + done + touch ${sm_dst[.]}/.done +} + typeset -g submodule typeset -gA sm_commit sm_dst submodule=. require committed +sm_commit[.]=$(git show -s --pretty=format:%H%n) || exit $? +sm_dst[.]=/versions/all.${sm_commit[.]} submodule=package #require committed - -# read into globals here sm_commit[$submodule]=$(cd $submodule && git show -s --pretty=format:%H%n) || exit $? -sm_dst[$submodule]=/versions/package.${sm_commit[$submodule]} - +sm_dst[$submodule]=/versions/$submodule.${sm_commit[$submodule]} require installed + +submodule=. +require union