1.1 --- a/tools/install.sh Mon May 29 21:18:33 2023 +0200
1.2 +++ b/tools/install.sh Wed May 31 16:41:49 2023 +0200
1.3 @@ -1,8 +1,27 @@
1.4 #!/bin/sh
1.5
1.6 -THISDIR=`dirname "$0"`
1.7 -DIRNAME=`readlink -f "$THISDIR/.."`
1.8 -PROGNAME=`basename "$0"`
1.9 +# Install the software in the L4Re source hierarchy.
1.10 +#
1.11 +# Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
1.12 +#
1.13 +# This program is free software; you can redistribute it and/or
1.14 +# modify it under the terms of the GNU General Public License as
1.15 +# published by the Free Software Foundation; either version 2 of
1.16 +# the License, or (at your option) any later version.
1.17 +#
1.18 +# This program is distributed in the hope that it will be useful,
1.19 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.20 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.21 +# GNU General Public License for more details.
1.22 +#
1.23 +# You should have received a copy of the GNU General Public License
1.24 +# along with this program; if not, write to the Free Software
1.25 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.26 +# Boston, MA 02110-1301, USA
1.27 +
1.28 +THISDIR=$(dirname "$0")
1.29 +DIRNAME=$(readlink -f "$THISDIR/..")
1.30 +PROGNAME=$(basename "$0")
1.31
1.32 if [ "$1" = '--help' ]; then
1.33 cat 1>&2 <<EOF
1.34 @@ -67,15 +86,15 @@
1.35 # Copy (or remove) each of the objects.
1.36
1.37 for OBJTYPE in 'conf' 'pkg' ; do
1.38 - TARGETDIR=`readlink -f "$L4DIR"`/$OBJTYPE
1.39 + TARGETDIR=$(readlink -f "$L4DIR")/$OBJTYPE
1.40 SOURCEDIR="$DIRNAME/$OBJTYPE"
1.41
1.42 # If cleaning, remove all objects.
1.43
1.44 if [ "$CLEAN" ] ; then
1.45 for OBJECT in "$SOURCEDIR/"* ; do
1.46 - OBJNAME=`basename "$OBJECT"`
1.47 - ORIGIN=`readlink -f "$OBJECT"`
1.48 + OBJNAME=$(basename "$OBJECT")
1.49 + ORIGIN=$(readlink -f "$OBJECT")
1.50 TARGET="$TARGETDIR/$OBJNAME"
1.51
1.52 if [ -d "$TARGET" ] ; then
1.53 @@ -90,8 +109,8 @@
1.54
1.55 # Make directories.
1.56
1.57 - for OBJECT in `find "$SOURCEDIR" -type d -print` ; do
1.58 - ORIGIN=`readlink -f "$OBJECT"`
1.59 + for OBJECT in $(find "$SOURCEDIR" -type d -print) ; do
1.60 + ORIGIN=$(readlink -f "$OBJECT")
1.61 RELPATH=${ORIGIN#$SOURCEDIR/}
1.62
1.63 # Skip top-level directories.
1.64 @@ -109,8 +128,8 @@
1.65
1.66 # Copy new files.
1.67
1.68 - for OBJECT in `find "$SOURCEDIR" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
1.69 - ORIGIN=`readlink -f "$OBJECT"`
1.70 + for OBJECT in $(find "$SOURCEDIR" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print) ; do
1.71 + ORIGIN=$(readlink -f "$OBJECT")
1.72 RELPATH=${ORIGIN#$SOURCEDIR/}
1.73 TARGET="$TARGETDIR/$RELPATH"
1.74
1.75 @@ -122,16 +141,16 @@
1.76 # Remove obsolete files.
1.77
1.78 for OBJECT in "$SOURCEDIR/"* ; do
1.79 - OBJNAME=`basename "$OBJECT"`
1.80 - ORIGIN=`readlink -f "$OBJECT"`
1.81 + OBJNAME=$(basename "$OBJECT")
1.82 + ORIGIN=$(readlink -f "$OBJECT")
1.83
1.84 # Examine the target object directory for files that are not provided
1.85 # by the distribution.
1.86
1.87 TARGET="$TARGETDIR/$OBJNAME"
1.88
1.89 - for FILENAME in `find "$TARGET" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
1.90 - PATHNAME=`readlink -f "$FILENAME"`
1.91 + for FILENAME in $(find "$TARGET" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print) ; do
1.92 + PATHNAME=$(readlink -f "$FILENAME")
1.93 RELPATH=${PATHNAME#$TARGET}
1.94 SOURCE="$ORIGIN/$RELPATH"
1.95
1.96 @@ -142,8 +161,8 @@
1.97
1.98 # Remove obsolete directories.
1.99
1.100 - for FILENAME in `find "$TARGET" -depth -type d -print` ; do
1.101 - PATHNAME=`readlink -f "$FILENAME"`
1.102 + for FILENAME in $(find "$TARGET" -depth -type d -print) ; do
1.103 + PATHNAME=$(readlink -f "$FILENAME")
1.104 RELPATH=${PATHNAME#$TARGET}
1.105 SOURCE="$ORIGIN/$RELPATH"
1.106
1.107 @@ -153,3 +172,5 @@
1.108 done
1.109 done
1.110 done
1.111 +
1.112 +# vim: tabstop=4 expandtab shiftwidth=4