aptly-dev / aptly

aptly - Debian repository management tool

Home Page:https://www.aptly.info/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: option to generate a lastupdate file during aptly publish

Grimler91 opened this issue · comments

Detailed Description

To keep traffic to a minimum some mirrors would like to have a lastupdate file with timestamp of latest repo update. The mirror can then check this file before rsync'ing.

Context

See for example lastupdate check in archlinux's repo sync template (not an apt repo, but principle is the same).

Possible Implementation

I'm not very fluent in golang, but seems to me like it should be possible to (optionally) generate or update a lastupdate file in repo root (or perhaps a configurable subfolder) every time repo is re-published. From shell we can run date +%s > /path/to/aptly/published/folder/lastupdate to generate a lastupdate file with timestamp.

Your Environment

Hi,

could this be achieved by exploring the Release.gpg file ? A HTTP HEAD command returns the last modified:

$ curl --head http://aptlyserver/patch/dists/stable/Release.gpg
HTTP/1.1 200 OK
Server: nginx/1.22.1
Date: Wed, 20 Dec 2023 13:07:15 GMT
Content-Type: application/octet-stream
Content-Length: 516
Last-Modified: Wed, 20 Dec 2023 13:01:45 GMT
...

Hi @neolynx, I think for mirrors it would be useful with a lastupdate file, as that might be what they are used to. I can run a cronjob on the server and parse the Release file to generate a lastupdate file easily though, thanks for the idea!