Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Preserving mtimes for EAPI3
Date: Mon, 30 Mar 2009 23:00:01
Message-Id: 18897.20205.831430.895437@a1ihome1.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] Preserving mtimes for EAPI3 by "Petteri Räty"
1 >>>>> On Mon, 30 Mar 2009, Petteri Räty wrote:
2
3 > For most features the block is the need for Portage to implement the
4 > feature. If I read the thread correctly, Portage already implements
5 > what is wanted here so it's just a matter of agreeing on the
6 > specification.
7
8 Not completely. Portage preserves modification times already when
9 merging, but if we make updating of old timestamps mandatory (as
10 Ciaran has suggested), then this part is still missing in Portage.
11
12 But as far as I can see, something along the lines of the following
13 two commands [1] should be all that is needed:
14
15 find "${D}" -type f \( -newermt "@${stamp1}" -o -print0 \) \
16 | ${XARGS} -0 touch -c -d "@${stamp1}"
17
18 find "${D}" -type f -newermt "@${stamp2}" -print0 \
19 | ${XARGS} -0 touch -c -d "@${stamp2}"
20
21 Variables stamp1 and stamp2 would be assigned from $(date -u +"%s")
22 before pkg_setup and after src_install, respectively.
23
24 The second find command is sort of redundant, since it shouldn't
25 happen that ${D} contains files with timestamps from the future.
26 Maybe it's better to emit a warning in this case.
27
28 Ulrich
29
30 [1] For "find -newermt" we will need >=findutils-4.3.3 which shouldn't
31 be a problem because 4.3.4 went stable in May 2007.

Replies

Subject Author
[gentoo-dev] Re: Preserving mtimes for EAPI3 ABCD <en.ABCD@×××××.com>
Re: [gentoo-dev] Preserving mtimes for EAPI3 Timothy Redaelli <drizzt@g.o>