public void DoUpdate() { AddonRemote = new AptRemote(AddonEnv); Output.Info("Action: update repository database."); PrintEnvInfo(); try { if (AddonRepo == null) { AddonRepo = new AptRepository(AddonEnv); } Output.Info(String.Format("Current index from: {0}", AddonRepo.GetRepositoryDate())); Output.Info(String.Format("There are currently {0} addons in the database.", AddonRepo.GetAddonNum())); } catch (Exception e) { Output.Error("Failed to load current index file."); } Output.Info("Downloading index file..."); if (AddonRemote.UpdateIndexFile()) { Output.Info("Download successful."); try { AddonRepo = new AptRepository(AddonEnv); Output.Info(String.Format("Updated index from: {0}", AddonRepo.GetRepositoryDate())); Output.Info(String.Format("There are now {0} addons in the database.", AddonRepo.GetAddonNum())); } catch (Exception e) { Output.Error("Failed to downloaded index file."); } } else { Output.Error("Download failed."); } }
private void PrintAptInfo() { Output.Info(AddonLocal.GetAddonNum() + " addons installed."); Output.Info(AddonRepo.GetAddonNum() + " addons in repository."); }