Skip to content

Commit cf97c6d

Browse files
committed
make ghcr_pkg in sbuild portable
1 parent 48f7e58 commit cf97c6d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sbuild-meta/src/recipe.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ impl SBuildRecipe {
413413
// Sanitize package name for OCI compatibility (e.g., c++filt -> c-filt)
414414
let sanitized_pkg_name = sanitize_oci_name(&pkg_name);
415415
// Use custom ghcr_pkg if specified, otherwise auto-generate path
416-
// GHCR path: {ghcr_pkg}/{pkg_name} or {owner}/{cache}/{pkg_family}/{recipe_name}/{pkg_name}
416+
// GHCR path: {owner}/{ghcr_pkg}/{pkg_name} or {owner}/{cache}/{pkg_family}/{recipe_name}/{pkg_name}
417417
let ghcr_path = if let Some(ref custom_base) = self.ghcr_pkg {
418-
format!("{}/{}", custom_base, sanitized_pkg_name)
418+
format!("{}/{}/{}", ghcr_owner, custom_base, sanitized_pkg_name)
419419
} else {
420420
format!(
421421
"{}/{}/{}/{}/{}",
@@ -648,7 +648,7 @@ provides:
648648
let yaml = r#"
649649
pkg: myapp
650650
pkg_id: example.com.myapp
651-
ghcr_pkg: "custom-org/custom-cache/custom-pkg"
651+
ghcr_pkg: "custom-cache/custom-pkg"
652652
provides:
653653
- "app1"
654654
- "app2"
@@ -657,10 +657,10 @@ provides:
657657
let path = Path::new("binaries/myapp/static.yaml");
658658
let packages = recipe.ghcr_packages_from_path(path, "pkgforge");
659659

660-
// Should use custom ghcr_pkg instead of auto-generated path
660+
// Should use custom ghcr_pkg with owner prepended
661661
assert_eq!(packages.len(), 2);
662-
assert_eq!(packages[0].ghcr_path, "custom-org/custom-cache/custom-pkg/app1");
663-
assert_eq!(packages[1].ghcr_path, "custom-org/custom-cache/custom-pkg/app2");
662+
assert_eq!(packages[0].ghcr_path, "pkgforge/custom-cache/custom-pkg/app1");
663+
assert_eq!(packages[1].ghcr_path, "pkgforge/custom-cache/custom-pkg/app2");
664664
}
665665

666666
#[test]

0 commit comments

Comments
 (0)