mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 13:20:42 +00:00
Fix FMRI and catalog processing inconsistencies
- Corrected FMRI formatting to `pkg:/name` for entries without a publisher. - Excluded `pkg.fmri` from summary action extraction in file backend. - Removed unused signature handling in catalog package processing. - Reordered `PackageVersionEntry` struct fields for logical consistency.
This commit is contained in:
parent
e0de265d17
commit
7dc475ed2d
3 changed files with 13 additions and 10 deletions
|
|
@ -644,12 +644,12 @@ impl Fmri {
|
|||
|
||||
impl fmt::Display for Fmri {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
// For FMRIs without a publisher, we should use the format pkg:///name
|
||||
// For FMRIs without a publisher, we should use the format pkg:/name
|
||||
// For FMRIs with a publisher, we should use the format pkg://publisher/name
|
||||
if let Some(publisher) = &self.publisher {
|
||||
write!(f, "{}://{}/", self.scheme, publisher)?;
|
||||
} else {
|
||||
write!(f, "{}:///", self.scheme)?;
|
||||
write!(f, "{}:/", self.scheme)?;
|
||||
}
|
||||
|
||||
write!(f, "{}", self.name)?;
|
||||
|
|
|
|||
|
|
@ -192,9 +192,6 @@ impl CatalogAttrs {
|
|||
/// Package version entry in a catalog
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct PackageVersionEntry {
|
||||
/// Package version string
|
||||
pub version: String,
|
||||
|
||||
/// Optional actions associated with this package version
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub actions: Option<Vec<String>>,
|
||||
|
|
@ -202,6 +199,9 @@ pub struct PackageVersionEntry {
|
|||
/// Optional SHA-1 signature of the package manifest
|
||||
#[serde(rename = "signature-sha-1", skip_serializing_if = "Option::is_none")]
|
||||
pub signature_sha1: Option<String>,
|
||||
|
||||
/// Package version string
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
/// Catalog part (base, dependency, summary)
|
||||
|
|
|
|||
|
|
@ -2347,7 +2347,10 @@ impl FileBackend {
|
|||
// Extract summary actions (set actions excluding variants and facets)
|
||||
let mut summary_actions = Vec::new();
|
||||
for attr in &manifest.attributes {
|
||||
if !attr.key.starts_with("variant.") && !attr.key.starts_with("facet.") {
|
||||
if !attr.key.starts_with("variant.")
|
||||
&& !attr.key.starts_with("facet.")
|
||||
&& attr.key != "pkg.fmri"
|
||||
{
|
||||
let values_str = attr.values.join(" value=");
|
||||
summary_actions.push(format!("set name={} value={}", attr.key, values_str));
|
||||
}
|
||||
|
|
@ -2466,8 +2469,8 @@ impl FileBackend {
|
|||
dependency_part_path.display()
|
||||
);
|
||||
let mut dependency_part = crate::repository::catalog::CatalogPart::new();
|
||||
for (fmri, actions, signature) in dependency_entries {
|
||||
dependency_part.add_package(publisher, &fmri, actions, Some(signature));
|
||||
for (fmri, actions, _signature) in dependency_entries {
|
||||
dependency_part.add_package(publisher, &fmri, actions, None);
|
||||
}
|
||||
let dependency_sig =
|
||||
catalog_writer::write_catalog_part(&dependency_part_path, &mut dependency_part)?;
|
||||
|
|
@ -2477,8 +2480,8 @@ impl FileBackend {
|
|||
let summary_part_path = catalog_dir.join(summary_part_name);
|
||||
debug!("Writing summary part to: {}", summary_part_path.display());
|
||||
let mut summary_part = crate::repository::catalog::CatalogPart::new();
|
||||
for (fmri, actions, signature) in summary_entries {
|
||||
summary_part.add_package(publisher, &fmri, actions, Some(signature));
|
||||
for (fmri, actions, _signature) in summary_entries {
|
||||
summary_part.add_package(publisher, &fmri, actions, None);
|
||||
}
|
||||
let summary_sig =
|
||||
catalog_writer::write_catalog_part(&summary_part_path, &mut summary_part)?;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue