aboutsummaryrefslogtreecommitdiff
path: root/sbqrun
diff options
context:
space:
mode:
Diffstat (limited to 'sbqrun')
-rwxr-xr-xsbqrun40
1 files changed, 34 insertions, 6 deletions
diff --git a/sbqrun b/sbqrun
index 6b35189..1551a9c 100755
--- a/sbqrun
+++ b/sbqrun
@@ -6,7 +6,13 @@
if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
cat <<EOF
-Usage: $( basename $0 ) [-n] [-t] arg [arg ...]
+Usage: $( basename $0 ) [-n] [-t] [-p] arg [arg ...]
+
+Options:
+ -t Don't track filesystem writes (passed to sbrun).
+ -n Allow network access (passed to sbrun).
+ -p If a binary package already exists for a given build, install
+ it instead of building a new one.
Run this script from the top level of a SBo repo clone!
@@ -22,24 +28,31 @@ Full sbopkg queue syntax is NOT supported, only a simple list of builds
(no |VAR=value, no @file, no -app). If you need sbopkg, use sbopkg!
Once the list is built, each build is downloaded with sbodl, built with
-sbrun -c, and installed with upkg, in the order given. If the -n and/or
--t options are given, they will be passed to sbrun.
+sbrun -c, and installed with upkg, in the order given.
+
+The -p option requires SlackBuild scripts that support the
+PRINT_PACKAGE_NAME option (Slackware 15.0 and up). It searches
+for built packages in the same place SlackBuild scripts place them
+(OUTPUT, TMP, or /tmp).
EOF
exit 0
fi
+olddir="$(pwd)"
source ~/sbostuff/sbostuff.sh
cdsb
for arg; do
- if [ "$arg" = "-t" -o "$arg" = "-n" ]; then
+ if [ "$arg" = "-p" ]; then
+ use_prebuilt=yes
+ elif [ "$arg" = "-t" -o "$arg" = "-n" ]; then
SBRUN_OPTS="$SBRUN_OPTS $arg"
elif [ "$arg" = "-" ]; then
while read build; do
BUILDS="$BUILDS $build"
done
- elif [ -f "$arg" ]; then
- BUILDS="$BUILDS `cat $arg`"
+ elif [ -f "$olddir/$arg" ]; then
+ BUILDS="$BUILDS `cat $olddir/$arg`"
elif [ -d "$arg" ]; then
BUILDS="$BUILDS $arg"
else
@@ -66,6 +79,20 @@ for build in $BUILDS; do
continue
fi
+ if [ "$use_prebuilt" = "yes" ]; then
+ script="$( pwd | sed 's,.*/,,' )".SlackBuild
+ if ! grep -q '^[^#]*PRINT_PACKAGE_NAME' "$script"; then
+ echo "==== sbqrun: PRINT_PACKAGE_NAME not supported by $script, ignoring -p"
+ else
+ pkgnam="$( PRINT_PACKAGE_NAME=1 sh $script )"
+ OUTPUT="${OUTPUT:-${TMP:-/tmp}}"
+ if [ -e "$OUTPUT/$pkgnam" ]; then
+ upkg "$OUTPUT/$pkgnam"
+ continue
+ fi
+ fi
+ fi
+
sbodl || echo "==== sbqrun: WARN: download failed, trying build anyway"
if ! sbrun -c $SBRUN_OPTS; then
@@ -75,6 +102,7 @@ for build in $BUILDS; do
else
if ! upkg; then
echo "==== sbqrun: $build built, but FAILED to install"
+ FAILED+="$build "
: $(( FAILCOUNT ++ ))
fi
fi