Remove a package from noversion, convert specialversion into repoversion for specifically checking against repo package, also include the pkgrel in the check, and add rxvt-unicode-sgr-mouse to the list of checked packages

This commit is contained in:
Kevin MacMartin 2021-02-02 02:32:34 -05:00
parent edef77510b
commit 44d0f2971c
4 changed files with 28 additions and 19 deletions

View file

@ -15,7 +15,7 @@
# develversion_conf: config file listing VCS packages to check # develversion_conf: config file listing VCS packages to check
# noversion_conf: text file listing packages that won't be checked # noversion_conf: text file listing packages that won't be checked
# #
# specialpkg_check(): Contained in this script, custom version checks go in this function # repopkg_check(): Contained in this script, custom version checks go in this function
# #
cd "${0%/*}" || exit cd "${0%/*}" || exit
@ -25,7 +25,8 @@ package_rootdir="$(readlink -f "$script_directory"/..)" # Directory containing a
archversion_conf="$script_directory/archversion.conf" # A config file containing Archversion checks for non-VCS packages archversion_conf="$script_directory/archversion.conf" # A config file containing Archversion checks for non-VCS packages
develversion_conf="$script_directory/develversion.conf" # A file containing a list of VCS packages to check develversion_conf="$script_directory/develversion.conf" # A file containing a list of VCS packages to check
noversion_conf="$script_directory/noversion.txt" # A file containing a list of packages that shouldn't be checked noversion_conf="$script_directory/noversion.conf" # A file containing a list of packages that shouldn't be checked
repoversion_conf="$script_directory/repoversion.conf"
temp_directory="/tmp/$script_name" # The root folder containing any temporary files used temp_directory="/tmp/$script_name" # The root folder containing any temporary files used
temp_config="$temp_directory/upversion.tmp.conf" # Location to create temp archversion configs temp_config="$temp_directory/upversion.tmp.conf" # Location to create temp archversion configs
@ -44,19 +45,26 @@ unset c_blue c_white c_yellow c_grey c_red c_green c_reset
c_reset=$'\e[0m' # DISABLES COLOUR c_reset=$'\e[0m' # DISABLES COLOUR
} }
# SPECIALPKG CHECK: function for custom version check functions function repo_check() {
function specialpkg_check() { upstream_version=$(pacman -Si "$2" \
| grep Version \
| sed 's|^[^:]*:\ ||')
pkgver=''
pkgrel=''
eval "$(grep -E '^\s*pkgver\s*=' "$1/PKGBUILD")"
eval "$(grep -E '^\s*pkgrel\s*=' "$1/PKGBUILD")"
vercmp_check "$1" "$upstream_version" "$pkgver-$pkgrel"
}
# REPOPKG CHECK: function for custom version check functions
function repopkg_check() {
# Enter the package root directory # Enter the package root directory
cd "$package_rootdir" || exit cd "$package_rootdir" || exit
# PKGVER CHECK: terminfo-italics # Check against the repository versions
specialpkg=terminfo-italics repo_check rxvt-unicode-sgr-mouse rxvt-unicode
upstream_version=$(pacman -Si ncurses \ repo_check terminfo-italics ncurses
| grep Version \
| sed 's|^[^:]*:\ ||;s|-.*$||')
pkgver=''
eval "$(grep -E '^\s*pkgver\s*=' $specialpkg/PKGBUILD)"
vercmp_check "$specialpkg" "$upstream_version" "$pkgver"
# Return to the script folder # Return to the script folder
cd "$script_directory" || exit cd "$script_directory" || exit
@ -260,9 +268,9 @@ function develversion_check() {
# check_missingpkgsPKG CHECK # check_missingpkgsPKG CHECK
function missingpkg_check() { function missingpkg_check() {
# Create lists of archversion, develversion, specialversion and noversion packages # Create lists of archversion, develversion, repoversion and noversion packages
specialversion_packages='terminfo-italics' repoversion_packages=$(grep -vE '^\s*#' "$repoversion_conf")
noversion_packages=$(sed 's|\[||;s|\]||;s|\s*#.*$||' "$noversion_conf") noversion_packages=$(grep -vE '^\s*#' "$noversion_conf")
develversion_packages=$(grep -vE '^\s*#' "$develversion_conf") develversion_packages=$(grep -vE '^\s*#' "$develversion_conf")
archversion_packages=$(grep -vE '^\s*#' "$archversion_conf" \ archversion_packages=$(grep -vE '^\s*#' "$archversion_conf" \
| grep -v '[DEFAULT]' \ | grep -v '[DEFAULT]' \
@ -279,7 +287,7 @@ function missingpkg_check() {
! grep -qE "^$_pkg$" <<< "$archversion_packages" \ ! grep -qE "^$_pkg$" <<< "$archversion_packages" \
&& ! grep -qE "^$_pkg$" <<< "$develversion_packages" \ && ! grep -qE "^$_pkg$" <<< "$develversion_packages" \
&& ! grep -qE "^$_pkg$" <<< "$specialversion_packages" \ && ! grep -qE "^$_pkg$" <<< "$repoversion_packages" \
&& ! grep -qE "^$_pkg$" <<< "$noversion_packages" \ && ! grep -qE "^$_pkg$" <<< "$noversion_packages" \
&& printf '%s\n' "$_pkg" && printf '%s\n' "$_pkg"
} }
@ -365,7 +373,7 @@ install -d "$temp_directory"
archversion_check archversion_check
develversion_check develversion_check
specialpkg_check repopkg_check
# Cleanup the temp folder # Cleanup the temp folder
[[ -d "$temp_directory" ]] && rm -rf "$temp_directory" [[ -d "$temp_directory" ]] && rm -rf "$temp_directory"

1
noversion.conf Normal file
View file

@ -0,0 +1 @@
wizorb-hib

View file

@ -1,2 +0,0 @@
[cacert-dot-org]
[wizorb-hib]

2
repoversion.conf Normal file
View file

@ -0,0 +1,2 @@
rxvt-unicode-sgr-mouse
terminfo-italics