use of org.graalvm.component.installer.persist.MetadataLoader in project graal by oracle.
the class LicensePresenter method isLicenseRemote.
boolean isLicenseRemote(String licenseId) {
MetadataLoader ldr = licensesToAccept.get(licenseId).get(0);
String licPath = ldr.getLicensePath();
// NOI18N
return SystemUtils.isRemotePath(licPath);
}
use of org.graalvm.component.installer.persist.MetadataLoader in project graal by oracle.
the class InstallCommand method processComponents.
protected void processComponents(Iterable<ComponentParam> toProcess) throws IOException {
for (Iterator<ComponentParam> it = toProcess.iterator(); it.hasNext(); ) {
appendParameterText();
ComponentParam p = it.next();
feedback.output(p.isComplete() ? "INSTALL_VerboseProcessingArchive" : "INSTALL_VerboseProcessingComponent", p.getDisplayName());
current = p.getSpecification();
MetadataLoader ldr = validateDownload ? p.createFileLoader() : p.createMetaLoader();
Installer inst = createInstaller(p, ldr);
if (!verifyInstaller(inst)) {
continue;
}
if (registerComponent(inst, p)) {
addLicenseToAccept(inst, ldr);
if (p.isComplete()) {
// null realInstaller will be handled in completeInstallers() later.
realInstallers.put(p, inst);
} else {
realInstallers.put(p, null);
}
}
current = null;
URL remote = ldr.getComponentInfo().getRemoteURL();
if (remote == null || remote.getProtocol().equalsIgnoreCase("file")) {
wasFile = true;
}
}
}
use of org.graalvm.component.installer.persist.MetadataLoader in project graal by oracle.
the class InfoCommand method processComponentParam.
void processComponentParam(ComponentParam cp) throws IOException {
MetadataLoader ldr = cp.createMetaLoader();
components.add(cp);
loadComponentDetails(cp, ldr);
// registerFile(f, ldr.getComponentInfo(), ldr);
addComponent(cp, ldr.getComponentInfo());
}
use of org.graalvm.component.installer.persist.MetadataLoader in project graal by oracle.
the class UpgradeTest method testUpgradeWithDependencies.
/**
* Upgrade an installation with "ruby" to a newer one, where "ruby" has a dependency on an
* additional component. The other component should be auto-installed.
*/
@Test
public void testUpgradeWithDependencies() throws Exception {
initVersion("1.0.0.0", "../repo/catalog-19.3.properties");
ComponentInfo ci = new ComponentInfo("org.graalvm.r", "Installed R", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
textParams.add("r");
ComponentInfo graalInfo = cmd.configureProcess();
assertNotNull(graalInfo);
assertEquals(Version.fromString("19.3.0.0"), graalInfo.getVersion());
boolean installed = cmd.getProcess().installGraalCore(graalInfo);
assertTrue(installed);
factory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput in) {
RemoteCatalogDownloader dnl = new RemoteCatalogDownloader(in, UpgradeTest.this, downloader.getOverrideCatalogSpec());
// carry over the override spec
return new CatalogContents(UpgradeTest.this, dnl.getStorage(), in.getLocalRegistry());
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
InstallTrampoline targetInstall = new InstallTrampoline();
cmd.getProcess().configureInstallCommand(targetInstall);
targetInstall.executionInit();
targetInstall.prepareInstallation();
assertTrue(targetInstall.getUnresolvedDependencies().isEmpty());
List<ComponentParam> deps = targetInstall.getDependencies();
assertEquals(1, deps.size());
MetadataLoader ldr = deps.iterator().next().createFileLoader();
assertEquals("org.graalvm.llvm-toolchain", ldr.getComponentInfo().getId());
}
use of org.graalvm.component.installer.persist.MetadataLoader in project graal by oracle.
the class CatalogIterableTest method testCreateMetaLoader.
@Test
public void testCreateMetaLoader() throws Exception {
initRemoteComponent("persist/data/truffleruby3.jar", "test://graalvm.io/download/truffleruby.zip", "testComponent", "test");
MetadataLoader ldr = param.createMetaLoader();
ldr.setNoVerifySymlinks(false);
ldr.loadPaths();
ldr.loadPermissions();
ldr.loadSymlinks();
ComponentInfo meta = ldr.getComponentInfo();
assertEquals("ruby", meta.getId());
assertNull(meta.getInfoPath());
assertNull(meta.getLicensePath());
assertTrue(meta.getPaths().isEmpty());
assertEquals("TruffleRuby 0.33-dev", meta.getName());
assertEquals("0.33-dev", meta.getVersionString());
assertFalse(Handler.isVisited(url));
}
Aggregations