Skip to content

Commit

Permalink
Merge branch 'main' into cpu-usage-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Feb 8, 2025
2 parents 671fabf + f9771f8 commit 8d006ae
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
39 changes: 27 additions & 12 deletions src/UniGetUI.Core.Data/Licenses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ public static class LicenseData
{"InnoDependencyInstaller", "CPOL 1.02" },

// Package managers and related
{"Winget", "MIT"},
{"WinGet", "MIT"},
{"Scoop", "MIT"},
{"scoop-search", "MIT"},
{"Chocolatey", "Apache v2"},
{"Npm", "Artistic License 2.0"},
{"npm", "Artistic License 2.0"},
{"Pip", "MIT"},
{"parse_pip_search", "MIT"},
{"PowerShell Gallery", "Unknown"},
{".NET Sdk", "MIT"},
{".NET SDK", "MIT"},
{"dotnet-tools-outdated", "MIT"},
{"Cargo", "MIT"},
{"cargo-binstall", "GPL-3.0-only"},
{"cargo-update", "MIT"},
{"vcpkg", "MIT"},

// Other
{"Gsudo", "MIT"},
{"GSudo", "MIT"},
{"UniGetUI Elevator", "MIT"},
{"Icons", "By Icons8"},
};

Expand All @@ -46,19 +51,24 @@ public static class LicenseData
{"InnoDependencyInstaller", new Uri("https://github.com/DomGries/InnoDependencyInstaller/blob/master/LICENSE.md") },

// Package managers and related
{"Winget", new Uri("https://github.com/microsoft/winget-cli/blob/master/LICENSE")},
{"WinGet", new Uri("https://github.com/microsoft/winget-cli/blob/master/LICENSE")},
{"Scoop", new Uri("https://github.com/ScoopInstaller/Scoop/blob/master/LICENSE")},
{"scoop-search", new Uri("https://github.com/shilangyu/scoop-search/blob/master/LICENSE")},
{"Chocolatey", new Uri("https://github.com/chocolatey/choco/blob/develop/LICENSE")},
{"Npm", new Uri("https://github.com/npm/cli/blob/latest/LICENSE")},
{"npm", new Uri("https://github.com/npm/cli/blob/latest/LICENSE")},
{"Pip", new Uri("https://github.com/pypa/pip/blob/main/LICENSE.txt")},
{"parse_pip_search", new Uri("https://github.com/marticliment/parseable_pip_search/blob/master/LICENSE.md")},
{".NET Sdk", new Uri("https://github.com/dotnet/sdk/blob/main/LICENSE.TXT")},
{".NET SDK", new Uri("https://github.com/dotnet/sdk/blob/main/LICENSE.TXT")},
{"dotnet-tools-outdated", new Uri("https://github.com/rychlym/dotnet-tools-outdated/blob/master/LICENSE")},
{"PowerShell Gallery", new Uri("https://www.powershellgallery.com/")},
{"Cargo", new Uri("https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT")},
{"cargo-binstall", new Uri("https://spdx.org/licenses/GPL-3.0-only.html")},
{"cargo-update", new Uri("https://github.com/nabijaczleweli/cargo-update/blob/master/LICENSE")},
{"vcpkg", new Uri("https://github.com/microsoft/vcpkg/blob/master/LICENSE.txt")},

// Other
{"Gsudo", new Uri("https://github.com/gerardog/gsudo/blob/master/LICENSE.txt")},
{"GSudo", new Uri("https://github.com/gerardog/gsudo/blob/master/LICENSE.txt")},
{"UniGetUI Elevator", new Uri("https://github.com/marticliment/GSudo-for-UniGetUI/blob/main/LICENSE.txt")},
{"Icons", new Uri("https://icons8.com/license")},
};

Expand All @@ -76,19 +86,24 @@ public static class LicenseData
{"InnoDependencyInstaller", new Uri("https://github.com/DomGries/InnoDependencyInstaller")},

