mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Merge 08ef49759c
into 76ce3defea
This commit is contained in:
commit
d61062eae8
@ -12,7 +12,7 @@ ALT_DIR = "test alt/test alt dir"
|
|||||||
|
|
||||||
# Directory based alternates must have a tracked contained file.
|
# Directory based alternates must have a tracked contained file.
|
||||||
# This will be the test contained file name
|
# This will be the test contained file name
|
||||||
CONTAINED = "contained_file"
|
CONTAINED = "contained_dir/contained_file"
|
||||||
|
|
||||||
# These variables are used for making include files which will be processed
|
# These variables are used for making include files which will be processed
|
||||||
# within jinja templates
|
# within jinja templates
|
||||||
|
20
yadm
20
yadm
@ -461,7 +461,7 @@ EOF
|
|||||||
-v distro="$local_distro" \
|
-v distro="$local_distro" \
|
||||||
-v distro_family="$local_distro_family" \
|
-v distro_family="$local_distro_family" \
|
||||||
-v source="$input" \
|
-v source="$input" \
|
||||||
-v source_dir="$(dirname "$input")" \
|
-v source_dir="$(builtin_dirname "$input")" \
|
||||||
-v classes="$(join_string $'\n' "${local_classes[@]}")" \
|
-v classes="$(join_string $'\n' "${local_classes[@]}")" \
|
||||||
"$awk_pgm" \
|
"$awk_pgm" \
|
||||||
"$input" > "$temp_file" || rm -f "$temp_file"
|
"$input" > "$temp_file" || rm -f "$temp_file"
|
||||||
@ -692,9 +692,21 @@ function alt_linking() {
|
|||||||
local alt_sources=()
|
local alt_sources=()
|
||||||
local alt_template_cmds=()
|
local alt_template_cmds=()
|
||||||
|
|
||||||
for alt_path in $(for tracked in "${tracked_files[@]}"; do printf "%s\n" "$tracked" "${tracked%/*}"; done | LC_ALL=C sort -u) "${ENCRYPT_INCLUDE_FILES[@]}"; do
|
for tracked_file in $(printf "%s\n" "${tracked_files[@]}" | LC_ALL=C sort -u) "${ENCRYPT_INCLUDE_FILES[@]}"; do
|
||||||
alt_path="$YADM_BASE/$alt_path"
|
tracked_file="$YADM_BASE/$tracked_file"
|
||||||
if [[ "$alt_path" =~ .\#\#. ]]; then
|
if [[ "$tracked_file" =~ .\#\#. ]]; then
|
||||||
|
local alt_path=$tracked_file
|
||||||
|
|
||||||
|
# Walk up the path until we find the last component with a ## marker;
|
||||||
|
# that will be the source of the alt symlink
|
||||||
|
while : ; do
|
||||||
|
local tmp;
|
||||||
|
tmp="$(builtin_dirname "$alt_path")"
|
||||||
|
[[ "$tmp" =~ .\#\#. ]] || break
|
||||||
|
alt_path=$tmp
|
||||||
|
done
|
||||||
|
|
||||||
|
debug "Found alt at '$alt_path'"
|
||||||
if [ -e "$alt_path" ] ; then
|
if [ -e "$alt_path" ] ; then
|
||||||
score_file "$alt_path"
|
score_file "$alt_path"
|
||||||
fi
|
fi
|
||||||
|
2
yadm.1
2
yadm.1
@ -595,7 +595,7 @@ If no "##default" version exists and no files have valid conditions, then no
|
|||||||
link will be created.
|
link will be created.
|
||||||
|
|
||||||
Links are also created for directories named this way, as long as they have at
|
Links are also created for directories named this way, as long as they have at
|
||||||
least one yadm managed file within them (at the top level).
|
least one yadm managed file as a descendant.
|
||||||
|
|
||||||
yadm will automatically create these links by default. This can be disabled
|
yadm will automatically create these links by default. This can be disabled
|
||||||
using the
|
using the
|
||||||
|
2
yadm.md
2
yadm.md
@ -488,7 +488,7 @@
|
|||||||
then no link will be created.
|
then no link will be created.
|
||||||
|
|
||||||
Links are also created for directories named this way, as long as they
|
Links are also created for directories named this way, as long as they
|
||||||
have at least one yadm managed file within them (at the top level).
|
have at least one yadm managed file as a descendant.
|
||||||
|
|
||||||
yadm will automatically create these links by default. This can be dis‐
|
yadm will automatically create these links by default. This can be dis‐
|
||||||
abled using the yadm.auto-alt configuration. Even if disabled, links
|
abled using the yadm.auto-alt configuration. Even if disabled, links
|
||||||
|
Loading…
Reference in New Issue
Block a user