mirror of
https://github.com/sbopkg/sbopkg
synced 2024-09-19 22:40:19 +03:00
sqg: Added a simple filesystem cache.
Closed #27. Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
parent
93591f2036
commit
679a09aea2
@ -1,5 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# use filesystem for caching SlackBuilds
|
||||
SQG_TMP_DIR=${SQG_TMP_DIR:-/tmp/sqg}
|
||||
|
||||
sanity_checks () {
|
||||
if [ ! -e "$SBOPKG_CONF" ]; then
|
||||
echo "$SBOPKG_CONF not found."
|
||||
@ -21,6 +24,9 @@ sanity_checks () {
|
||||
echo "Check the configurable variables at the top of the script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf "$SQG_TMP_DIR"
|
||||
mkdir -p "$SQG_TMP_DIR"
|
||||
}
|
||||
|
||||
has_parallel () {
|
||||
@ -74,8 +80,14 @@ search_package () {
|
||||
local REPO_DIR="$1"
|
||||
local SRCHAPP="$2"
|
||||
|
||||
cd $REPO_DIR
|
||||
PKGPATH=($(find -type d -mindepth 2 -maxdepth 2 -name "$SRCHAPP" | sort))
|
||||
if [[ -f "$SQG_TMP_DIR/$SRCHAPP" ]]; then
|
||||
PKGPATH=$(cat "$SQG_TMP_DIR/$SRCHAPP")
|
||||
else
|
||||
cd $REPO_DIR
|
||||
PKGPATH=($(find -type d -mindepth 2 -maxdepth 2 -name "$SRCHAPP" | sort))
|
||||
echo "$PKGPATH" > "$SQG_TMP_DIR/$SRCHAPP"
|
||||
fi
|
||||
|
||||
if [ -z "$PKGPATH" ]; then
|
||||
return 1
|
||||
else
|
||||
|
@ -1,10 +1,14 @@
|
||||
SBOPKG NEWS
|
||||
|
||||
sbopkg-dev (2017-03-11 17:05 UTC)
|
||||
sbopkg-dev (2017-03-11 17:34 UTC)
|
||||
FEATURES
|
||||
* sqg: Parallelize building of all packages by option -j.
|
||||
Requires GNU Parallel.
|
||||
Patch by Marcel Saegebarth.
|
||||
* sqg: Introduced new simple filesystem cache.
|
||||
This will reduce queue generation time significantly when
|
||||
invoked with -j N+1 (N: Number of cores)
|
||||
Patch by Marcel Saegebarth.
|
||||
|
||||
MODIFICATIONS
|
||||
* bash-completion: Complete -i and -b when git repo is used
|
||||
|
Loading…
Reference in New Issue
Block a user