commit:     da70f89cd88968501ca07cfaca6d73665d6e767a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue May 23 09:08:36 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 01:33:06 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=da70f89c

Drop ignore-mtime from features

The ignore-mtime feature violates PMS:
https://projects.gentoo.org/pms/8/pms.html#x1-14500013.3.2

Allowing the package manager to arbitrarily modify timestamps of
installed files will lead to problems with several languages:

  - Lisp (*.fasl must be newer than corresponding *.lisp)
  - Emacs (*.elc must not be older than *.el)
  - ghdl/VHDL (libraries check their mtimes)
  - Python (*.pyc vs *.py, not sure if this one is still an issue)

If the PM does not preserve timestamps, there is no reasonable way to
work around this on the ebuild level. (Some horrible hacks existed in
the past, see for example impl-*-timestamp-hack in previous versions
of common-lisp-common*.eclass which used to overwrite its installed
files in pkg_postinst.)

This partially reverts commit 89703c688868c9eb8cd6115cb42ff92f0b9668b8.

Closes: https://bugs.gentoo.org/906978
See-also: https://bugs.gentoo.org/264130
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/const.py         |  1 -
 lib/portage/dbapi/vartree.py | 14 ++++++--------
 man/make.conf.5              |  6 ------
 3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/lib/portage/const.py b/lib/portage/const.py
index cb6796164..10a208ceb 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -159,7 +159,6 @@ SUPPORTED_FEATURES = frozenset(
         "getbinpkg",
         "gpg-keepalive",
         "icecream",
-        "ignore-mtime",
         "installsources",
         "ipc-sandbox",
         "keeptemp",

diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 441e74661..dac350880 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -5422,7 +5422,6 @@ class dblink:
         srcroot = normalize_path(srcroot).rstrip(sep) + sep
         destroot = normalize_path(destroot).rstrip(sep) + sep
         calc_prelink = "prelink-checksums" in self.settings.features
-        ignore_mtime = "ignore-mtime" in self.settings.features
 
         protect_if_modified = (
             "config-protect-if-modified" in self.settings.features
@@ -5831,13 +5830,12 @@ class dblink:
                         hardlink_candidates.append(mydest)
                         zing = ">>>"
                     else:
-                        if not ignore_mtime:
-                            mymtime = thismtime if thismtime is not None else 
mymtime
-                            try:
-                                os.utime(mydest, ns=(mymtime, mymtime))
-                            except OSError:
-                                # utime can fail here with EPERM
-                                pass
+                        mymtime = thismtime if thismtime is not None else 
mymtime
+                        try:
+                            os.utime(mydest, ns=(mymtime, mymtime))
+                        except OSError:
+                            # utime can fail here with EPERM
+                            pass
                         zing = "==="
 
                     try:

diff --git a/man/make.conf.5 b/man/make.conf.5
index ed5b7d7fc..85ee88c05 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -533,12 +533,6 @@ If your GPG is auto unlocked on login, you do not need 
this.
 .B icecream
 Enable portage support for the icecream package.
 .TP
-.B ignore\-mtime
-Do not update mtime if the target file is equal. This can be useful on some
-filesystems to better utilize features like snapshots and data deduplication,
-however this violates the preservation of file modification times as stipulated
-in the PMS.
-.TP
 .B installsources
 Install source code into /usr/src/debug/${CATEGORY}/${PF} (also see
 \fBsplitdebug\fR). This feature works only if debugedit is installed, CFLAGS

Reply via email to