Skip to content

Commit

Permalink
add mask function
Browse files Browse the repository at this point in the history
  • Loading branch information
emmett1 committed Jul 29, 2020
1 parent eee0a24 commit f301811
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
31 changes: 19 additions & 12 deletions scratch
Original file line number Diff line number Diff line change
Expand Up @@ -697,18 +697,21 @@ scratch_remove() {

outdatepkg() {
for pkg in $(allinstalled); do
if [ ! -e "$PKGDB_DIR/$pkg/.lock" ] && getportpath $pkg >/dev/null; then
. $(getportpath $pkg)/$BUILD_SCRIPT
if [ -z "$name" ] || [ -z "$version" ]; then
continue
fi
iversion=$(installed_pkg_info version $pkg)
irelease=$(installed_pkg_info release $pkg)
if [ "$release" != "$irelease" ] || [ "$version" != "$iversion" ]; then
echo $name
fi
unset iversion irelease version release
if [ -f "$MASK_FILE" ] && [ $(grep -Ev '^(#|$| )' $MASK_FILE | grep $pkg) ]; then
continue
fi
[ -e "$PKGDB_DIR/$pkg/.lock" ] && continue
getportpath $pkg >/dev/null || continue
. $(getportpath $pkg)/$BUILD_SCRIPT
if [ -z "$name" ] || [ -z "$version" ]; then
continue
fi
iversion=$(installed_pkg_info version $pkg)
irelease=$(installed_pkg_info release $pkg)
if [ "$release" != "$irelease" ] || [ "$version" != "$iversion" ]; then
echo $name
fi
unset iversion irelease version release
done
}

Expand Down Expand Up @@ -903,7 +906,10 @@ scratch_outdate() {
fi
iversion=$(installed_pkg_info version $pkg)
irelease=$(installed_pkg_info release $pkg)
[ -f "$PKGDB_DIR/$pkg/.lock" ] && ITSLOCK="[locked]"
[ -f "$PKGDB_DIR/$pkg/.lock" ] && ITSLOCK="[masked]"
if [ -f "$MASK_FILE" ] && [ $(grep -Ev '^(#|$| )' $MASK_FILE | grep $pkg) ]; then
ITSLOCK="[masked]"
fi
outdatemsg="$name $iversion-$irelease => $version-$release $ITSLOCK"
newerinstmsg="$name $iversion-$irelease => $version-$release [newer installed] $ITSLOCK"
if [ "$version" != "$iversion" ]; then
Expand Down Expand Up @@ -1438,6 +1444,7 @@ BUILD_SCRIPT="spkgbuild"
PKGDB_DIR="$(pkgadd --print-dbdir)"
REPO_FILE="${REPO_FILE:-/etc/scratchpkg.repo}"
ALIAS_FILE="${ALIAS_FILE:-/etc/scratchpkg.alias}"
MASK_FILE="${MASK_FILE:-/etc/scratchpkg.mask}"

# default value from pkgbuild
SOURCE_DIR="/var/cache/scratchpkg/sources"
Expand Down
2 changes: 1 addition & 1 deletion scratchpkg.alias
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#
# example:
# openssl libressl
#
#
6 changes: 3 additions & 3 deletions scratchpkg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Configuration file for scratchpkg
#

CFLAGS="-O2 -march=x86-64 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEFLAGS="-j$(nproc)"
# CFLAGS="-O2 -march=x86-64 -pipe"
# CXXFLAGS="${CFLAGS}"
# MAKEFLAGS="-j$(nproc)"

# SOURCE_DIR="/var/cache/scratchpkg/sources"
# PACKAGE_DIR="/var/cache/scratchpkg/packages"
Expand Down
6 changes: 6 additions & 0 deletions scratchpkg.mask
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# exclude packages from sysup

glibc
gcc
linux-api-headers
binutils

0 comments on commit f301811

Please sign in to comment.