Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH v2 3/4] Use ctime in cache post-postinst checks
Date: Wed, 16 Aug 2017 18:09:36
Message-Id: 20170816180914.11073-3-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2 1/4] Support post-postinst QA checks by "Michał Górny"
1 Use ctime rather than mtime in cache post-postinst checks since mtime
2 may be preserved from the original tarball, and therefore be 'long time
3 ago'. ctime is more reliable in this regard.
4 ---
5 bin/postinst-qa-check.d/50gnome2-utils | 2 +-
6 bin/postinst-qa-check.d/50xdg-utils | 4 ++--
7 2 files changed, 3 insertions(+), 3 deletions(-)
8
9 diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils
10 index 68e21cb74..4e7c6eb85 100644
11 --- a/bin/postinst-qa-check.d/50gnome2-utils
12 +++ b/bin/postinst-qa-check.d/50gnome2-utils
13 @@ -10,7 +10,7 @@ gnome2_icon_cache_check() {
14 # if the cache does not exist at all, we complain for any file
15 # otherwise, we look for files newer than the cache
16 [[ -f ${d}/icon-theme.cache ]] &&
17 - find_args+=( -newer "${d}"/icon-theme.cache )
18 + find_args+=( -newercm "${d}"/icon-theme.cache )
19
20 # (use -mindepth 2 to easily skip the cache files)
21 while read -r -d $'\0' f; do
22 diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils
23 index 4bc7bee9a..b0bb029bd 100644
24 --- a/bin/postinst-qa-check.d/50xdg-utils
25 +++ b/bin/postinst-qa-check.d/50xdg-utils
26 @@ -9,7 +9,7 @@ xdg_desktop_database_check() {
27 # if the cache does not exist at all, we complain for any file
28 # otherwise, we look for files newer than the cache
29 [[ -f ${d}/mimeinfo.cache ]] &&
30 - find_args+=( -newer "${d}"/mimeinfo.cache )
31 + find_args+=( -newercm "${d}"/mimeinfo.cache )
32
33 # look for any .desktop files that are newer than the cache
34 # and that have any mime types defined
35 @@ -37,7 +37,7 @@ xdg_mimeinfo_database_check() {
36 # if the cache does not exist at all, we complain for any file
37 # otherwise, we look for files newer than the cache
38 [[ -f ${d}/mime.cache ]] &&
39 - find_args+=( -newer "${d}"/mime.cache )
40 + find_args+=( -newercm "${d}"/mime.cache )
41
42 while read -r -d $'\0' f; do
43 files+=( "${f}" )
44 --
45 2.14.1