From 5c9a5a80a58608b4bc00f8a68201dc440eb2d1d2 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Wed, 1 Jun 2022 11:33:35 -0400 Subject: [PATCH] pkgmeek: fixed path in the check_pkg_mtime subroutine --- scripts/pkgmeek | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/pkgmeek b/scripts/pkgmeek index 00d4e96..bf96852 100755 --- a/scripts/pkgmeek +++ b/scripts/pkgmeek @@ -8,7 +8,7 @@ main() { ######################## main routine ################################ -local o_ignored work _local_ here url u f errDL pkg_ood errUZ +local o_ignored work _local_ here url u f errDL errUZ; local pkg_ood=1 parse_options "$@" [ "$PKGMK_RECURSIVE" = "no" ] || recursive "$@" # @@ -88,7 +88,7 @@ done; } [ "$errDL" = 0 ] && info "Successfully obtained all source files." # If the user only asked for '-utd', perform the check using the sources that do exist. -check_pkg_mtime && pkg_ood=0 || pkg_ood=1 +check_pkg_mtime; pkg_ood=$? [ "$PKGMK_MTIME_ONLY" = "no" ] || exit $pkg_ood [ "$PKGMK_DOWNLOAD_ONLY" = "yes" ] || [ "$PKGMK_UPDATE_MD5" = "yes" ] \ @@ -373,16 +373,17 @@ check_reqvars () { } check_pkg_mtime() { # can be called even if some sources are missing - local status=1; local li=0; local pkg_ood="yes" - local msg="$package is not up to date." + local status=1; local li=0; local pkg_ood="yes"; local msg + msg="$package is not up to date." - if [ -f "$package" ]; then + if [ -f "$pkg_dir/$package" ]; then pkg_ood="no" while [ $li -lt ${#_local_[@]} ] && [ "$pkg_ood" = "no" ]; do - [ ! -e "${_local_[$li]}" ] || [ "$package" -nt "${_local_[$li]}" ] || pkg_ood="yes" + [ ! -e "${_local_[$li]}" ] || \ + [ $(realpath "${_local_[$li]}") -nt "$package" ] || pkg_ood="yes" li=$(( li+1 )) done - [ ! -e Pkgfile ] || [ "$package" -nt Pkgfile ] || pkg_ood="yes" + [ ! -e Pkgfile ] || [ Pkgfile -nt "$package" ] || pkg_ood="yes" fi [ "$pkg_ood" = "yes" ] || { status=0; msg="$package is up to date."; }