Enable addheader to replace existing copyright/licensing info
As of now, when running addheader on a file that already has licensing and/or copyright info, it just adds a new line if it's different from the existing info.
addheader should have a flag to rewrite the existing information, for instance in the case someone made a mistake or wants to update information.
Here, the documentation is also a bit confusing I think:
The REUSE header is placed at the very top of the file. If a different REUSE header already existed—at the top or elsewhere—its tags are copied, and the header is replaced in-place.
Sounds like a good idea.
The REUSE header is placed at the very top of the file. If a different REUSE header already existed—at the top or elsewhere—its tags are copied, and the header is replaced in-place.
I can appreciate that this is confusing. Basically what it is trying to convey is that the SPDX information is extracted from the existing header, and the header is then replaced entirely. This is relevant in the example below:
# SPDX-License-Identifier: GPL-3.0-or-later
#
# ... the whole GPL blurb here
If you do addheader --copyright='Jane Doe', this becomes:
# SPDX-FileCopyrightText: 2020 Jane Doe
#
# SPDX-License-Identifier: GPL-3.0-or-later
The blurb is gone.
Will probably need to reword, or simply give the above example.