From c43d22d55cb89976e95c716716f4d7b3cd13a70b Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 28 Nov 2024 15:22:32 +0400 Subject: [PATCH] maj bbnurse --- bbnurse | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/bbnurse b/bbnurse index ccb687b..9b899b8 100755 --- a/bbnurse +++ b/bbnurse @@ -147,7 +147,41 @@ function update_nurse() { } function update_mature() { - : + srcpackage='nur\sery' + destpackage='nulib' + + [ -n "$Dest" ] || Dest=. + setx Dest=abspath "$Dest" + + etitle "Maturation de $srcpackage vers $destpackage" + sdestdir="$Dest/src" + if [ -d "$sdestdir" ]; then + setx rsdestdir=relpath "$sdestdir" "$Dest" + einfo "$rsdestdir" + setx -a sdests=find "$sdestdir" -type f + for sdest in "${sdests[@]}"; do + destname="${sdest#$Dest/src/}" + action "$destname" \ + sed -i "s|${srcpackage//\\/\\\\}|${destpackage//\\/\\\\}|g" "$sdest" + done + else + ewarn "$rsdestdir: répertoire non trouvé. il sera ignoré" + fi + + tdestdir="$Dest/tests" + if [ -d "$tdestdir" ]; then + setx rtdestdir=relpath "$tdestdir" "$Dest" + einfo "$rtdestdir" + setx -a tdests=find "$tdestdir" -type f + for tdest in "${tdests[@]}"; do + destname="${tdest#$Dest/tests/}" + action "$destname" \ + sed -i "s|${srcpackage//\\/\\\\}|${destpackage//\\/\\\\}|g" "$tdest" + done + else + ewarn "$rtdestdir: répertoire non trouvé. il sera ignoré" + fi + eend } action=copy @@ -160,8 +194,6 @@ args=( -cn SRC -u[n|m] package|Class [-d DEST] -IMPORTANT: pour l'instant, seule la copie à maturation (-cm) est implémentée - Il y a deux types d'évolutions possibles: * mettre en nurserie (-n) * arriver à maturation (-m)