Hi,
2010/5/31 Michael Olbrich <[email protected]>:
> On Sat, May 29, 2010 at 11:08:30PM +0200, Remy Bohmer wrote:
>> If the ptxdist project is build from a Source Control Management tool
>> that makes files read-only, then ptxdist fails when it wants to
>> overwrite the kernel-config after the kernel-old-config step.
>>
>> It is not a real error, the oldconfig has succeed, so just print
>> a warning about the read-only file instead of fail completely.
>>
>> Signed-off-by: Remy Bohmer <[email protected]>
>> Acked-by: Marc Kleine-Budde <[email protected]>
>> ---
>> rules/kernel.make | 6 +++++-
>> 1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/rules/kernel.make b/rules/kernel.make
>> index 9477502..f8c2c09 100644
>> --- a/rules/kernel.make
>> +++ b/rules/kernel.make
>> @@ -125,7 +125,11 @@ ifdef KERNEL_INITRAMFS_SOURCE_y
>> endif
>>
>> @$(call ptx/oldconfig, KERNEL)
>> - @cp "$(KERNEL_DIR)/.config" "$(<)"
>> + @if [ -w $(<) ]; then \
>> + cp "$(KERNEL_DIR)/.config" "$(<)"; \
>> + else \
>> + echo "WARNING: $(<) is Read-only, not updating it!" 1>&2; \
>> + fi
>
> I don't like this. $(KERNEL_CONFIG) may not be readonly on purpose and
> changes get lost. What about:
>
> if diff -q "$(KERNEL_DIR)/.config" "$(<)" > /dev/null; then
> cp "$(KERNEL_DIR)/.config" "$(<)"
> fi
>
> Then it only fails if there are changes.
This will not work, since it always changes, even if there is not
actually made a change at all.
It changes because the timestamp at the 4th line in the config file
will be updated on every 'make oldconfig' , resulting in that always a
difference will be detected. It could only work if a compare is done
only on the lines that do not start with '#', like this
if diff -q -I '#' "$(KERNEL_DIR)/.config" "$(<)" > /dev/null; then
cp "$(KERNEL_DIR)/.config" "$(<)"
fi
What do you think of that?
Kind regards,
Remy
--
ptxdist mailing list
[email protected]