Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH 3/2] Update caches after reporting missing cache updates
Date: Wed, 16 Aug 2017 17:33:49
Message-Id: 1502904822.3633.1.camel@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 3/2] Update caches after reporting missing cache updates by "Michał Górny"
1 W dniu śro, 16.08.2017 o godzinie 16∶22 +0200, użytkownik Michał Górny
2 napisał:
3 > Call the appropriate updater to update caches after reporting a missing
4 > cache update, in order to stop repeating the same issue on subsequent
5 > packages that did not install any relevant files.
6 > ---
7 > bin/postinst-qa-check.d/50gnome2-utils | 8 ++++++++
8 > bin/postinst-qa-check.d/50xdg-utils | 16 ++++++++++++++++
9 > 2 files changed, 24 insertions(+)
10 >
11 > // (a followup to postinst patches)
12 >
13 > diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils
14 > index 68e21cb74..97495f07b 100644
15 > --- a/bin/postinst-qa-check.d/50gnome2-utils
16 > +++ b/bin/postinst-qa-check.d/50gnome2-utils
17 > @@ -16,6 +16,14 @@ gnome2_icon_cache_check() {
18 > while read -r -d $'\0' f; do
19 > files+=( "${f}" )
20 > done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0)
21 > +
22 > + # if any files were found, update the db to avoid repeating
23 > + # the warning for subsequent packages
24 > + # (note: yes, it will eagerly repeat the update for next dirs
25 > + # but that's a minor issue)
26 > + if [[ ${files[@]} ]]; then
27 > + gtk-update-icon-cache -qf "${d}"
28 > + fi
29 > done
30 >
31 > if [[ ${files[@]} ]]; then
32 > diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils
33 > index 4bc7bee9a..8c33b2dfe 100644
34 > --- a/bin/postinst-qa-check.d/50xdg-utils
35 > +++ b/bin/postinst-qa-check.d/50xdg-utils
36 > @@ -17,6 +17,14 @@ xdg_desktop_database_check() {
37 > files+=( "${f}" )
38 > done < <(find "${d}" -name '*.desktop' "${find_args[@]}" \
39 > -exec grep -lZi '^MimeType=' {} +)
40 > +
41 > + # if any files were found, update the db to avoid repeating
42 > + # the warning for subsequent packages
43 > + # (note: yes, it will eagerly repeat the update for next dirs
44 > + # but it's a minor issue and we have only one dir anyway)
45 > + if [[ ${files[@]} ]]; then
46 > + update-desktop-database "${d}"
47 > + fi
48 > done
49 >
50 > if [[ ${files[@]} ]]; then
51 > @@ -42,6 +50,14 @@ xdg_mimeinfo_database_check() {
52 > while read -r -d $'\0' f; do
53 > files+=( "${f}" )
54 > done < <(find "${d}" -name '*.xml' "${find_args[@]}" -print0)
55 > +
56 > + # if any files were found, update the db to avoid repeating
57 > + # the warning for subsequent packages
58 > + # (note: yes, it will eagerly repeat the update for next dirs
59 > + # but it's a minor issue and we have only one dir anyway)
60 > + if [[ ${files[@]} ]]; then
61 > + update-mime-database "${d}"
62 > + fi
63 > done
64 >
65 > if [[ ${files[@]} ]]; then
66
67 Please disregard this one for now, it needs more work.
68
69 --
70 Best regards,
71 Michał Górny