Skip to content
Snippets Groups Projects
Verified Commit 2edd43dc authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

feat(db-archive): Archive package files atomically

With the archive and repos no longer hosted on the same server[1], we
can let archivetools[2] update the packages directory on the archive
server once a day and risk losing packages (if a package is updated
multiple times in the same day).

This is not ideal, so instead we will continue as before and let
db-archive store the archived packages locally and then we will transfer
them from the repos server to the archive server.

The transfer part is more easily done, if the archived package files are
copied in place in an atomic way on the repos server as we don't risk
transferring partially written files that way.

[1] https://lists.archlinux.org/archives/list/arch-dev-public@lists.archlinux.org/thread/B66SQUW4HOJAN2WHG4RLEBLYWNWOSF3Y/
[2] https://gitlab.archlinux.org/archlinux/archivetools/-/blob/d5cbd5a5a9454eecd5c46b64ebc08d5087a25f2d/archive.sh#L141-L200
parent a56c7109
No related branches found
No related tags found
No related merge requests found
Pipeline #117014 passed
......@@ -17,5 +17,9 @@ archive_dir="${ARCHIVE_BASE}/packages/${pkgname:0:1}/${pkgname}"
if [[ ! -f ${archive_dir}/${pkgfile} ]]; then
mkdir -p "${archive_dir}"
cp -np "${1}"{,.sig} "${archive_dir}/"
cp -p "${1}" "${archive_dir}/.${pkgfile}"
cp -p "${1}.sig" "${archive_dir}/.${pkgfile}.sig"
mv "${archive_dir}/"{.,}"${pkgfile}"
mv "${archive_dir}/"{.,}"${pkgfile}.sig"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment