Hi,
I'm using a "master" build script to build my extra packages, so once Slackware is installed, I can pretty much launch the script, and it will fetch stuff and build it in the right order. Here's what the script looks like:
Code:
#!/bin/sh
# Copyright (c) 2012 Niki Kovacs <info@microlinux.fr>
# -----------------------------------------------------------------------------
#
# This script builds Slackware packages listed in the 'packages'
# file. It puts them in the Slackware directory. If the package already exists
# in slackware/ *and* if it's already installed, the script skips to the next
# package, otherwise it builds and installs the package, until all packages
# listed in the package file are built.
CWD=`pwd`
SOURCEDIR=${CWD}/source
case $(uname -m) in
x86_64) OUTPUT=$CWD/slackware/x86_64 ;;
* ) OUTPUT=$CWD/slackware/i486 ;;
esac
export OUTPUT
# Set the number of parallel make jobs
if [ -z "$NUMJOBS" ]; then
case $(uname -m) in
x86_64) NUMJOBS="-j4" ;;
* ) NUMJOBS="-j2" ;;
esac
export NUMJOBS="$NUMJOBS"
fi
PACKAGES=$(egrep -v '(^\#)|(^\s+$)' $CWD/packages)
for PACKAGE in ${PACKAGES} ; do
if [ -r ${OUTPUT}/${PACKAGE}-[0-9]*.tgz ] ; then
if [ -r /var/log/packages/${PACKAGE}-[0-9]* ] ; then
continue
fi
fi
echo
echo "+=============================================================================="
echo "| Building package ${PACKAGE}..."
echo "+=============================================================================="
echo
sleep 3
(
cd ${SOURCEDIR}/${PACKAGE} || exit 1
./${PACKAGE}.SlackBuild || exit 1
)
upgradepkg --reinstall --install-new ${OUTPUT}/${PACKAGE}-[0-9]*.tgz || exit 1
done
echo
echo "+=============================================================================="
echo "| Successfully built and installed all packages !"
echo "+=============================================================================="
echo
Rough description of what the script does:
1) it reads the names of packages to build in an external 'packages' file, which is basically a list, one package per line, with a few comments.
2) It checks if the package has already been built before AND if it's installed.
3) If not, it builds the package, puts it into the OUTPUT directory and installs it.
Now strangely enough, the script works perfectly with 13.37 (as it has always worked with previous versions of Slackware since around 10.2).
But under 14.0RC2, it fails. I get a "binary operator expected" message at the if... then statements that do the testing if the package is installed and present in the OUTPUT directory.
What happens is if a package is installed AND it's in the OUTPUT directory, the script fails and builds it anyway, instead of skipping to the next package that's not yet built/installed.
Any idea what's wrong here?