[pacman-dev] [PATCH] Download sync database into temporary directory

Allan McRae allan at archlinux.org
Wed Jan 8 13:53:34 UTC 2020


On 8/1/20 11:31 pm, Dave Reisner wrote:
> On Wed, Jan 8, 2020, 07:30 Allan McRae <allan at archlinux.org> wrote:
> 
>> Sync databases (and signatures) are downloaded into a temporary directory.
>> On success, they are copied into the sync directory.
>>
> Why not use a temporary file in the sync dir? That allows you to rename
> atomically instead of copy+unlink. My guess is it's less code, too.

Two reasons - both may be wrong!

1) that looked difficult with _alpm_download.

2) I was hoping keeping the file names the same would mean minimal
changes to get signature validation working on the newly downloaded db.

What I could do, is create the temp directory inside the sync directory.

Allan


More information about the pacman-dev mailing list