1.1 --- a/tools/install.sh Tue Oct 24 18:52:06 2023 +0200
1.2 +++ b/tools/install.sh Fri Oct 27 18:02:49 2023 +0200
1.3 @@ -25,7 +25,7 @@
1.4
1.5 if [ "$1" = '--help' ]; then
1.6 cat 1>&2 <<EOF
1.7 -Usage: $PROGNAME <l4-directory> [ --clean ]
1.8 +Usage: $PROGNAME <l4-directory> [ --clean | --preserve ]
1.9
1.10 Copy the distributed packages into the "pkg" hierarchy found within the
1.11 specified directory. Also copy the distributed configuration examples into the
1.12 @@ -35,6 +35,9 @@
1.13 "conf" directory and a "pkg" directory inside it.
1.14
1.15 Specifying --clean removes copied objects.
1.16 +
1.17 +Specifying --preserve preserves files and directories in locations used by this
1.18 +distribution that are not (or are no longer) part of this distribution.
1.19 EOF
1.20 exit 1
1.21 fi
1.22 @@ -58,13 +61,15 @@
1.23 fi
1.24
1.25 L4DIR=$1
1.26 +CLEAN=
1.27 +PRESERVE=
1.28
1.29 # Determine the mode.
1.30
1.31 if [ "$2" = '--clean' ] ; then
1.32 CLEAN=$2
1.33 -else
1.34 - CLEAN=
1.35 +elif [ "$2" = '--preserve' ] ; then
1.36 + PRESERVE=$2
1.37 fi
1.38
1.39 # Check the configuration, if possible.
1.40 @@ -140,6 +145,10 @@
1.41
1.42 # Remove obsolete files.
1.43
1.44 + if [ "$PRESERVE" ] ; then
1.45 + continue
1.46 + fi
1.47 +
1.48 for OBJECT in "$SOURCEDIR/"* ; do
1.49 OBJNAME=$(basename "$OBJECT")
1.50 ORIGIN=$(readlink -f "$OBJECT")