Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8e78d3e

Browse files
authored
Update the instructions for updating licenses. (#51297)
* Adds markdown formatting to better highlight the important bits. * Removes the bit about patch files not being valid because they are copied from the GitHub UI (we use LUCI now). * Add a shortcut for Mac to apply the patch from your pasteboard.
1 parent de8d9ee commit 8e78d3e

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

tools/licenses/README.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
# Update License Files
22

33
## Apply patch generated by CI
4-
If you're not working on a Linux box then you can't auto-generate license files. A workaround is provided via CI.
5-
6-
Your build will fail one or more CI checks if your license files are not correct. Open the failing CI check. In the CI output you will find a patch diff that represents the changes that need to be made to your license files.
4+
If you're not working on a Linux box then you can't auto-generate license
5+
files. A workaround is provided via CI.
6+
7+
Your build will fail one or more CI checks if your license files are not
8+
correct. Open the failing CI check. In the CI output you will find a
9+
patch diff that represents the changes that need to be made to your
10+
license files.
11+
12+
> [!WARNING]
13+
> Do this only if the diff does not change _which_ licenses are being
14+
> included, but affects just the `FILE:` metadata and so forth in the
15+
> golden files. If the actual content of the licenses has changed, you
16+
> will need to rerun the script from a Linux box to update the actual
17+
> LICENSE file, as described below.
18+
19+
```sh
20+
cd flutter/ci/licenses_golden
21+
```
722

8-
IF (and only if!) the diff does not change _which_ licenses are being included, but only affects the `FILE:` metadata and so forth in the golden files, then you can click `Download full logs` (Github removes lines with only whitespaces, which invalidates the diff), copy this patch to a temporary patch file wherever you'd like, and then apply the patch to your repo:
23+
If the file is to `my/patch/file` locally. The `-p2` strips two path
24+
components from the file paths in the diff. Adjust as necessary.
925

10-
```
11-
cd flutter/ci/licenses_golden
26+
```sh
1227
patch -p2 < my/patch/file
1328
```
1429

15-
HOWEVER, if the actual content of the licenses changed then you will need to rerun the script from a Linux box to update the actual LICENSE file, as described below.
30+
If the patch file is copied in your clipboard. On Mac, you may apply the patch from there.
31+
32+
```sh
33+
pbpaste | patch -p2
34+
```
35+
36+
## Check for license changes
1637

17-
## Check for license changes (Only works on Linux)
38+
> [!WARNING]
39+
> Only works on Linux.
1840
1941
This script has two sets of output files: "goldens", which describe
2042
the current license state of the repository, and the actual real
@@ -46,11 +68,12 @@ cp ../../../out/licenses/* ../../ci/licenses_golden
4668
git diff
4769
```
4870

49-
If the only changes are to what files are included, then you're good
50-
to go. However, if any of the _licenses_ changed, whether new licenses
51-
are added, old ones removed, or any have their content changed in
52-
_any_ way (including, e.g., whitespace changes), or if the affected
53-
libraries change, **you must update the actual license file**.
71+
> [!IMPORTANT]
72+
> If the only changes are to what files are included, then you're good
73+
> to go. However, if any of the _licenses_ changed, whether new licenses
74+
> are added, old ones removed, or any have their content changed in
75+
> _any_ way (including, e.g., whitespace changes), or if the affected
76+
> libraries change, **you must update the actual license file**.
5477
5578
The `sky/packages/sky_engine/LICENSE` file is the one actually
5679
included in product releases and the one that should be updated any

0 commit comments

Comments
 (0)