diff --git a/pff b/pff index d99b670..47ac7b1 100755 --- a/pff +++ b/pff @@ -199,6 +199,7 @@ supportées sont: # pfile: le chemin absolu du fichier dans le projet # rfile: le chemin relatif du fichier dans le projet # bfile: le chemin absolu du fichier dans pff/Base/ +# Cfile: le chemin absolu du fichier dans pff/Common/ # cfile: le chemin absolu du fichier dans pff/Current/ # Pfile: le chemin absolu du fichier dans pff/ANYPROFILE/ # plink: la destination du lien pfile @@ -312,6 +313,7 @@ function get_pfile() { echo "$pffdir/pff/$profile/$pfile" } function get_bfile() { get_pfile "$1" Base "$2"; } +function get_Cfile() { get_pfile "$1" Common "$2"; } function get_cfile() { get_pfile "$1" Current "$2"; } function get_vlfiles() { @@ -374,6 +376,8 @@ function select_profile() { src="$pffdir/pff/Current/$lfile" if [ -f "$pffdir/pff/$profile/$lfile" ]; then dest="$profile/$lfile" + elif [ "$profile" != Common -a -f "$pffdir/pff/Common/$lfile" ]; then + dest="Common/$lfile" else dest="Base/$lfile" fi @@ -880,8 +884,14 @@ function add_local__link() { setx Pfile=get_pfile "$pfile" "$profile" "$pffdir" [ -e "$Pfile" ] && return 0 # créer le fichier local + setx Cfile=get_Cfile "$pfile" "$pffdir" mkdirof "$Pfile" - cp "$bfile" "$Pfile" + if [ -e "$Cfile" ]; then + # copier depuis le profil Common par défaut + cp "$Cfile" "$Pfile" + else + cp "$bfile" "$Pfile" + fi # mettre à jour le profil courant setx cfile=get_cfile "$pfile" "$pffdir" setx clink=multiups "Current/$rfile" "$profile/$rfile"