Skip to content

Commit

Permalink
[GR-29049] Disable license storage.
Browse files Browse the repository at this point in the history
PullRequest: graal/8156
  • Loading branch information
sdedic committed Feb 3, 2021
2 parents 5553fb1 + 4087beb commit f6fd5e2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public static String findFileOwner(Path file) throws IOException {
return null;
}

static boolean licenseTracking = true;
static boolean licenseTracking = false;

public static boolean isLicenseTrackingEnabled() {
return licenseTracking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,21 @@ void acceptLicenses() throws IOException {
if (licensesToAccept.isEmpty()) {
return;
}
Set<String> processed = new HashSet<>(licensesToAccept.keySet());
createLicensePresenter().run();
processedLicenses.addAll(licensesToAccept.keySet());
processed.removeAll(licensesToAccept.keySet());
markLicensesProcessed(processed);
licensesToAccept.clear();
}

public Set<String> getProcessedLicenses() {
return new HashSet<>(processedLicenses);
}

public void markLicensesProcessed(Collection<String> licenseIDs) {
processedLicenses.addAll(licenseIDs);
}

public Set<String> getUnresolvedDependencies() {
return Collections.unmodifiableSet(unresolvedDependencies);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,8 @@ boolean isFinished() {
}

void acceptAllLicenses() {
for (String s : licensesToAccept.keySet()) {
for (MetadataLoader ldr : licensesToAccept.get(s)) {
ComponentInfo ci = ldr.getComponentInfo();
try {
localRegistry.acceptLicense(ci, s, loadLicenseText(s));
} catch (IOException ex) {
throw feedback.failure("INSTALL_ErrorHandlingLicenses", ex, ex.getLocalizedMessage());
}
}
for (String s : new ArrayList<>(licensesToAccept.keySet())) {
acceptLicense(s);
}
licensesToAccept.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class UpgradeProcess implements AutoCloseable {
private ComponentRegistry newGraalRegistry;
private Version minVersion = Version.NO_VERSION;
private String editionUpgrade;
private Set<String> acceptedLicenseIDs = new HashSet<>();

public UpgradeProcess(CommandInput input, Feedback feedback, ComponentCollection catalog) {
this.input = input;
Expand Down Expand Up @@ -269,6 +270,7 @@ boolean prepareInstall(ComponentInfo info) throws IOException {
MetadataLoader ldr = coreParam.createMetaLoader();
cmd.addLicenseToAccept(ldr);
cmd.acceptLicenses();
acceptedLicenseIDs = cmd.getProcessedLicenses();

// force download
ComponentParam param = input.existingFiles().createParam("core", info);
Expand Down Expand Up @@ -597,6 +599,7 @@ protected InstallCommand configureInstallCommand(InstallCommand instCommand) thr
instCommand.init(new InputDelegate(params), feedback);
instCommand.setAllowUpgrades(true);
instCommand.setForce(true);
instCommand.markLicensesProcessed(acceptedLicenseIDs);
return instCommand;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OLDS_ErrorReadingRelease=Error reading release {0}: {1}
ERR_CouldNotLoadGDS=Could not load GDS settings from {0}: {1}.
ERR_EmailAddressMissing=E-mail address is required to download from Oracle GDS.

MSG_EmailAddressEntry=Please provide an e-mail address to not show the license check again (optional). \
MSG_EmailAddressEntry=Please provide an e-mail address (optional). \
You may want to check Oracle Privacy Policy (https://www.oracle.com/legal/privacy/privacy-policy.html).
PROMPT_EmailAddressEntry=Enter a valid e-mail address:
# {0} - the entered e-mail address.
Expand Down

0 comments on commit f6fd5e2

Please sign in to comment.