|
@@ -18,6 +18,21 @@ namespace UsmWeb {
|
|
|
public string ref_name { get; set; default = ""; }
|
|
public string ref_name { get; set; default = ""; }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * One pre-built-artifact row: a DCBA repository carrying a `.dcba`
|
|
|
|
|
+ * built from this exact package name and version.
|
|
|
|
|
+ */
|
|
|
|
|
+ public class PrebuiltArtifactRow : Object {
|
|
|
|
|
+ public string repo { get; set; default = ""; }
|
|
|
|
|
+ public string summary { get; set; default = ""; }
|
|
|
|
|
+ public string file { get; set; default = ""; }
|
|
|
|
|
+ public string version { get; set; default = ""; }
|
|
|
|
|
+ public string size { get; set; default = ""; }
|
|
|
|
|
+ public string sha512 { get; set; default = ""; }
|
|
|
|
|
+ public string repo_href { get; set; default = ""; }
|
|
|
|
|
+ public string download_href { get; set; default = ""; }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/** One licence row of the detail view. */
|
|
/** One licence row of the detail view. */
|
|
|
public class LicenceRow : Object {
|
|
public class LicenceRow : Object {
|
|
|
public string name { get; set; default = ""; }
|
|
public string name { get; set; default = ""; }
|
|
@@ -95,6 +110,38 @@ namespace UsmWeb {
|
|
|
add_phase(depends, "runtime", manifest.dependencies.runtime);
|
|
add_phase(depends, "runtime", manifest.dependencies.runtime);
|
|
|
dict["depends"] = new JsonElement.from_elements(depends);
|
|
dict["depends"] = new JsonElement.from_elements(depends);
|
|
|
|
|
|
|
|
|
|
+ // Pre-built artifacts: DCBA repositories carrying this exact
|
|
|
|
|
+ // package name AND version (what `usm install` would fetch).
|
|
|
|
|
+ // Exact string match only — the listing's version string must
|
|
|
|
|
+ // equal the manifest's version string, with no Version parse
|
|
|
|
|
+ // round trip on the listing side.
|
|
|
|
|
+ var prebuilt = new JsonArray();
|
|
|
|
|
+ var version_key = manifest.version.to_string();
|
|
|
|
|
+ foreach (var dcba_entry in repositories.dcba_entries()) {
|
|
|
|
|
+ var artifact = dcba_entry.find_dcba_artifact(manifest.name, version_key);
|
|
|
|
|
+ if (artifact == null) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ var dcba_repo = dcba_entry.repo();
|
|
|
|
|
+ var artifact_file = Path.get_basename(((!)artifact).path);
|
|
|
|
|
+ var row = new PrebuiltArtifactRow() {
|
|
|
|
|
+ repo = dcba_repo.name,
|
|
|
|
|
+ summary = dcba_repo.summary,
|
|
|
|
|
+ file = artifact_file,
|
|
|
|
|
+ version = ((!)artifact).version,
|
|
|
|
|
+ size = ((!)artifact).size > 0
|
|
|
|
|
+ ? PackagesState.format_size((int64)((!)artifact).size)
|
|
|
|
|
+ : "?",
|
|
|
|
|
+ sha512 = PackagesState.fingerprint(((!)artifact).sha512sum.to_hex()),
|
|
|
|
|
+ repo_href = @"/repo/$(dcba_repo.name)",
|
|
|
|
|
+ download_href = @"/repo/$(dcba_repo.name)/$artifact_file"
|
|
|
|
|
+ };
|
|
|
|
|
+ prebuilt.add(new JsonElement.from_properties(GObjectMapping.to_properties(row)));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (prebuilt.length > 0) {
|
|
|
|
|
+ dict["prebuilt_artifacts"] = new JsonElement.from_elements(prebuilt);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
var state = new State() {
|
|
var state = new State() {
|
|
|
type_name = "package",
|
|
type_name = "package",
|
|
|
public_data = dict,
|
|
public_data = dict,
|