diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-24 18:22:25 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-11-24 18:22:25 +0100 |
commit | f6b8bb115cd60d0bb5c2d9cf586defebaf404bc6 (patch) | |
tree | c18b5f16ff019f9ae9dc75ab85602d0eb04e769e | |
parent | Drop changelogs from rsync data (diff) | |
download | mastermirror-scripts-f6b8bb115cd60d0bb5c2d9cf586defebaf404bc6.tar.gz mastermirror-scripts-f6b8bb115cd60d0bb5c2d9cf586defebaf404bc6.tar.bz2 mastermirror-scripts-f6b8bb115cd60d0bb5c2d9cf586defebaf404bc6.zip |
rsync-gen: Stop preserving mtimes from the git repository
The rsync pipeline is currently set to try to set mtimes of git
repository files to the time of last commit affecting them, and then
preserve that mtime to the final repository. This has little value
for end users, and causes two significant problems:
1. If the original mtime is wrong (i.e. a commit had wrong timestamp),
timestamps are not guaranteed to be monotonic and can just be insane.
2. If any file in the staging directory is rewritten without
modification, rsync passes the (unnecessary) mtime update to end
users.
To solve this, always pass '--no-times --checksum' to rsync. This way
timestamps on files in the staging and final directories are only
updated when the file content actually changes, being effectively
equivalent to the vanilla git behavior.
The only possible drawback of this is that if staging/final directory is
wiped for some reason, their contents need to be restored from other
mirror with preserved timestamps, or otherwise users (who don't use
checksumming) will notice a full-tree resync.
-rwxr-xr-x | rsync-gen.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rsync-gen.sh b/rsync-gen.sh index e3bdeb4..e774c83 100755 --- a/rsync-gen.sh +++ b/rsync-gen.sh @@ -102,7 +102,7 @@ fi # Keep /metadata/cache around so the --rsync switch of egencache will work as # designed timelog_start "STAGEDIR_repo_gentoo RSYNC" | timelogger -rsync -Wqau \ +rsync -Wqau --checksum --no-times \ $RSYNC_GIT_EXCLUDE \ --filter 'P /metadata/***' \ --filter 'Pp Manifest' \ @@ -221,35 +221,35 @@ timelog___end "MANIFEST-VALIDATE" | timelogger # 3) place dtd info in STAGEDIR_repo_gentoo timelog_start "DTD" | timelogger -rsync -Wqa --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/dtd ${STAGEDIR_repo_gentoo}/metadata/ +rsync -Wqa --no-times --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/dtd ${STAGEDIR_repo_gentoo}/metadata/ date -R -u > ${STAGEDIR_repo_gentoo}/metadata/dtd/timestamp.chk timelog___end "DTD" | timelogger # end 3) # 3b) place xml schemas in STAGEDIR_repo_gentoo timelog_start "XML-SCHEMA" | timelogger -rsync -Wqa --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/xml-schema ${STAGEDIR_repo_gentoo}/metadata/ +rsync -Wqa --no-times --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/xml-schema ${STAGEDIR_repo_gentoo}/metadata/ date -R -u > ${STAGEDIR_repo_gentoo}/metadata/xml-schema/timestamp.chk timelog___end "XML-SCHEMA" | timelogger # end 3b) # 4) place glsa's in STAGEDIR_repo_gentoo timelog_start "GLSA" | timelogger -rsync -Wqa --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/glsa ${STAGEDIR_repo_gentoo}/metadata/ +rsync -Wqa --no-times --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/glsa ${STAGEDIR_repo_gentoo}/metadata/ date -R -u > ${STAGEDIR_repo_gentoo}/metadata/glsa/timestamp.chk timelog___end "GLSA" | timelogger # end 4) # 5) place news in STAGEDIR_repo_gentoo timelog_start "NEWS" | timelogger -rsync -Wqa --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/gentoo-news/. ${STAGEDIR_repo_gentoo}/metadata/news +rsync -Wqa --no-times --checksum --exclude=CVS --exclude=.git --delete ${EXPORTS}/gentoo-news/. ${STAGEDIR_repo_gentoo}/metadata/news date -R -u > ${STAGEDIR_repo_gentoo}/metadata/news/timestamp.chk timelog___end "NEWS" | timelogger # end 5) # 6) place projects.xml in STAGEDIR_repo_gentoo timelog_start "HERDS-AND-PROJ" | timelogger -rsync -Wqa --checksum ${EXPORTS}/projects/projects.xml ${STAGEDIR_repo_gentoo}/metadata/projects.xml +rsync -Wqa --no-times --checksum ${EXPORTS}/projects/projects.xml ${STAGEDIR_repo_gentoo}/metadata/projects.xml timelog___end "HERDS-AND-PROJ" | timelogger # end 6) @@ -267,7 +267,7 @@ FINALDIR_repo_gentoo_tmp=${FINALDIR_repo_gentoo%/} mkdir -p "${FINALDIR_repo_gentoo_tmp}-1" "${FINALDIR_repo_gentoo_tmp}-2" $atomic_rsync -Wqa --exclude=/metadata/timestamp.chk --delete --checksum \ --exclude=.git --exclude=CVS --exclude=.gitignore \ - --chmod=u-s,g-s \ + --chmod=u-s,g-s --no-times \ ${STAGEDIR_repo_gentoo}/ \ ${FINALDIR_repo_gentoo}/ |