Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart committed Mar 25, 2021
1 parent 56036ba commit 2a41057
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,17 @@ internal void ExecutePackageDownload(string name, PackageVersion package, string
if (immediateUninstalls.Any())
{
var stdLibPkgs = GetPackagesLocatedInStandardLibrary(immediateUninstalls);
if (stdLibHasTopPriority && stdLibPkgs.Count() > 0) {
// Some or all dependencies are in standard library.
MessageBox.Show(String.Format(Resources.MessagePackageHasDepsInStdLib,
name + " " + package.version,
JoinPackageNames(stdLibPkgs)),
Resources.CannotDownloadPackageMessageBoxTitle,
MessageBoxButton.OK, MessageBoxImage.Error);
return;
}

// if the package is not in use, tell the user we will be uninstall it and give them the opportunity to cancel
// if the package is not in use, tell the user we will uninstall it and give them the opportunity to cancel
if (MessageBox.Show(String.Format(Resources.MessageAlreadyInstallDynamo,
DynamoViewModel.BrandingResourceProvider.ProductName,
JoinPackageNames(immediateUninstalls)),
Expand Down
8 changes: 5 additions & 3 deletions src/DynamoPackages/PackageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ public string DefaultPackagesDirectory

internal int Priority(string path)
{
for (var ii=0; ii<packagesDirectories.Count(); ii++)
var pkgDirCount = packagesDirectories.Count();
for (var ii=0; ii< pkgDirCount; ii++)
{
if (path.Contains(packagesDirectories[ii]))
{
return packagesDirectories.Count() - ii;
return pkgDirCount - ii;
}
}
return -1;
// Lowest priority for paths that are not yet registered.
return pkgDirCount;
}

private readonly List<string> packagesDirectoriesToVerifyCertificates = new List<string>();
Expand Down

0 comments on commit 2a41057

Please sign in to comment.