diff options
-rwxr-xr-x | sbodl | 14 | ||||
-rwxr-xr-x | sbrun | 2 |
2 files changed, 12 insertions, 4 deletions
@@ -1,17 +1,19 @@ #!/bin/bash -# sbodl, initial public release. +# sbodl, download slackbuilds.org source files +# 20191222 bkw: handle broken symlinks in current dir. +# change default cache dir. # 20170306 bkw: add caching SELF=$( basename $0 ) -CACHEDIR=/home/urchlay/slackbuilds +CACHEDIR=~/sbodl-cache usage() { cat <<EOF $SELF - download the sources for a slackbuilds.org build. -version 20170306, public release, with cachedir +version 20191222, public release, with cachedir (c) 2014 B. Watson (yalhcru at gmail dawt cawm) Licensed under the WTFPL: Do WTF you want with this. @@ -37,6 +39,8 @@ die() { exit 1 } +[ -d "$CACHEDIR/" ] || mkdir -p $CACHEDIR || die "Can't create $CACHEDIR" + # check for our one argument case "$1" in -h|-help|-\?|--help) usage ;; @@ -80,6 +84,10 @@ for dl in $DL; do esac FILE=$( echo "$dl" | sed 's,.*/,,' ) + + # ignore (rm) broken symlinks + [ -L "$FILE" ] && ! [ -e "$FILE" ] && FORCEDL=yes + [ "$FORCEDL" = "yes" ] && rm -f "$FILE" if [ -e "$FILE" ]; then @@ -5,7 +5,7 @@ TMP=${TMP:-/tmp/SBo} OUTPUT=${OUTPUT:-/tmp} BUILDLOG=${BUILDLOG:-build.log} -DEFAULT_MAKEFLAGS="-j8" +DEFAULT_MAKEFLAGS="-j3" # End of configurables. It's probably best not to configure TMP or # OUTPUT here (use the environment instead) anyway. Also it's probably |