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
|
#!/bin/sh
|
||||||
|
|
||||||
|
# use filesystem for caching SlackBuilds
|
||||||
|
SQG_TMP_DIR=${SQG_TMP_DIR:-/tmp/sqg}
|
||||||
|
|
||||||
sanity_checks () {
|
sanity_checks () {
|
||||||
if [ ! -e "$SBOPKG_CONF" ]; then
|
if [ ! -e "$SBOPKG_CONF" ]; then
|
||||||
echo "$SBOPKG_CONF not found."
|
echo "$SBOPKG_CONF not found."
|
||||||
@ -21,6 +24,9 @@ sanity_checks () {
|
|||||||
echo "Check the configurable variables at the top of the script."
|
echo "Check the configurable variables at the top of the script."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$SQG_TMP_DIR"
|
||||||
|
mkdir -p "$SQG_TMP_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
has_parallel () {
|
has_parallel () {
|
||||||
@ -74,8 +80,14 @@ search_package () {
|
|||||||
local REPO_DIR="$1"
|
local REPO_DIR="$1"
|
||||||
local SRCHAPP="$2"
|
local SRCHAPP="$2"
|
||||||
|
|
||||||
|
if [[ -f "$SQG_TMP_DIR/$SRCHAPP" ]]; then
|
||||||
|
PKGPATH=$(cat "$SQG_TMP_DIR/$SRCHAPP")
|
||||||
|
else
|
||||||
cd $REPO_DIR
|
cd $REPO_DIR
|
||||||
PKGPATH=($(find -type d -mindepth 2 -maxdepth 2 -name "$SRCHAPP" | sort))
|
PKGPATH=($(find -type d -mindepth 2 -maxdepth 2 -name "$SRCHAPP" | sort))
|
||||||
|
echo "$PKGPATH" > "$SQG_TMP_DIR/$SRCHAPP"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$PKGPATH" ]; then
|
if [ -z "$PKGPATH" ]; then
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
SBOPKG NEWS
|
SBOPKG NEWS
|
||||||
|
|
||||||
sbopkg-dev (2017-03-11 17:05 UTC)
|
sbopkg-dev (2017-03-11 17:34 UTC)
|
||||||
FEATURES
|
FEATURES
|
||||||
* sqg: Parallelize building of all packages by option -j.
|
* sqg: Parallelize building of all packages by option -j.
|
||||||
Requires GNU Parallel.
|
Requires GNU Parallel.
|
||||||
Patch by Marcel Saegebarth.
|
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
|
MODIFICATIONS
|
||||||
* bash-completion: Complete -i and -b when git repo is used
|
* bash-completion: Complete -i and -b when git repo is used
|
||||||
|
Loading…
Reference in New Issue
Block a user