carbon-core-system

Integration repository for versioned configuration and software on Carbon
git clone https://ccx.te2000.cz/git/carbon-core-system
Log | Files | Refs | Submodules

commit 4f673f1c149052f49c3bc1b12c1feeb342963d90
parent e745104433802308ef2d8e25c525c7625893d826
Author: ccx <root@dorje.wpr.cz>
Date:   Wed, 10 Mar 2021 21:48:54 +0100

Add /current symlink.

Diffstat:
Minstall | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/install b/install @@ -1,5 +1,7 @@ #!/bin/zsh setopt no_unset warn_create_global extended_glob +zmodload -F zsh/stat b:zstat +zmodload -m -F zsh/files b:zf_\* cd $0:h || exit $? require() { @@ -68,6 +70,17 @@ make_union() { } typeset -f -t make_union +check_current() { + local -A stat_out + [[ -L /current ]] || return 1 + zstat -L -H stat_out /current || return $? + [[ $stat_out[link] == ${${sm_dst[.]}#/} ]] +} +make_current() { + s6-ln -s -f -n "${${sm_dst[.]}#/}" /current +} +typeset -f -t make_union + typeset -g submodule typeset -gA sm_commit sm_dst @@ -84,3 +97,4 @@ require installed submodule=. require union +require current