Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH autotools-utils] Determine need of autoreconf through checksums, not mtimes.
Date: Sun, 22 Jan 2012 15:06:55
Message-Id: 1327244853-16008-1-git-send-email-mgorny@gentoo.org
1 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=399641
2 ---
3 autotools-utils.eclass | 15 +++++++++------
4 1 files changed, 9 insertions(+), 6 deletions(-)
5
6 diff --git a/autotools-utils.eclass b/autotools-utils.eclass
7 index 7ed6856..5d2a987 100644
8 --- a/autotools-utils.eclass
9 +++ b/autotools-utils.eclass
10 @@ -362,14 +362,17 @@ autotools-utils_src_prepare() {
11
12 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
13
14 - touch "${T}"/.autotools-utils.timestamp || die
15 + at_checksum() {
16 + find '(' -name 'Makefile.am' \
17 + -o -name 'configure.ac' \
18 + -o -name 'configure.in' ')' \
19 + -exec cksum {} + | sort -k2
20 + }
21 +
22 + [[ ! ${want_autoreconf} ]] && local checksum=$(at_checksum)
23 epatch_user
24 if [[ ! ${want_autoreconf} ]]; then
25 - if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \
26 - -a '(' -name 'Makefile.am' \
27 - -o -name 'configure.ac' \
28 - -o -name 'configure.in' ')' \
29 - -print -quit) ]]; then
30 + if [[ ${checksum} != $(at_checksum) ]]; then
31 einfo 'Will autoreconfigure due to user patches applied.'
32 want_autoreconf=yep
33 fi
34 --
35 1.7.8.4