1.1 --- a/tools/checkconfig.sh Mon May 29 21:18:33 2023 +0200
1.2 +++ b/tools/checkconfig.sh Wed May 31 16:41:49 2023 +0200
1.3 @@ -1,8 +1,28 @@
1.4 #!/bin/sh
1.5
1.6 -THISDIR=`dirname "$0"`
1.7 -DIRNAME=`readlink -f "$THISDIR/.."`
1.8 -PROGNAME=`basename "$0"`
1.9 +# Customise the configuration of the software for a particular target
1.10 +# platform.
1.11 +#
1.12 +# Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
1.13 +#
1.14 +# This program is free software; you can redistribute it and/or
1.15 +# modify it under the terms of the GNU General Public License as
1.16 +# published by the Free Software Foundation; either version 2 of
1.17 +# the License, or (at your option) any later version.
1.18 +#
1.19 +# This program is distributed in the hope that it will be useful,
1.20 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.21 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.22 +# GNU General Public License for more details.
1.23 +#
1.24 +# You should have received a copy of the GNU General Public License
1.25 +# along with this program; if not, write to the Free Software
1.26 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.27 +# Boston, MA 02110-1301, USA
1.28 +
1.29 +THISDIR=$(dirname "$0")
1.30 +DIRNAME=$(readlink -f "$THISDIR/..")
1.31 +PROGNAME=$(basename "$0")
1.32
1.33 if [ "$1" = '--help' ] || [ ! "$1" ] ; then
1.34 cat 1>&2 <<EOF
1.35 @@ -48,7 +68,7 @@
1.36
1.37 # Set the platform and the installation as target.
1.38
1.39 - PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$FILENAME" | sed 's/^.*"\(.*\)".*$/\1/'`
1.40 + PLATFORM=$(grep -e 'CONFIG_PLATFORM_TYPE=' "$FILENAME" | sed 's/^.*=//;s/"//g')
1.41 TARGETDIR="$1"
1.42 break
1.43 else
1.44 @@ -113,3 +133,5 @@
1.45 # Write it to the configuration file.
1.46
1.47 echo -n "$KEYPADLIB" > "$KEYPADCONF"
1.48 +
1.49 +# vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/tools/install.sh Mon May 29 21:18:33 2023 +0200
2.2 +++ b/tools/install.sh Wed May 31 16:41:49 2023 +0200
2.3 @@ -1,8 +1,27 @@
2.4 #!/bin/sh
2.5
2.6 -THISDIR=`dirname "$0"`
2.7 -DIRNAME=`readlink -f "$THISDIR/.."`
2.8 -PROGNAME=`basename "$0"`
2.9 +# Install the software in the L4Re source hierarchy.
2.10 +#
2.11 +# Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
2.12 +#
2.13 +# This program is free software; you can redistribute it and/or
2.14 +# modify it under the terms of the GNU General Public License as
2.15 +# published by the Free Software Foundation; either version 2 of
2.16 +# the License, or (at your option) any later version.
2.17 +#
2.18 +# This program is distributed in the hope that it will be useful,
2.19 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2.20 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.21 +# GNU General Public License for more details.
2.22 +#
2.23 +# You should have received a copy of the GNU General Public License
2.24 +# along with this program; if not, write to the Free Software
2.25 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
2.26 +# Boston, MA 02110-1301, USA
2.27 +
2.28 +THISDIR=$(dirname "$0")
2.29 +DIRNAME=$(readlink -f "$THISDIR/..")
2.30 +PROGNAME=$(basename "$0")
2.31
2.32 if [ "$1" = '--help' ]; then
2.33 cat 1>&2 <<EOF
2.34 @@ -67,15 +86,15 @@
2.35 # Copy (or remove) each of the objects.
2.36
2.37 for OBJTYPE in 'conf' 'pkg' ; do
2.38 - TARGETDIR=`readlink -f "$L4DIR"`/$OBJTYPE
2.39 + TARGETDIR=$(readlink -f "$L4DIR")/$OBJTYPE
2.40 SOURCEDIR="$DIRNAME/$OBJTYPE"
2.41
2.42 # If cleaning, remove all objects.
2.43
2.44 if [ "$CLEAN" ] ; then
2.45 for OBJECT in "$SOURCEDIR/"* ; do
2.46 - OBJNAME=`basename "$OBJECT"`
2.47 - ORIGIN=`readlink -f "$OBJECT"`
2.48 + OBJNAME=$(basename "$OBJECT")
2.49 + ORIGIN=$(readlink -f "$OBJECT")
2.50 TARGET="$TARGETDIR/$OBJNAME"
2.51
2.52 if [ -d "$TARGET" ] ; then
2.53 @@ -90,8 +109,8 @@
2.54
2.55 # Make directories.
2.56
2.57 - for OBJECT in `find "$SOURCEDIR" -type d -print` ; do
2.58 - ORIGIN=`readlink -f "$OBJECT"`
2.59 + for OBJECT in $(find "$SOURCEDIR" -type d -print) ; do
2.60 + ORIGIN=$(readlink -f "$OBJECT")
2.61 RELPATH=${ORIGIN#$SOURCEDIR/}
2.62
2.63 # Skip top-level directories.
2.64 @@ -109,8 +128,8 @@
2.65
2.66 # Copy new files.
2.67
2.68 - for OBJECT in `find "$SOURCEDIR" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
2.69 - ORIGIN=`readlink -f "$OBJECT"`
2.70 + for OBJECT in $(find "$SOURCEDIR" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print) ; do
2.71 + ORIGIN=$(readlink -f "$OBJECT")
2.72 RELPATH=${ORIGIN#$SOURCEDIR/}
2.73 TARGET="$TARGETDIR/$RELPATH"
2.74
2.75 @@ -122,16 +141,16 @@
2.76 # Remove obsolete files.
2.77
2.78 for OBJECT in "$SOURCEDIR/"* ; do
2.79 - OBJNAME=`basename "$OBJECT"`
2.80 - ORIGIN=`readlink -f "$OBJECT"`
2.81 + OBJNAME=$(basename "$OBJECT")
2.82 + ORIGIN=$(readlink -f "$OBJECT")
2.83
2.84 # Examine the target object directory for files that are not provided
2.85 # by the distribution.
2.86
2.87 TARGET="$TARGETDIR/$OBJNAME"
2.88
2.89 - for FILENAME in `find "$TARGET" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
2.90 - PATHNAME=`readlink -f "$FILENAME"`
2.91 + for FILENAME in $(find "$TARGET" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print) ; do
2.92 + PATHNAME=$(readlink -f "$FILENAME")
2.93 RELPATH=${PATHNAME#$TARGET}
2.94 SOURCE="$ORIGIN/$RELPATH"
2.95
2.96 @@ -142,8 +161,8 @@
2.97
2.98 # Remove obsolete directories.
2.99
2.100 - for FILENAME in `find "$TARGET" -depth -type d -print` ; do
2.101 - PATHNAME=`readlink -f "$FILENAME"`
2.102 + for FILENAME in $(find "$TARGET" -depth -type d -print) ; do
2.103 + PATHNAME=$(readlink -f "$FILENAME")
2.104 RELPATH=${PATHNAME#$TARGET}
2.105 SOURCE="$ORIGIN/$RELPATH"
2.106
2.107 @@ -153,3 +172,5 @@
2.108 done
2.109 done
2.110 done
2.111 +
2.112 +# vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/tools/listlibs.sh Mon May 29 21:18:33 2023 +0200
3.2 +++ b/tools/listlibs.sh Wed May 31 16:41:49 2023 +0200
3.3 @@ -1,8 +1,27 @@
3.4 #!/bin/sh
3.5
3.6 -CONF="$1"
3.7 +# List the modules required by a particular L4Re program configuration.
3.8 +#
3.9 +# Copyright (C) 2018, 2019, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
3.10 +#
3.11 +# This program is free software; you can redistribute it and/or
3.12 +# modify it under the terms of the GNU General Public License as
3.13 +# published by the Free Software Foundation; either version 2 of
3.14 +# the License, or (at your option) any later version.
3.15 +#
3.16 +# This program is distributed in the hope that it will be useful,
3.17 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
3.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.19 +# GNU General Public License for more details.
3.20 +#
3.21 +# You should have received a copy of the GNU General Public License
3.22 +# along with this program; if not, write to the Free Software
3.23 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
3.24 +# Boston, MA 02110-1301, USA
3.25
3.26 -if [ ! "$CONF" ] || [ ! -e "$CONF" ] ; then
3.27 +MODULES="$1"
3.28 +
3.29 +if [ ! "$MODULES" ] || [ ! -e "$MODULES" ] ; then
3.30 cat 1>&2 <<EOF
3.31 Usage: $0 <module list filename> [ --ignore-missing ] [ <arch> ] [ <build directory> ]
3.32
3.33 @@ -17,6 +36,8 @@
3.34 exit 1
3.35 fi
3.36
3.37 +# Skip the module list file.
3.38 +
3.39 shift 1
3.40
3.41 # Get flag.
3.42 @@ -64,8 +85,6 @@
3.43 # Test for architecture-specific program directories.
3.44
3.45 for FILENAME in "$BUILDDIR/bin/"* ; do
3.46 - BASENAME=`basename "$FILENAME"`
3.47 -
3.48 if [ "$FILENAME" = "$BUILDDIR/bin/*" ] ; then
3.49 cat 1>&2 <<EOF
3.50 No architecture-specific directories in the build directory hierarchy:
3.51 @@ -73,7 +92,13 @@
3.52 $BUILDDIR/bin
3.53 EOF
3.54 exit 1
3.55 - elif [ ! "$ARCH" ] || [ "${ARCH}_gen" = "$BASENAME" ] ; then
3.56 + fi
3.57 +
3.58 + BASENAME=$(basename "$FILENAME")
3.59 +
3.60 + if [ "$BASENAME" = 'host' ] ; then
3.61 + :
3.62 + elif [ ! "$ARCH" ] || [ "$ARCH" = "$BASENAME" ] ; then
3.63 ARCHDIR="$BASENAME"
3.64 break
3.65 fi
3.66 @@ -83,8 +108,16 @@
3.67
3.68 if [ ! "$ARCHDIR" ] ; then
3.69 cat 1>&2 <<EOF
3.70 -No architecture specified or no appropriate program directory found.
3.71 +Architecture not in use or no appropriate program directory found.
3.72 +Possible architectures are as follows:
3.73 +
3.74 EOF
3.75 + for FILENAME in "$BUILDDIR/bin/"* ; do
3.76 + ARCH=$(basename "$FILENAME")
3.77 + if [ "$ARCH" != 'host' ] ; then
3.78 + echo "$ARCH"
3.79 + fi
3.80 + done
3.81 exit 1
3.82 fi
3.83
3.84 @@ -95,25 +128,26 @@
3.85
3.86 echo -n > "$TMPLIBS"
3.87
3.88 -for MODULE in `grep '^module ' "$CONF" | sed 's/module //'` ; do
3.89 - PROG=`basename "$MODULE" .cfg`
3.90 +for MODULE in $(grep '^module ' "$MODULES" | sed 's/module //') ; do
3.91 + PROG=$(basename "$MODULE" .cfg)
3.92 if [ "$PROG" != "$MODULE" ] ; then
3.93 continue
3.94 fi
3.95 - PROG=`basename "$MODULE" .io`
3.96 + PROG=$(basename "$MODULE" .io)
3.97 if [ "$PROG" != "$MODULE" ] ; then
3.98 continue
3.99 fi
3.100 - PROG=`basename "$MODULE" .so`
3.101 + PROG=$(basename "$MODULE" .so)
3.102 if [ "$PROG" != "$MODULE" ] ; then
3.103 continue
3.104 fi
3.105 - PROG=`basename "$MODULE" .txt`
3.106 + PROG=$(basename "$MODULE" .txt)
3.107 if [ "$PROG" != "$MODULE" ] ; then
3.108 continue
3.109 fi
3.110 if [ ! -e "$BIN/$PROG" ] && [ ! "$IGNORE_MISSING" ] ; then
3.111 echo "Not found: $PROG" 1>&2
3.112 + rm "$TMPLIBS"
3.113 exit 1
3.114 fi
3.115
3.116 @@ -128,3 +162,5 @@
3.117
3.118 sort -u "$TMPLIBS" | sed 's/^/module /'
3.119 rm "$TMPLIBS"
3.120 +
3.121 +# vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/tools/makecontrol.sh Mon May 29 21:18:33 2023 +0200
4.2 +++ b/tools/makecontrol.sh Wed May 31 16:41:49 2023 +0200
4.3 @@ -1,6 +1,25 @@
4.4 #!/bin/sh
4.5
4.6 -PROGNAME=`basename "$0"`
4.7 +# Update package Control files.
4.8 +#
4.9 +# Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
4.10 +#
4.11 +# This program is free software; you can redistribute it and/or
4.12 +# modify it under the terms of the GNU General Public License as
4.13 +# published by the Free Software Foundation; either version 2 of
4.14 +# the License, or (at your option) any later version.
4.15 +#
4.16 +# This program is distributed in the hope that it will be useful,
4.17 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
4.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.19 +# GNU General Public License for more details.
4.20 +#
4.21 +# You should have received a copy of the GNU General Public License
4.22 +# along with this program; if not, write to the Free Software
4.23 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
4.24 +# Boston, MA 02110-1301, USA
4.25 +
4.26 +PROGNAME=$(basename "$0")
4.27
4.28 if [ "$1" = '--help' ] || [ ! "$1" ] || [ ! -e "$1" ] ; then
4.29 cat 1>&2 <<EOF
4.30 @@ -29,3 +48,5 @@
4.31 # Remove the temporary files.
4.32
4.33 rm _provides.tmp _non_provides.tmp
4.34 +
4.35 +# vim: tabstop=4 expandtab shiftwidth=4
5.1 --- a/tools/makefonts.sh Mon May 29 21:18:33 2023 +0200
5.2 +++ b/tools/makefonts.sh Wed May 31 16:41:49 2023 +0200
5.3 @@ -1,8 +1,27 @@
5.4 #!/bin/sh
5.5
5.6 -THISDIR=`dirname "$0"`
5.7 -DIRNAME=`readlink -f "$THISDIR/.."`
5.8 -PROGNAME=`basename "$0"`
5.9 +# Generate font binary files from font definitions.
5.10 +#
5.11 +# Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
5.12 +#
5.13 +# This program is free software; you can redistribute it and/or
5.14 +# modify it under the terms of the GNU General Public License as
5.15 +# published by the Free Software Foundation; either version 2 of
5.16 +# the License, or (at your option) any later version.
5.17 +#
5.18 +# This program is distributed in the hope that it will be useful,
5.19 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
5.20 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.21 +# GNU General Public License for more details.
5.22 +#
5.23 +# You should have received a copy of the GNU General Public License
5.24 +# along with this program; if not, write to the Free Software
5.25 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
5.26 +# Boston, MA 02110-1301, USA
5.27 +
5.28 +THISDIR=$(dirname "$0")
5.29 +DIRNAME=$(readlink -f "$THISDIR/..")
5.30 +PROGNAME=$(basename "$0")
5.31
5.32 UNIFONT='/usr/share/unifont/unifont.hex'
5.33
5.34 @@ -35,10 +54,10 @@
5.35
5.36 # Find all needed fonts and generate them.
5.37
5.38 -for NEEDED in `find "$DIRNAME/pkg" -name '*.tff.needed'` ; do
5.39 - TARGETDIR=`dirname "$NEEDED"`
5.40 - FONTFILE=`basename "$NEEDED" .needed`
5.41 - FONTNAME=`basename "$FONTFILE" .tff`
5.42 +for NEEDED in $(find "$DIRNAME/pkg" -name '*.tff.needed') ; do
5.43 + TARGETDIR=$(dirname "$NEEDED")
5.44 + FONTFILE=$(basename "$NEEDED" .needed)
5.45 + FONTNAME=$(basename "$FONTFILE" .tff)
5.46
5.47 FONTPATH="$TARGETDIR/$FONTFILE"
5.48
5.49 @@ -72,3 +91,5 @@
5.50 fi
5.51
5.52 done
5.53 +
5.54 +# vim: tabstop=4 expandtab shiftwidth=4
6.1 --- a/tools/show_updated.sh Mon May 29 21:18:33 2023 +0200
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,23 +0,0 @@
6.4 -#!/bin/sh
6.5 -
6.6 -THISDIR=`dirname "$0"`
6.7 -
6.8 -PACKAGE=${1:-"pkg/landfall-examples"}
6.9 -BASEDIR=`realpath "$THISDIR/.."`
6.10 -
6.11 -if [ ! -e "$PACKAGE" ] ; then
6.12 - echo "Package not found: $PACKAGE" 1>&2
6.13 - exit 1
6.14 -fi
6.15 -
6.16 -for FILENAME in `find "$PACKAGE" -type f` ; do
6.17 - if [ `basename "$FILENAME"` != `basename "$FILENAME" .orig` ] ; then
6.18 - continue
6.19 - fi
6.20 -
6.21 - if [ -e "$BASEDIR/$FILENAME" ] ; then
6.22 - diff -u "$BASEDIR/$FILENAME" "$FILENAME"
6.23 - else
6.24 - diff -u /dev/null "$FILENAME"
6.25 - fi
6.26 -done