From 44d0f2971ce5943ac4ea2d9a740b9a369900f3b3 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 2 Feb 2021 02:32:34 -0500 Subject: [PATCH] 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 --- checkversion | 42 +++++++++++++++++++++++++----------------- noversion.conf | 1 + noversion.txt | 2 -- repoversion.conf | 2 ++ 4 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 noversion.conf delete mode 100644 noversion.txt create mode 100644 repoversion.conf diff --git a/checkversion b/checkversion index 0da8c71..c520e86 100755 --- a/checkversion +++ b/checkversion @@ -15,7 +15,7 @@ # develversion_conf: config file listing VCS packages to check # 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 @@ -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 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_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 } -# SPECIALPKG CHECK: function for custom version check functions -function specialpkg_check() { +function repo_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 cd "$package_rootdir" || exit - # PKGVER CHECK: terminfo-italics - specialpkg=terminfo-italics - upstream_version=$(pacman -Si ncurses \ - | grep Version \ - | sed 's|^[^:]*:\ ||;s|-.*$||') - pkgver='' - eval "$(grep -E '^\s*pkgver\s*=' $specialpkg/PKGBUILD)" - vercmp_check "$specialpkg" "$upstream_version" "$pkgver" + # Check against the repository versions + repo_check rxvt-unicode-sgr-mouse rxvt-unicode + repo_check terminfo-italics ncurses # Return to the script folder cd "$script_directory" || exit @@ -260,9 +268,9 @@ function develversion_check() { # check_missingpkgsPKG CHECK function missingpkg_check() { - # Create lists of archversion, develversion, specialversion and noversion packages - specialversion_packages='terminfo-italics' - noversion_packages=$(sed 's|\[||;s|\]||;s|\s*#.*$||' "$noversion_conf") + # Create lists of archversion, develversion, repoversion and noversion packages + repoversion_packages=$(grep -vE '^\s*#' "$repoversion_conf") + noversion_packages=$(grep -vE '^\s*#' "$noversion_conf") develversion_packages=$(grep -vE '^\s*#' "$develversion_conf") archversion_packages=$(grep -vE '^\s*#' "$archversion_conf" \ | grep -v '[DEFAULT]' \ @@ -279,7 +287,7 @@ function missingpkg_check() { ! grep -qE "^$_pkg$" <<< "$archversion_packages" \ && ! grep -qE "^$_pkg$" <<< "$develversion_packages" \ - && ! grep -qE "^$_pkg$" <<< "$specialversion_packages" \ + && ! grep -qE "^$_pkg$" <<< "$repoversion_packages" \ && ! grep -qE "^$_pkg$" <<< "$noversion_packages" \ && printf '%s\n' "$_pkg" } @@ -365,7 +373,7 @@ install -d "$temp_directory" archversion_check develversion_check -specialpkg_check +repopkg_check # Cleanup the temp folder [[ -d "$temp_directory" ]] && rm -rf "$temp_directory" diff --git a/noversion.conf b/noversion.conf new file mode 100644 index 0000000..6bfa962 --- /dev/null +++ b/noversion.conf @@ -0,0 +1 @@ +wizorb-hib diff --git a/noversion.txt b/noversion.txt deleted file mode 100644 index 56fc39a..0000000 --- a/noversion.txt +++ /dev/null @@ -1,2 +0,0 @@ -[cacert-dot-org] -[wizorb-hib] diff --git a/repoversion.conf b/repoversion.conf new file mode 100644 index 0000000..f10e869 --- /dev/null +++ b/repoversion.conf @@ -0,0 +1,2 @@ +rxvt-unicode-sgr-mouse +terminfo-italics