// Package managers and related
{"Winget", new Uri("https://github.com/microsoft/winget-cli/")},
{"WinGet", new Uri("https://github.com/microsoft/winget-cli/")},
{"Scoop", new Uri("https://github.com/ScoopInstaller/Scoop/")},
{"scoop-search", new Uri("https://github.com/shilangyu/scoop-search/")},
{"Chocolatey", new Uri("https://github.com/chocolatey/choco/")},
{"Npm", new Uri("https://github.com/npm/cli/")},
{"npm", new Uri("https://github.com/npm/cli/")},
{"Pip", new Uri("https://github.com/pypa/pip/")},
{"parse_pip_search", new Uri("https://github.com/marticliment/parseable_pip_search/")},
{".NET Sdk", new Uri("https://dotnet.microsoft.com/")},
{".NET SDK", new Uri("https://dotnet.microsoft.com/")},
{"dotnet-tools-outdated", new Uri("https://github.com/rychlym/dotnet-tools-outdated/")},
{"PowerShell Gallery", new Uri("https://www.powershellgallery.com/")},
{"Cargo", new Uri("https://github.com/rust-lang/cargo")},
{"cargo-binstall", new Uri("https://github.com/cargo-bins/cargo-binstall")},
{"cargo-update", new Uri("https://github.com/nabijaczleweli/cargo-update/")},
{"vcpkg", new Uri("https://github.com/microsoft/vcpkg")},

// Other
{"Gsudo", new Uri("https://github.com/gerardog/gsudo/")},
{"GSudo", new Uri("https://github.com/gerardog/gsudo/")},
{"UniGetUI Elevator", new Uri("https://github.com/marticliment/GSudo-for-UniGetUI/")},
{"Icons", new Uri("https://icons8.com")},
};

Expand Down
21 changes: 17 additions & 4 deletions src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,29 @@ public partial class Cargo : PackageManager
public Cargo()
{
Dependencies = [
// cargo-update is required to check for and update installed packages
// cargo-update is required to check for installed and upgradable packages
new ManagerDependency(
"cargo-update",
Path.Join(Environment.SystemDirectory, "windowspowershell\\v1.0\\powershell.exe"),
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {cargo install cargo-update; if ($error.count -ne 0){pause}}\"",
"cargo install cargo-update",
async () => (await CoreTools.WhichAsync("cargo-install-update.exe")).Item1),
// Cargo-binstall is required to install and update cargo binaries
new ManagerDependency(
"cargo-binstall",
Path.Join(Environment.SystemDirectory, "windowspowershell\\v1.0\\powershell.exe"),
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr \\\"https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1\\\").Content; if ($error.count -ne 0){pause}}\"",
"Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr \"https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1\").Content",
async () => (await CoreTools.WhichAsync("cargo-binstall.exe")).Item1)
];

Capabilities = new ManagerCapabilities { };
Capabilities = new ManagerCapabilities
{
CanRunAsAdmin = true,
CanSkipIntegrityChecks = true,
SupportsCustomVersions = true,
SupportsCustomLocations = true,
};

var cratesIo = new ManagerSource(this, "crates.io", new Uri("https://index.crates.io/"));

Expand All @@ -46,9 +59,9 @@ public Cargo()
IconId = IconType.Rust,
ColorIconId = "cargo_color",
ExecutableFriendlyName = "cargo.exe",
InstallVerb = "install",
InstallVerb = "binstall",
UninstallVerb = "uninstall",
UpdateVerb = "install-update",
UpdateVerb = "binstall",
ExecutableCallArgs = "",
DefaultSource = cratesIo,
KnownSources = [cratesIo]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ protected override IEnumerable<string> _getOperationParameters(IPackage package,
_ => throw new InvalidDataException("Invalid package operation"),
};

if (operation is OperationType.Install or OperationType.Update)
{
parameters.Add("--no-confirm");

if(options.SkipHashCheck)
parameters.Add("--skip-signatures");

if(options.CustomInstallLocation != "")
parameters.AddRange(["--install-path", options.CustomInstallLocation]);
}

parameters.AddRange(options.CustomParameters);
return parameters;
}

Expand Down

0 comments on commit 8d006ae

Please sign in to comment.