public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/postinst-qa-check.d/
Date: Sat, 26 Aug 2017 21:16:33 +0000 (UTC)	[thread overview]
Message-ID: <1503782179.83b44fc48c07a4d8f0b6cb361f61b1493965fcb2.mgorny@gentoo> (raw)

commit:     83b44fc48c07a4d8f0b6cb361f61b1493965fcb2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 16 14:20:48 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug 26 21:16:19 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=83b44fc4

Update caches after reporting missing cache updates

Call the appropriate updater to update caches after reporting a missing
cache update, in order to stop repeating the same issue on subsequent
packages that did not install any relevant files.

Closes: https://github.com/gentoo/portage/pull/195
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/postinst-qa-check.d/50gnome2-utils |  9 +++++++++
 bin/postinst-qa-check.d/50xdg-utils    | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils
index 4e7c6eb85..d0cbb4037 100644
--- a/bin/postinst-qa-check.d/50gnome2-utils
+++ b/bin/postinst-qa-check.d/50gnome2-utils
@@ -16,6 +16,15 @@ gnome2_icon_cache_check() {
 		while read -r -d $'\0' f; do
 			files+=( "${f}" )
 		done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0)
+
+		# if any files were found, update the db to avoid repeating
+		# the warning for subsequent packages
+		# (note: yes, it will eagerly repeat the update for next dirs
+		# but that's a minor issue)
+		if [[ ${files[@]} ]]; then
+			addwrite "${d}"
+			gtk-update-icon-cache -qf "${d}"
+		fi
 	done
 
 	if [[ ${files[@]} ]]; then

diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils
index b0bb029bd..9f5e9a48c 100644
--- a/bin/postinst-qa-check.d/50xdg-utils
+++ b/bin/postinst-qa-check.d/50xdg-utils
@@ -17,6 +17,15 @@ xdg_desktop_database_check() {
 			files+=( "${f}" )
 		done < <(find "${d}" -name '*.desktop' "${find_args[@]}" \
 			-exec grep -lZi '^MimeType=' {} +)
+
+		# if any files were found, update the db to avoid repeating
+		# the warning for subsequent packages
+		# (note: yes, it will eagerly repeat the update for next dirs
+		# but it's a minor issue and we have only one dir anyway)
+		if [[ ${files[@]} ]]; then
+			addwrite "${d}"
+			update-desktop-database "${d}"
+		fi
 	done
 
 	if [[ ${files[@]} ]]; then
@@ -42,6 +51,15 @@ xdg_mimeinfo_database_check() {
 		while read -r -d $'\0' f; do
 			files+=( "${f}" )
 		done < <(find "${d}" -name '*.xml' "${find_args[@]}" -print0)
+
+		# if any files were found, update the db to avoid repeating
+		# the warning for subsequent packages
+		# (note: yes, it will eagerly repeat the update for next dirs
+		# but it's a minor issue and we have only one dir anyway)
+		if [[ ${files[@]} ]]; then
+			addwrite "${d}"
+			update-mime-database "${d}"
+		fi
 	done
 
 	if [[ ${files[@]} ]]; then


             reply	other threads:[~2017-08-26 21:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26 21:16 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-26 21:16 [gentoo-commits] proj/portage:master commit in: bin/postinst-qa-check.d/ Michał Górny
2017-08-26 21:16 Michał Górny
2017-08-29 16:38 Michał Górny
2017-09-19 23:38 Zac Medico
2017-09-19 23:38 Zac Medico
2017-09-20  4:28 Zac Medico
2017-09-20 18:14 Zac Medico
2017-10-02 16:56 Michał Górny
2017-10-02 17:28 Zac Medico
2017-10-27 19:11 Zac Medico
2018-03-16  9:27 Zac Medico
2019-02-12 23:38 Zac Medico
2019-02-12 23:38 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503782179.83b44fc48c07a4d8f0b6cb361f61b1493965fcb2.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox