sbopkg: Add blacklist feature.

Fix #39.

Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
Willy Sudiarto Raharjo 2018-01-14 17:43:03 +07:00
parent 371284cd89
commit e09556b01b
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
4 changed files with 23 additions and 4 deletions

0
src/etc/sbopkg/blacklist Normal file
View File

View File

@ -17,6 +17,7 @@ LOGFILE=${LOGFILE:-/var/log/sbopkg/sbopkg-build-log}
QUEUEDIR=${QUEUEDIR:-/var/lib/sbopkg/queues}
REPO_ROOT=${REPO_ROOT:-/var/lib/sbopkg}
SRCDIR=${SRCDIR:-/var/cache/sbopkg}
BLACKLISTFILE=${BLACKLISTFILE:-/etc/sbopkg/blacklist}
# sbopkg's temporary directory (where its internal temporary files are
# kept and where packages are made prior to being moved to OUTPUT)
# defaults to /tmp/sbopkg.XXXXXX where 'XXXXXX' is a random string. If

View File

@ -136,7 +136,7 @@ EOF
# Some configuration options are mandatory
for VAR in REPO_ROOT QUEUEDIR SRCDIR REPO_NAME REPO_BRANCH \
KEEPLOG CLEANUP LOGFILE DEBUG_UPDATES TMP OUTPUT RSYNCFLAGS \
WGETFLAGS DIFF DIFFOPTS SBOPKG_REPOS_D ALLOW_MULTI; do
WGETFLAGS DIFF DIFFOPTS SBOPKG_REPOS_D ALLOW_MULTI BLACKLISTFILE; do
if [[ -z "${!VAR}" ]]; then
MISSING+="$VAR "
fi
@ -735,7 +735,21 @@ check_for_updates() {
UPDATELIST=$SBOPKGTMP/sbopkg_updatelist
rm -f $UPDATELIST $ERRORMSG
cd /var/log/packages
PKGS=$(ls *$REPO_TAG 2> /dev/null)
# Check if blacklist file exists
if [[ -s $BLACKLISTFILE ]]; then
# Remove comments (lines starting with #) and empty lines
# If there exists content(s), we will filter that out
# Otherwise, do a normal check for update procedure
BLKFILE=$(grep -v "^#" $BLACKLISTFILE | grep -v "^$")
if [[ ! -z $BLKFILE ]]; then
PKGS=$(ls *$REPO_TAG | grep -v $BLKFILE 2> /dev/null)
else
PKGS=$(ls *$REPO_TAG 2> /dev/null)
fi
else
PKGS=$(ls *$REPO_TAG 2> /dev/null)
fi
NUMPKGS=$(wc -w <<< "$PKGS")
VERSION_FILE=$SBOPKGTMP/sbopkg-script-version
PROGRESSBAR_INTERRUPTED=$SBOPKGTMP/sbopkg_progressbar-interrupted

View File

@ -1,6 +1,6 @@
SBOPKG NEWS
sbopkg-dev (2018-01-12 00:52:10 UTC)
sbopkg-dev (2018-01-14 10:17:13 UTC)
FEATURES
* sqg: Parallelize building of single and all packages by option -j.
Requires GNU Parallel.
@ -17,7 +17,11 @@ sbopkg-dev (2018-01-12 00:52:10 UTC)
* sqg: Added manual page for sqg.
* sbopkg: No need to do complete check for old sources if no sources available
Initial patch by Loki Harfagr
* sbopkg: Added support for Slackware 15.0
* sbopkg: Added support for Slackware 15.0
* sbopkg: Added new option in sbopkg.conf: BLACKLISTFILE
This is used to define blacklisted package(s)
Feature Request by khronosschoty
MODIFICATIONS
* bash-completion: Complete -i and -b when git repo is used