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"
fi
if [ -n "$version" ]; then
vlname="${vlname#__pv-*__}"
else
vlname="${vlname#__pv-${version}__}"
else
vlname="${vlname#__pv-*__}"
fi
echo "$vldir$vlname"
}
@ -559,6 +559,7 @@ function sync_vlfiles() {
else
array_from_lines profiles "$(get_user_profiles "$pffdir")"
fi
local vlfile rfile prefix pfile plink tmp
for vlfile in "$@"; do
setx rfile=strip_pv "$vlfile"
@ -941,6 +942,7 @@ function new_cmd() {
}'
cat "$fcreates" "$fdeletes" >"$fcds"
grep -vxf "$fcds" "$fnsrc" >"$fupdates"
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 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
# les fichiers de fdeletes sont des fichiers locaux non identifiés comme tels dans l'origine
{ grep -vxf "$fcreates" "$flsrc"; cat "$fdeletes"; } >"$fupdates"
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=
enote "Fichiers origines: $((${#creates[*]} + ${#updates[*]})) au total, ${#creates[*]} nouveau(x)"