~sircmpwn/sr.ht-dev

Development discussion for sr.ht. When contributing patches to sr.ht, please edit the [PATCH] line to include the specific sr.ht project you're contributing to, e.g.

[PATCH lists.sr.ht v2] Add thing to stuff
5 2

[PATCH man.sr.ht/root] Document Debian repository

Details
Message ID
<20190806092006.23783-1-denis@laxalde.org>
DKIM signature
missing
Download raw message
Patch: +17 -0
---
 packages.md | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/packages.md b/packages.md
index f4917f7..cc7c3c0 100644
--- a/packages.md
+++ b/packages.md
@@ -31,3 +31,20 @@ Server = https://mirror.sr.ht/archlinux/sr.ht
 $ pacman-key --recv-keys C0AAFC1676BD998617C94C42DC59670F1EB0A189
 $ pacman-key --lsign-key C0AAFC1676BD998617C94C42DC59670F1EB0A189
 ```
+
+## Debian
+
+Note: this repository is a work in progress. It is not automatically updated
+at the moment.
+
+**Mirror URL**: `https://mirror.sr.ht/debian`
+
+```
+deb https://mirror.sr.ht/debian sid main
+```
+
+**Signing Key**: https://mirror.sr.ht/debian/key.asc
+
+```
+wget -q https://mirror.sr.ht/debian/key.asc  -O - | sudo apt-key --keyring /etc/apt/trusted.gpg.d/debian.sr.ht.gpg add -
+```
-- 
2.20.1
Details
Message ID
<BW3UI326SOVC.6K62T1XGFGEB@koishi>
In-Reply-To
<20190806092006.23783-1-denis@laxalde.org> (view parent)
DKIM signature
pass
Download raw message
Let's get these building automatically before we put them up here.
Details
Message ID
<20190809085342.klqfrw5xr3lhvaan@logilab.fr>
In-Reply-To
<BW3UI326SOVC.6K62T1XGFGEB@koishi> (view parent)
DKIM signature
missing
Download raw message
Drew DeVault wrote:
> Let's get these building automatically before we put them up here.

I think it wouldn't be too hard to have packages built automatically
from each component's source by adding a manifest file in each .builds
directory.

But them I'm stuck for the upload step because I don't know how to
"incrementally" update the repository safely, i.e. prevent the resulting
repository to become "corrupted" if several jobs attempts to write to it
at the same time (many "metadata" files about the repository overall
need to be kept consistent).
Details
Message ID
<BW783TXOB7RJ.1VIMA81MI2ZGK@koishi>
In-Reply-To
<20190809085342.klqfrw5xr3lhvaan@logilab.fr> (view parent)
DKIM signature
pass
Download raw message
On Fri Aug 9, 2019 at 10:53 AM Denis Laxalde wrote:
> But them I'm stuck for the upload step because I don't know how to
> "incrementally" update the repository safely, i.e. prevent the resulting
> repository to become "corrupted" if several jobs attempts to write to it
> at the same time (many "metadata" files about the repository overall
> need to be kept consistent).

Perhaps you could introduce a locking file? Or ideally the update could
be done atomically, by e.g. building up the new repo's state in a
separate directory and mv'ing it into place once it's consistent.
Details
Message ID
<20190813133300.hdrerlrr2hmsqhuc@logilab.fr>
In-Reply-To
<BW783TXOB7RJ.1VIMA81MI2ZGK@koishi> (view parent)
DKIM signature
missing
Download raw message
Drew DeVault a écrit :
> Perhaps you could introduce a locking file? Or ideally the update could
> be done atomically, by e.g. building up the new repo's state in a
> separate directory and mv'ing it into place once it's consistent.

That seems doable using an "incoming" directory on the mirror to store
packages built by CI on each components (not touching the repository)
and then processing this directory to actually include the package in
the repository. (There are commands for that in the repository
management tool I'm using -- reprepro.) I'm not sure when/how to run the
"process-incoming" job, maybe using a scheduled job triggered by a cron
once a day?

(I'll work back on this in September.)
Details
Message ID
<BW9SJ4R69WOG.MGV14XQQ9JDR@koishi>
In-Reply-To
<20190813133300.hdrerlrr2hmsqhuc@logilab.fr> (view parent)
DKIM signature
pass
Download raw message
Can we instead have a lockfile?

	while [ -e /var/www/.../debian/lockfile ]
	do
		sleep 1
		# Failing after N tries is an exercise left to the reader
	done
	touch /var/www/.../debian/lockfile
	trap 'rm /var/www/.../debian/lockfile' EXIT
	# ...proceed normally..