In Manifest.write(), if the mtime is set to the max of all involved files (including the existing Manifest), then conversion of thin manifests to thick manifests will result in Manifest files with stable/predictable mtime for rsync (bug 557192).
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_557962 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/eb907a3b724bfecfca4de2b80c99c624
This is in the master branch now: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6dacd0ed9f6dc206f4932d42bbb36300f56e71f7
Alternative is to take the mtime of the parent dir, and retain that, including the dir itself, such as in: http://hg.code.sf.net/p/gentooprefixtree/code/rev/0679eab6c25f In any case, make sure you retain the mtime of the dir, else it will cause it to be rsync-ed every time as well, which is unnecessary.
(In reply to Fabian Groffen from comment #3) > In any case, make sure you retain the mtime of the dir, else it will cause > it to be rsync-ed every time as well, which is unnecessary. The dir mtime should be irrelevant, since we added --omit-dir-times to PORTAGE_RSYNC_OPTS a couple of years ago: https://gitweb.gentoo.org/proj/portage.git/commit/?id=367bbdfdab866c00c0d826732d4672ed3863fa09
/etc/portage/repo.postsync.d/example
correction: Released in portage-2.2.21