<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/5434013047a9976ccf74a846d888bfdf5afb5bba">https://github.com/macports/macports-ports/commit/5434013047a9976ccf74a846d888bfdf5afb5bba</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 5434013047a shared-mime-info: stub script: add path checks
</span>5434013047a is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 5434013047a9976ccf74a846d888bfdf5afb5bba
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Wed Sep 20 08:52:39 2023 -0400
<span style='display:block; white-space:pre;color:#404040;'> shared-mime-info: stub script: add path checks
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> - For ports like 'synfigstudio', which run 'update-mime-database' for a destroot
</span><span style='display:block; white-space:pre;color:#404040;'> path, ensure we don't fail.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See: https://trac.macports.org/ticket/45396
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/68188
</span>---
devel/shared-mime-info/Portfile | 8 +++-
devel/shared-mime-info/files/update-mime-database | 49 +++++++++++++++++++++--
2 files changed, 53 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/shared-mime-info/Portfile b/devel/shared-mime-info/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index d681d9fb656..9abe2f381c6 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/shared-mime-info/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/shared-mime-info/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6,7 +6,7 @@ PortGroup meson 1.0
</span>
gitlab.instance https://gitlab.freedesktop.org
gitlab.setup xdg shared-mime-info 2.2
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 7
</span>
checksums rmd160 c8efc1e91c23b82c37d9f78f6d9b1ffbf7be8a11 \
sha256 418c480019d9865f67f922dfb88de00e9f38bf971205d55cdffab50432919e61 \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -36,6 +36,12 @@ depends_lib-append \
</span> path:lib/pkgconfig/glib-2.0.pc:glib2 \
port:libxml2
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.platform} eq "darwin"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # coreutils needed for stub script
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_run-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ path:libexec/coreutils/libstdbuf.so:coreutils
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set script_orig update-mime-database
set script_real update-mime-database-real
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/shared-mime-info/files/update-mime-database b/devel/shared-mime-info/files/update-mime-database
</span><span style='display:block; white-space:pre;color:#808080;'>index ca21cc606bf..47810f50dd7 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/shared-mime-info/files/update-mime-database
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/shared-mime-info/files/update-mime-database
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,5 +1,48 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#!/bin/sh
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#!@PREFIX@/bin/bash
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# stub script, which initiates update
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# stub script, which initiates update via touch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# usage: update-mime-database mime_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+dir_prefix="@PREFIX@"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+dir_bin="${dir_prefix}/bin"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+dir_mime="${dir_prefix}/share/mime"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+dir_mime_pkgs="${dir_mime}/packages"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+bin_grealpath="${dir_bin}/grealpath"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+arg_count=${#}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#printf "arg_count: ${arg_count}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if [[ ${arg_count} -lt 1 ]]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "Usage: ${0} mime_path\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exit 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# mime_path must be last argument; ignore previous args, if any, like -V
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+arg_path="${@: -1}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#printf "${0}: arg_path: ${arg_path}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+arg_path_full="$(${bin_grealpath} -q ${arg_path})"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if [ $? -ne 0 ]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "${0}: mime_path does not exist: ${arg_path}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exit 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#printf "${0}: arg_path_full: ${arg_path_full}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+dir_mime_full="$(${bin_grealpath} ${dir_mime})"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if [ $? -ne 0 ]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "${0}: dir_mime does not exist: ${dir_mime}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exit 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#printf "${0}: dir_mime_full: ${dir_mime_full}\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if [[ "${arg_path_full}" == "${dir_mime_full}"* ]]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #printf "${0}: mime_path matches dir_mime_full; running touch\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ touch "${dir_mime_pkgs}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "${0}: mime_path does not match ${dir_mime}; ignoring\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+exit 0
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-touch @PREFIX@/share/mime/packages
</span></pre><pre style='margin:0'>
</pre>