fix: apt cache
Some checks failed
docker-release / build-and-push (push) Failing after 9m58s

This commit is contained in:
2025-11-18 14:21:12 +08:00
parent ba5544c28d
commit dcd85a9f41
3 changed files with 82 additions and 7 deletions

View File

@@ -64,11 +64,11 @@ func isAptIndexPath(p string) bool {
if isByHashPath(clean) {
return false
}
if strings.HasPrefix(clean, "/dists/") {
if strings.HasSuffix(clean, "/release") || strings.HasSuffix(clean, "/inrelease") || strings.HasSuffix(clean, "/release.gpg") {
return true
}
if strings.Contains(clean, "/packages") {
if strings.Contains(clean, "/dists/") {
if strings.HasSuffix(clean, "/release") ||
strings.HasSuffix(clean, "/inrelease") ||
strings.HasSuffix(clean, "/release.gpg") {
return true
}
}
@@ -80,7 +80,7 @@ func isAptImmutablePath(p string) bool {
if isByHashPath(clean) {
return true
}
if strings.HasPrefix(clean, "/pool/") {
if strings.Contains(clean, "/pool/") {
return true
}
return false
@@ -88,9 +88,10 @@ func isAptImmutablePath(p string) bool {
func isByHashPath(p string) bool {
clean := canonicalPath(p)
if !strings.HasPrefix(clean, "/dists/") {
if strings.Contains(clean, "/dists/") {
return false
}
return strings.Contains(clean, "/by-hash/")
}