Skip to content

Commit 191485a

Browse files
committed
packages: amend update detection for untracked modules
Added a fallback for getting the `modified_date` of a module if the module's file is not tracked by `git`. If the module is just copied in the `scriptmodules` folder or under `ext`, but not part of a `git` repo, use the modification date of the file. This avoids re-building the module when a mass update is run. Noticed this in [this forum topic](https://retropie.org.uk/forum/topic/33922/need-help-with-openbor-retropie-extra-exarkuniv/15), seems like [RetroPie-Extra](https://github.com/Exarkuniv/RetroPie-Extra) copies selected module files under `ext`, while the main repository folder is kept separately.
1 parent 98c1df4 commit 191485a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scriptmodules/packages.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ function rp_hasNewerModule() {
644644
local repo_dir="$scriptdir"
645645
[[ "$vendor" != "RetroPie" ]] && repo_dir+="/ext/$vendor"
646646
local module_date="$(sudo -u "$user" git -C "$repo_dir" log -1 --format=%cI -- "${__mod_info[$id/path]}")"
647+
# just in case the module is not known to git, get the file last modified date
648+
[[ -z "$module_date" ]] && module_date="$(date -Iseconds -r "${__mod_info[$id/path]}")"
647649
if rp_dateIsNewer "$pkg_date" "$module_date"; then
648650
ret=0
649651
fi

0 commit comments

Comments
 (0)