This commit is contained in:
Jephté Clain 2021-05-27 13:32:46 +04:00
parent 111463a861
commit b3a44d07ad
1 changed files with 5 additions and 2 deletions

7
pff
View File

@ -507,9 +507,9 @@ function strip_pv() {
vlname="$vlfile" vlname="$vlfile"
fi fi
if [ -n "$version" ]; then if [ -n "$version" ]; then
vlname="${vlname#__pv-*__}"
else
vlname="${vlname#__pv-${version}__}" vlname="${vlname#__pv-${version}__}"
else
vlname="${vlname#__pv-*__}"
fi fi
echo "$vldir$vlname" echo "$vldir$vlname"
} }
@ -559,6 +559,7 @@ function sync_vlfiles() {
else else
array_from_lines profiles "$(get_user_profiles "$pffdir")" array_from_lines profiles "$(get_user_profiles "$pffdir")"
fi fi
local vlfile rfile prefix pfile plink tmp local vlfile rfile prefix pfile plink tmp
for vlfile in "$@"; do for vlfile in "$@"; do
setx rfile=strip_pv "$vlfile" setx rfile=strip_pv "$vlfile"
@ -941,6 +942,7 @@ function new_cmd() {
}' }'
cat "$fcreates" "$fdeletes" >"$fcds" cat "$fcreates" "$fdeletes" >"$fcds"
grep -vxf "$fcds" "$fnsrc" >"$fupdates" grep -vxf "$fcds" "$fnsrc" >"$fupdates"
local -a creates updates deletes r i have_creates have_updates have_deletes src dest local -a creates updates deletes r i have_creates have_updates have_deletes src dest
array_from_lines creates "$(<"$fcreates")"; [ ${#creates[*]} -gt 0 ] && have_creates=1 || have_creates= array_from_lines creates "$(<"$fcreates")"; [ ${#creates[*]} -gt 0 ] && have_creates=1 || have_creates=
array_from_lines updates "$(<"$fupdates")"; [ ${#updates[*]} -gt 0 ] && have_updates=1 || have_updates= array_from_lines updates "$(<"$fupdates")"; [ ${#updates[*]} -gt 0 ] && have_updates=1 || have_updates=
@ -1044,6 +1046,7 @@ function new_cmd() {
# contrairement aux fichiers normaux, ajouter le contenu de fdeletes à fupdates # contrairement aux fichiers normaux, ajouter le contenu de fdeletes à fupdates
# les fichiers de fdeletes sont des fichiers locaux non identifiés comme tels dans l'origine # les fichiers de fdeletes sont des fichiers locaux non identifiés comme tels dans l'origine
{ grep -vxf "$fcreates" "$flsrc"; cat "$fdeletes"; } >"$fupdates" { grep -vxf "$fcreates" "$flsrc"; cat "$fdeletes"; } >"$fupdates"
array_from_lines creates "$(<"$fcreates")"; [ ${#creates[*]} -gt 0 ] && have_creates=1 || have_creates= array_from_lines creates "$(<"$fcreates")"; [ ${#creates[*]} -gt 0 ] && have_creates=1 || have_creates=
array_from_lines updates "$(<"$fupdates")"; [ ${#updates[*]} -gt 0 ] && have_updates=1 || have_updates= array_from_lines updates "$(<"$fupdates")"; [ ${#updates[*]} -gt 0 ] && have_updates=1 || have_updates=
enote "Fichiers origines: $((${#creates[*]} + ${#updates[*]})) au total, ${#creates[*]} nouveau(x)" enote "Fichiers origines: $((${#creates[*]} + ${#updates[*]})) au total, ${#creates[*]} nouveau(x)"