final Path hashesDir = LayoutUtils.getHashesDir(getInstallationHome()); if(Files.exists(hashesDir)) { final FsEntry originalState = new FsEntry(null, hashesDir); readHashes(originalState, new ArrayList<>()); final FsEntry currentState = getDefaultFsEntryFactory().forPath(getInstallationHome()); return FsDiff.diff(originalState, currentState); final FsEntryFactory fsFactory = getDefaultFsEntryFactory(); final FsEntry originalState = fsFactory.forPath(rt.getStagedDir()); final FsEntry currentState = fsFactory.forPath(getInstallationHome()); final long startTime = System.nanoTime(); final FsDiff fsDiff = FsDiff.diff(originalState, currentState);
for (String producer : split) { FeaturePackLocation loc = session.getPmSession(). getResolvedLocation(mgr.getInstallationHome(), producer); if (loc.hasBuild()) { line.add(new Cell(p.isTransitive() ? "Y" : "N")); FeaturePackLocation newLocation = session.getPmSession().getExposedLocation(mgr.getInstallationHome(), p.getNewLocation()); line.add(new Cell(StateInfoUtil.formatChannel(newLocation))); updates.t.addCellsLine(line);
@Override protected void runCommand(PmCommandInvocation invoc) throws CommandExecutionException { try { Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer> supplier = new Function<ProvisioningLayout<FeaturePackLayout>, FeatureContainer>() { public FeatureContainer apply(ProvisioningLayout<FeaturePackLayout> layout) { try { return getFeatureContainer(invoc.getPmSession(), layout); } catch (CommandExecutionException | ProvisioningException | IOException ex) { throw new RuntimeException(ex); } } }; ProvisioningManager mgr = getManager(invoc.getPmSession()); StateInfoUtil.displayInfo(invoc, mgr.getInstallationHome(), mgr.getProvisioningConfig(), type, supplier); } catch (ProvisioningException | CommandExecutionException ex) { throw new CommandExecutionException(invoc.getPmSession(), CliErrors.infoFailed(), ex); } }
@Override protected void runCommand(PmCommandInvocation invoc) throws CommandExecutionException { try { ProvisioningManager mgr = getManager(invoc.getPmSession()); FsDiff diff = mgr.getFsDiff(); if (diff.isEmpty()) { invoc.println("No changes detected"); } else { Path workingDir = Paths.get(invoc.getConfiguration().getAeshContext(). getCurrentWorkingDirectory().getAbsolutePath()); Path installation = mgr.getInstallationHome(); PathResolver resolver = new PathResolver() { @Override public String resolve(String relativePath) { Path absPath = Paths.get(installation.toString(), relativePath); return workingDir.relativize(absPath).toString(); } }; FsDiff.log(diff, new Consumer<String>() { @Override public void accept(String msg) { invoc.println(msg); } }, resolver); } } catch (ProvisioningException ex) { throw new CommandExecutionException(ex.getMessage()); } }
session.getPmSession().getExposedLocation(manager.getInstallationHome(), loc)); } catch (ProvisioningException | IOException ex) { throw new CommandExecutionException(session.getPmSession(), CliErrors.installFailed(), ex);