From fa4e6dc09953bc2af2c96ea2481926dd3c4b8809 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 5 Apr 2015 22:53:51 -0700 Subject: [PATCH] New bits for libretro-super.sh --- script-modules/fetch-rules.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/script-modules/fetch-rules.sh b/script-modules/fetch-rules.sh index d469ee27..53584a0c 100644 --- a/script-modules/fetch-rules.sh +++ b/script-modules/fetch-rules.sh @@ -36,6 +36,10 @@ fetch_revision_git() { git log -n 1 --pretty=format:%H } +local_files_git() { + git diff-files --quiet --ignore-submodules + return $? +} # fetch_revision: Output SCM-dependent revision string of a module # (currently just calls fetch_revision_git) @@ -44,3 +48,18 @@ fetch_revision_git() { fetch_revision() { fetch_revision_git $1 } + +module_get_revision() { + if [ -d "$WORKDIR/$module_dir" ]; then + cd "$WORKDIR/$module_dir" + case "$module_fetch_rule" in + git) + if [ -n "$1" ]; then + git diff-files --quiet --ignore-submodules || echo -n "changed from " + fi + git log -n 1 --pretty=format:%H + ;; + *) ;; + esac + fi +}