Gentoo Archives: gentoo-dev

From: ABCD <en.ABCD@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Preserving mtimes for EAPI3
Date: Tue, 31 Mar 2009 00:02:16
Message-Id: gqrmee$um6$1@ger.gmane.org
In Reply to: Re: [gentoo-dev] Preserving mtimes for EAPI3 by Ulrich Mueller
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Ulrich Mueller wrote:
5 > But as far as I can see, something along the lines of the following
6 > two commands [1] should be all that is needed:
7 >
8 > find "${D}" -type f \( -newermt "@${stamp1}" -o -print0 \) \
9 > | ${XARGS} -0 touch -c -d "@${stamp1}"
10 >
11 > find "${D}" -type f -newermt "@${stamp2}" -print0 \
12 > | ${XARGS} -0 touch -c -d "@${stamp2}"
13 >
14 > Variables stamp1 and stamp2 would be assigned from $(date -u +"%s")
15 > before pkg_setup and after src_install, respectively.
16 >
17 > The second find command is sort of redundant, since it shouldn't
18 > happen that ${D} contains files with timestamps from the future.
19 > Maybe it's better to emit a warning in this case.
20 >
21 > Ulrich
22 >
23 > [1] For "find -newermt" we will need >=findutils-4.3.3 which shouldn't
24 > be a problem because 4.3.4 went stable in May 2007.
25
26
27 Personally, I would use
28
29 find "${D}" -type f \! -newermt "@${stamp1}" -exec \
30 touch -c -d "@${stamp1}" {} +
31
32 and
33
34 find "${D}" -type f -newermt "@${stamp2}" -exec \
35 touch -c -d "@${stamp2}" {} +
36
37 to avoid an unneeded call to xargs.
38
39 Just my USD0.02,
40 - --
41 ABCD
42 (and the bikeshed shall be BLUE)
43 -----BEGIN PGP SIGNATURE-----
44 Version: GnuPG v2.0.11 (GNU/Linux)
45 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
46
47 iEYEARECAAYFAknRXQIACgkQOypDUo0oQOo9DwCeJ3O/cnVo2HIc2J88jSj/C1Tc
48 50kAoI+slGgo2M+ghs2j+awOrrCXyuEl
49 =c5R7
50 -----END PGP SIGNATURE-----

Replies

Subject Author
[gentoo-dev] Re: Preserving mtimes for EAPI3 Ulrich Mueller <ulm@g.o>