Skip to content

Commit f301811

Browse files
author
emmett1
committed
add mask function
1 parent eee0a24 commit f301811

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

scratch

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -697,18 +697,21 @@ scratch_remove() {
697697

698698
outdatepkg() {
699699
for pkg in $(allinstalled); do
700-
if [ ! -e "$PKGDB_DIR/$pkg/.lock" ] && getportpath $pkg >/dev/null; then
701-
. $(getportpath $pkg)/$BUILD_SCRIPT
702-
if [ -z "$name" ] || [ -z "$version" ]; then
703-
continue
704-
fi
705-
iversion=$(installed_pkg_info version $pkg)
706-
irelease=$(installed_pkg_info release $pkg)
707-
if [ "$release" != "$irelease" ] || [ "$version" != "$iversion" ]; then
708-
echo $name
709-
fi
710-
unset iversion irelease version release
700+
if [ -f "$MASK_FILE" ] && [ $(grep -Ev '^(#|$| )' $MASK_FILE | grep $pkg) ]; then
701+
continue
702+
fi
703+
[ -e "$PKGDB_DIR/$pkg/.lock" ] && continue
704+
getportpath $pkg >/dev/null || continue
705+
. $(getportpath $pkg)/$BUILD_SCRIPT
706+
if [ -z "$name" ] || [ -z "$version" ]; then
707+
continue
708+
fi
709+
iversion=$(installed_pkg_info version $pkg)
710+
irelease=$(installed_pkg_info release $pkg)
711+
if [ "$release" != "$irelease" ] || [ "$version" != "$iversion" ]; then
712+
echo $name
711713
fi
714+
unset iversion irelease version release
712715
done
713716
}
714717

@@ -903,7 +906,10 @@ scratch_outdate() {
903906
fi
904907
iversion=$(installed_pkg_info version $pkg)
905908
irelease=$(installed_pkg_info release $pkg)
906-
[ -f "$PKGDB_DIR/$pkg/.lock" ] && ITSLOCK="[locked]"
909+
[ -f "$PKGDB_DIR/$pkg/.lock" ] && ITSLOCK="[masked]"
910+
if [ -f "$MASK_FILE" ] && [ $(grep -Ev '^(#|$| )' $MASK_FILE | grep $pkg) ]; then
911+
ITSLOCK="[masked]"
912+
fi
907913
outdatemsg="$name $iversion-$irelease => $version-$release $ITSLOCK"
908914
newerinstmsg="$name $iversion-$irelease => $version-$release [newer installed] $ITSLOCK"
909915
if [ "$version" != "$iversion" ]; then
@@ -1438,6 +1444,7 @@ BUILD_SCRIPT="spkgbuild"
14381444
PKGDB_DIR="$(pkgadd --print-dbdir)"
14391445
REPO_FILE="${REPO_FILE:-/etc/scratchpkg.repo}"
14401446
ALIAS_FILE="${ALIAS_FILE:-/etc/scratchpkg.alias}"
1447+
MASK_FILE="${MASK_FILE:-/etc/scratchpkg.mask}"
14411448

14421449
# default value from pkgbuild
14431450
SOURCE_DIR="/var/cache/scratchpkg/sources"

scratchpkg.alias

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
#
77
# example:
88
# openssl libressl
9-
#
9+
#

scratchpkg.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Configuration file for scratchpkg
33
#
44

5-
CFLAGS="-O2 -march=x86-64 -pipe"
6-
CXXFLAGS="${CFLAGS}"
7-
MAKEFLAGS="-j$(nproc)"
5+
# CFLAGS="-O2 -march=x86-64 -pipe"
6+
# CXXFLAGS="${CFLAGS}"
7+
# MAKEFLAGS="-j$(nproc)"
88

99
# SOURCE_DIR="/var/cache/scratchpkg/sources"
1010
# PACKAGE_DIR="/var/cache/scratchpkg/packages"

scratchpkg.mask

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# exclude packages from sysup
2+
3+
glibc
4+
gcc
5+
linux-api-headers
6+
binutils

0 commit comments

Comments
 (0)