maj des chemins

This commit is contained in:
Jephté Clain 2014-07-08 11:03:07 +04:00
parent 5444f4cf3b
commit 52a3b381a5
10 changed files with 30 additions and 10 deletions

5
lib/local-uinst Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/ulib/ulib" || exit 1
urequire DEFAULTS uinst
uinst_nolocal "$@"

7
lib/local-uinst.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# Version de uinst qui fonctionne avec /bin/sh. Le contrôle est transmis à
# bash, qui est recherché dans une liste de répertoires standards
. `dirname "$0"`/ulib/ulibsh || exit 1
urequire DEFAULTS uinst
uinst_nolocal "$@"

View File

@ -24,7 +24,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
[ $# -eq 1 -a "$1" == "--help" ] && exit_with display_help

View File

@ -47,7 +47,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
function check_overwrite() {

View File

@ -47,7 +47,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
function check_overwrite() {

View File

@ -50,7 +50,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
function check_overwrite() {

View File

@ -53,7 +53,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
set_defaults nutools

View File

@ -47,7 +47,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
function check_overwrite() {

View File

@ -47,7 +47,7 @@ if [ $# -eq 2 ]; then
fi
#source /etc/ulib || exit 1
source "$(dirname "$0")/../../lib/ulib/ulib" || exit 1
source "$(dirname "$0")/../ulib/ulib" || exit 1
urequire DEFAULTS
function check_overwrite() {

14
ulib
View File

@ -184,7 +184,9 @@ sync)
#syncsupport=
}
[ -n "$destdir" ] || destdir="${1:-.}"
[ -n "$destdir" ] || destdir="$1"
[ -n "$destdir" ] || { [ -d lib ] && destdir=lib || destdir=.; }
ask_yesno "Voulez-vous copier ${synculib:+
- la librairie ulib}${syncpyulib:+
- la librairie pyulib}${syncsupport:+
@ -203,8 +205,8 @@ dans $(ppath "$destdir")?" O || die
pyulibsync "$destdir"
fi
if [ -n "$syncsupport" ]; then
for i in .nutools-bootstrap; do
adestdir="$(abspath "$destdir")"
for i in .nutools-bootstrap; do
if [ "${adestdir%/lib}" != "$adestdir" ]; then
# cas particulier: synchro vers un répertoire lib/
# dans ce cas, copier le fichier .nutools-bootstrap dans le
@ -214,8 +216,14 @@ dans $(ppath "$destdir")?" O || die
copy_update "$scriptdir/$i" "$destdir"
fi
done
# calculer le nom du répertoire de destination, pour nommer les fichiers
# local-uinst
destpfix="${adestdir%/lib}"
destpfix="${destpfix##*/}"
destpfix="${destpfix:-local}"
for i in lib/local-uinst lib/local-uinst.sh; do
copy_update "$scriptdir/$i" "$destdir"
destname="$destpfix-${i#lib/local-}"
copy_update "$scriptdir/$i" "$destdir/$destname"
done
fi
exit 0