autotools-utils_src_prepare() creates ${T}/.autotools-utils.timestamp, applies patches and compares mtimes of ${T}/.autotools-utils.timestamp and files like configure.ac. ext3 filesystems have 1-second precision, so these files are likely to have the same mtimes, which results in not calling autotools-utils_autoreconf(). 'sleep 2' should suffice for /var/tmp/portage on ext3 and FAT filesystems. --- autotools-utils.eclass +++ autotools-utils.eclass @@ -361,6 +361,7 @@ local want_autoreconf=${AUTOTOOLS_AUTORECONF} touch "${T}"/.autotools-utils.timestamp || die + sleep 2 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" epatch_user if [[ ! ${want_autoreconf} ]]; then
Alternative solution: [[ -n "$(grep -E -- '^--- ([^[:space:]]/)?(configure\.ac|configure\.in|Makefile\.am)($|[[:space:]])' "${PATCHES[@]}")" ]]
Ouch. Sleeping is definitely not a solution. I guess we'll just have to compare checksums of files then.
a parsing solution such as comment #1 sounds less expensive than comparing checksums
(In reply to comment #3) > a parsing solution such as comment #1 sounds less expensive than comparing > checksums The check is supposed to be triggered by user patches only. I don't really want to copy stuff from epatch_user().
Untested code: local -A checksums=() local file while read -d $'\0' -r file; do checksums["${file}"]="$(sha512sum "${file}")" done < <(find "(" -name Makefile.am -o -name configure.ac -o -name configure.in ")" -print0) epatch_user for file in "${!checksums[@]}"; do if [[ "${checksum[${file}]}" != "$(sha512sum "${file}")" ]]; then want_autoreconf=yes fi done
(In reply to comment #5) > if [[ "${checksum[${file}]}" != "$(sha512sum "${file}")" ]]; then if [[ "${checksums[${file}]}" != "$(sha512sum "${file}")" ]]; then
Overcomplicated as usual :P. I was thinking more of: checksums=$(find ... -exec md5sum {} + | sort -k2) epatch_user [[ $checksums == $(find ...) ]] But I'm wondering what would be the best checksumming tool to use. It should be both fast and provided by @system.
*** Bug 399699 has been marked as a duplicate of this bug. ***
Created attachment 299531 [details, diff] Determine need of autoreconf through checksums, not mtimes. Fixes:
out of curiosity does `cksum` work also on BSD? I see sys-apps/coreutils is masked on that system
(In reply to comment #10) > out of curiosity does `cksum` work also on BSD? I see sys-apps/coreutils is > masked on that system I'd appreciate any details on that. I can use 'sum' instead if that one's available.
(In reply to comment #11) > (In reply to comment #10) > > out of curiosity does `cksum` work also on BSD? I see sys-apps/coreutils is > > masked on that system > > I'd appreciate any details on that. I can use 'sum' instead if that one's > available. digging the internet deeper it seem to be included by posix.2 standard, so it's probably part of every *nix base system. This page: http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN1/0586____.HTM show that also on AIX the output is the same, so probably `cksum` is a safe bet.
Ah, that was fixed long ago.