RFR: 8333685: Make update-copyright-year script more useful
Thomas Stuefe
stuefe at openjdk.org
Tue Jun 11 07:54:14 UTC 2024
On Fri, 7 Jun 2024 19:01:45 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:
> Hi all,
>
> This PR addresses [8333685](https://bugs.openjdk.org/browse/JDK-8333685).
>
> I have added the following enhancements:
> - Removed uses of `fgrep` and `egrep` with `grep -F` and `grep -E` respectively.
> - Altered default behaviour to limit the processed changesets to those in the current branch and the current year.
> - Enabled an option to modify all changesets in the year if desired (this was the previous default behaviour).
> - Added named parameters and enabled `--help`.
> - Removed mercurial support.
> - Fixed a bug where copyright headers that didn't have a comma following the initial year of creation were not getting picked up. For example, [here](https://github.com/openjdk/jdk/blob/512b2b4f141f9a202984150b0427372e1a409a50/src/hotspot/cpu/zero/copy_zero.hpp#L3).
> - Fixed a bug where copyright headers missing the copyright symbol (c) were not getting picked up. Refer to the example above as well.
>
> Thanks,
> Sonia
Thanks for tackling this.
When it will work, it will be very useful, but so far I did not get it to work on my Mac m1.
It identifies the commits correctly that are part of the delta to master, as it should. But it does not modify any copyrights. I tracked this down to the sed's in updateFile not doing anything.
I tried the script on this branch: https://github.com/tstuefe/jdk/tree/do-some-stuff-in-aix and called the script without command line args. It should have found and fixed the Oracle copyrights in osThread_aix.xxx
For reference, this is how the expanded sed arguments look like:
s@(Copyright ((c) )?[12][0-9][0-9][0-9],) [12][0-9][0-9][0-9], Oracle@\1 2024, Oracle@
s@(Copyright ((c) )?[12][0-9][0-9][0-9],) Oracle@\1 2024, Oracle@
s@(Copyright ((c) )?[12][0-9][0-9][0-9]) Oracle@\1, 2024, Oracle@
s at Copyright 2024, 2024, Oracle at Copyright 2024, Oracle@
s at Copyright (c) 2024, 2024, Oracle at Copyright (c) 2024, Oracle@
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19605#issuecomment-2160035105
More information about the build-dev
mailing list