-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In Mason, updates the source list of valid license names to the proper spdx repository. Also adds a new option to `mason publish`, `--refresh-licences` that will force delete and make a new clone of the license repository that is stored in the `.mason` folder. The feature is implemented in such a way that if it's passed, it will be the only option executed. This felt OK to me since it should be a very rarely if ever used option and it seemed like a distinct operation from the publishing actions. Includes some testing for the refresh-licenses feature, while there, updated some tests that had malformed arguments to the corresponding `mason` sub-function, and fixed some linter warnings for unused names and indentation. TESTING: - [x] paratest `[Summary: #Successes = 17229 | #Failures = 0 | #Futures = 926]` [reviewed by @benharsh - thanks!]
- Loading branch information
Showing
12 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Created new library project: publishCheck | ||
Created new application project: publishCheck | ||
Package does not gave a git origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use MasonPublish; | ||
use MasonEnv; | ||
use FileSystem; | ||
|
||
|
||
proc main() { | ||
const args = ["publish", "--refresh-licenses"]; | ||
const spdxDir = MASON_HOME + '/spdx'; | ||
const spdxTextDir = spdxDir + "/text"; | ||
if exists(spdxTextDir) then rmTree(spdxTextDir); | ||
masonPublish(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-M ../../../tools/mason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Force updating list of valid license names from SPDX repo... | ||
Done updating license list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use MasonPublish; | ||
use MasonEnv; | ||
use MasonUtils; | ||
use FileSystem; | ||
use Time; | ||
|
||
|
||
proc main() { | ||
const args = ["publish", "--refresh-licenses"]; | ||
const spdxDir = MASON_HOME + '/spdx'; | ||
const spdxTextDir = spdxDir + "/text"; | ||
|
||
// creates a new dir and clones when it doesn't exist, without overwrite flag | ||
if exists(spdxDir) then rmTree(spdxDir); | ||
writeln("spdx dir does not exist, creating it..."); | ||
refreshLicenseList(); | ||
|
||
assert(exists(spdxDir)); | ||
assert(exists(spdxTextDir)); | ||
writeln("spdx dir was created, removing the text/ subdir..."); | ||
rmTree(spdxTextDir); | ||
|
||
assert(!exists(spdxTextDir)); | ||
|
||
|
||
try! { | ||
refreshLicenseList(); // expect this to error because we deleted the text dir | ||
} catch e: MasonError { | ||
assert(!exists(spdxTextDir)); | ||
writeln("spdx/text dir was not recreated because we did not force an overwrite"); | ||
} | ||
|
||
sleep(5); // sleep a little to let git settle from the previous clone above | ||
refreshLicenseList(true); // set the overwrite flag to force getting the repo again | ||
assert(exists(spdxTextDir)); | ||
writeln("spdx/text dir was recreated with use of overwrite flag"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-M ../../../tools/mason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
spdx dir does not exist, creating it... | ||
spdx dir was created, removing the text/ subdir... | ||
spdx/text dir was not recreated because we did not force an overwrite | ||
spdx/text dir was recreated with use of overwrite flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters