Skip to content

Commit 5ab7970

Browse files
committed
2 parents c0d4c9a + 92202c5 commit 5ab7970

23 files changed

Lines changed: 292 additions & 21 deletions

File tree

WebBasedData/screenshot-database-v2.json

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"package_count": {
3-
"total": 11857,
4-
"done": 5356,
5-
"packages_with_icon": 5356,
6-
"packages_with_screenshot": 742,
7-
"total_screenshots": 2273
3+
"total": 11858,
4+
"done": 5358,
5+
"packages_with_icon": 5358,
6+
"packages_with_screenshot": 747,
7+
"total_screenshots": 2286
88
},
99
"icons_and_screenshots": {
1010
"__test_entry_DO_NOT_EDIT_PLEASE": {
@@ -37752,7 +37752,10 @@
3775237752
},
3775337753
"simplewall": {
3775437754
"icon": "https://community.chocolatey.org/content/packageimages/simplewall.install.3.6.7.png",
37755-
"images": []
37755+
"images": [
37756+
"https://i.postimg.cc/Qxwdpt9F/image.png",
37757+
"https://i.postimg.cc/4xcNwgVB/image.png"
37758+
]
3775637759
},
3775737760
"simplewavsplitter-avalonia": {
3775837761
"icon": "",
@@ -39489,16 +39492,25 @@
3948939492
"images": []
3949039493
},
3949139494
"ssh-client": {
39492-
"icon": "",
39493-
"images": []
39495+
"icon": "https://i.postimg.cc/28K8Xzkv/Icon.png",
39496+
"images": [
39497+
"https://i.postimg.cc/fRcjfgsG/image.png",
39498+
"https://i.postimg.cc/Sxht49xp/image.png",
39499+
"https://i.postimg.cc/g2Ht20xL/image.png",
39500+
"https://i.postimg.cc/FzSD5FtR/image.png"
39501+
]
3949439502
},
3949539503
"ssh-copy-id": {
3949639504
"icon": "",
3949739505
"images": []
3949839506
},
3949939507
"ssh-server": {
3950039508
"icon": "",
39501-
"images": []
39509+
"images": [
39510+
"https://i.ibb.co/9M8JH3X/Image.png",
39511+
"https://i.ibb.co/bjH7g8mr/Image.png",
39512+
"https://i.ibb.co/xtpk799R/Image.png"
39513+
]
3950239514
},
3950339515
"sshfs-win": {
3950439516
"icon": "",
@@ -40057,7 +40069,10 @@
4005740069
},
4005840070
"studio3t": {
4005940071
"icon": "https://community.chocolatey.org/content/packageimages/studio3t.2023.1.1.png",
40060-
"images": []
40072+
"images": [
40073+
"https://i.ibb.co/TnGC4QP/Image.png",
40074+
"https://i.ibb.co/CpvbCrLC/image.png"
40075+
]
4006140076
},
4006240077
"studiorack": {
4006340078
"icon": "",
@@ -50349,14 +50364,21 @@
5034950364
]
5035050365
},
5035150366
"viceversa-pro": {
50352-
"icon": "",
50367+
"icon": "https://i.postimg.cc/VsFydCfY/Vice-Versa.png",
5035350368
"images": [
50369+
"https://i.postimg.cc/MKZCRpH1/Bitmap-665.png",
5035450370
"https://i.postimg.cc/2yrxsyMG/image.png",
5035550371
"https://i.postimg.cc/nV2KsH68/image.png",
5035650372
"https://i.postimg.cc/kXhxcTJf/image.png",
5035750373
"https://i.postimg.cc/L8cjdhZP/image.png",
5035850374
"https://i.postimg.cc/W40gsjMH/image.png"
5035950375
]
50376+
},
50377+
"autorunorganizer": {
50378+
"icon": "",
50379+
"images": [
50380+
"https://i.postimg.cc/XqYSYZbs/image.png"
50381+
]
5036050382
}
5036150383
}
5036250384
}

src/UniGetUI.PAckageEngine.Interfaces/IPackageDetails.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,14 @@ public interface IPackageDetails
9494
/// </summary>
9595
/// <returns>An asynchronous task that can be awaited</returns>
9696
public Task Load();
97+
98+
public List<Dependency> Dependencies { get; }
99+
100+
public struct Dependency
101+
{
102+
public string Name;
103+
public string Version;
104+
public bool Mandatory;
105+
}
97106
}
98107
}

src/UniGetUI.PackageEngine.Enums/ManagerCapabilities.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public struct ManagerCapabilities
2525
public bool CanRemoveDataOnUninstall = false;
2626
public bool CanDownloadInstaller = false;
2727
public bool CanUninstallPreviousVersionsAfterUpdate = false;
28+
public bool CanListDependencies = false;
2829
public bool SupportsCustomVersions = false;
2930
public bool SupportsCustomArchitectures = false;
3031
public string[] SupportedCustomArchitectures = [];

src/UniGetUI.PackageEngine.Managers.Chocolatey/Chocolatey.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public Chocolatey()
3232
CanSkipIntegrityChecks = true,
3333
CanRunInteractively = true,
3434
SupportsCustomVersions = true,
35+
CanListDependencies = true,
3536
SupportsCustomArchitectures = true,
3637
SupportedCustomArchitectures = [Architecture.x86],
3738
SupportsPreRelease = true,

src/UniGetUI.PackageEngine.Managers.Dotnet/DotNet.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public DotNet()
3030
SupportsCustomArchitectures = true,
3131
SupportedCustomArchitectures = [Architecture.x86, Architecture.x64, Architecture.arm64, Architecture.arm32],
3232
SupportsPreRelease = true,
33+
CanListDependencies = true,
3334
SupportsCustomLocations = true,
3435
SupportsCustomPackageIcons = true,
3536
SupportsCustomVersions = true,

src/UniGetUI.PackageEngine.Managers.Generic.NuGet/BaseNuGet.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,19 @@ public abstract class BaseNuGet : PackageManager
1818

1919
public sealed override void Initialize()
2020
{
21-
if (DetailsHelper is not BaseNuGetDetailsHelper)
21+
static void ThrowIC(string name)
2222
{
23-
throw new InvalidOperationException("NuGet-based package managers must not reassign the PackageDetailsProvider property");
23+
throw new InvalidOperationException($"NuGet-based package managers must have Capabilities.{name} set to true");
2424
}
2525

26-
if (!Capabilities.SupportsCustomVersions)
26+
if (DetailsHelper is not BaseNuGetDetailsHelper)
2727
{
28-
throw new InvalidOperationException("NuGet-based package managers must support custom versions");
28+
throw new InvalidOperationException("NuGet-based package managers must not reassign the PackageDetailsProvider property");
2929
}
3030

31-
if (!Capabilities.SupportsCustomPackageIcons)
32-
{
33-
throw new InvalidOperationException("NuGet-based package managers must support custom versions");
34-
}
31+
if (!Capabilities.SupportsCustomVersions) ThrowIC(nameof(Capabilities.SupportsCustomVersions));
32+
if (!Capabilities.SupportsCustomPackageIcons) ThrowIC(nameof(Capabilities.SupportsCustomPackageIcons));
33+
if (!Capabilities.CanListDependencies) ThrowIC(nameof(Capabilities.CanListDependencies));
3534

3635
base.Initialize();
3736
}

src/UniGetUI.PackageEngine.Managers.Generic.NuGet/BaseNuGetDetailsHelper.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ protected override void GetDetails_UnSafe(IPackageDetails details)
107107
break;
108108
}
109109

110+
details.Dependencies.Clear();
111+
foreach (Match match in Regex.Matches(PackageManifestContents,
112+
@"<d\:Dependencies>([^<]+)</d\:Dependencies>"))
113+
{
114+
foreach (var dep in match.Groups[1].ToString().Split('|'))
115+
{
116+
if(string.IsNullOrEmpty(dep))
117+
continue;
118+
else if (dep.StartsWith("::"))
119+
details.Dependencies.Add(new() { Name = dep.TrimStart(':'), Version = "", Mandatory = true });
120+
else
121+
details.Dependencies.Add(new()
122+
{
123+
Name = dep.Split(':')[0], Version = dep.Split(':')[1].TrimEnd(':'), Mandatory = true
124+
});
125+
}
126+
}
127+
128+
110129
logger.Close(0);
111130
return;
112131
}

src/UniGetUI.PackageEngine.Managers.Npm/Helpers/NpmPkgDetailsHelper.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,47 @@ protected override void GetDetails_UnSafe(IPackageDetails details)
6161

6262
details.InstallerHash = contents?["dist"]?["integrity"]?.ToString();
6363

64+
details.Dependencies.Clear();
65+
HashSet<string> addedDeps = new();
66+
foreach (var rawDep in (contents?["dependencies"]?.AsObject() ?? []))
67+
{
68+
if(addedDeps.Contains(rawDep.Key)) continue;
69+
addedDeps.Add(rawDep.Key);
70+
71+
details.Dependencies.Add(new()
72+
{
73+
Name = rawDep.Key,
74+
Version = rawDep.Value?.GetValue<string>() ?? "",
75+
Mandatory = true,
76+
});
77+
}
78+
79+
foreach (var rawDep in (contents?["devDependencies"]?.AsObject() ?? []))
80+
{
81+
if(addedDeps.Contains(rawDep.Key)) continue;
82+
addedDeps.Add(rawDep.Key);
83+
84+
details.Dependencies.Add(new()
85+
{
86+
Name = rawDep.Key,
87+
Version = rawDep.Value?.GetValue<string>() ?? "",
88+
Mandatory = false,
89+
});
90+
}
91+
92+
foreach (var rawDep in (contents?["peerDependencies"]?.AsObject() ?? []))
93+
{
94+
if(addedDeps.Contains(rawDep.Key)) continue;
95+
addedDeps.Add(rawDep.Key);
96+
97+
details.Dependencies.Add(new()
98+
{
99+
Name = rawDep.Key,
100+
Version = rawDep.Value?.GetValue<string>() ?? "",
101+
Mandatory = false,
102+
});
103+
}
104+
64105
logger.AddToStdErr(p.StandardError.ReadToEnd());
65106
p.WaitForExit();
66107
logger.Close(p.ExitCode);

src/UniGetUI.PackageEngine.Managers.Npm/Npm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public Npm()
2323
SupportsCustomVersions = true,
2424
CanDownloadInstaller = true,
2525
SupportsCustomScopes = true,
26+
CanListDependencies = true,
2627
SupportsPreRelease = true,
2728
SupportsProxy = ProxySupport.No,
2829
SupportsProxyAuth = false

src/UniGetUI.PackageEngine.Managers.Pip/Helpers/PipPkgDetailsHelper.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ protected override void GetDetails_UnSafe(IPackageDetails details)
5555
}
5656
details.Tags = Tags.ToArray();
5757
}
58+
59+
details.Dependencies.Clear();
60+
foreach (var rawDep in (info?["requires_dist"]?.AsArray() ?? []))
61+
{
62+
string line = rawDep?.GetValue<string>().Split(';')[0] ?? "";
63+
string name = line.Split(['>', '<', '=', '!'])[0];
64+
details.Dependencies.Add(new()
65+
{
66+
Name = name,
67+
Version = line[name.Length..],
68+
Mandatory = true,
69+
});
70+
}
5871
}
5972

6073
JsonObject? url = contents?["url"] as JsonObject;

0 commit comments

Comments
 (0)