[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: git-version-gen doc: writing to intermediate file
From: |
Basil L. Contovounesios |
Subject: |
Re: git-version-gen doc: writing to intermediate file |
Date: |
Fri, 26 Jul 2024 16:37:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Bruno Haible [2024-07-26 16:27 +0200] wrote:
> Basil L. Contovounesios wrote:
>
>> $(top_srcdir)/.version:
>> echo '$(VERSION)' > $@-t
>> mv $@-t $@
>> ...
>> I'm curious why one recipe writes a temporary file first
> The real reason is that if the disk is full, the rule would leave an
> empty file on the disk and fail, and even after the user makes room
> on the disk and runs "make" a second time, the empty file would persist
> and cause trouble.
>
>> dist-hook:
>> echo '$(VERSION)' > $(distdir)/.tarball-version
>>
>> whereas the other writes the target directly.
>
> Here it does so because the file is inside a temporary directory. If
> the "make dist" rule fails, the user has to remove the temporary directory
> entirely anyway, and that will also take care of the empty file.
Ah, makes sense.
Thank you very much for the explanation!
--
Basil