mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Fix for stripping part with slashes from component names. #140
Now aptly won't strip by default, but if distribution contains slash (like 'wheezy/updates')
and component starts with last part of distribution ('updates/main'), it would be stripped.
This commit is contained in:
+9
-2
@@ -323,8 +323,13 @@ ok:
|
||||
}
|
||||
|
||||
components := strings.Split(stanza["Components"], " ")
|
||||
for i := range components {
|
||||
components[i] = path.Base(components[i])
|
||||
if strings.Contains(repo.Distribution, "/") {
|
||||
distributionLast := path.Base(repo.Distribution) + "/"
|
||||
for i := range components {
|
||||
if strings.HasPrefix(components[i], distributionLast) {
|
||||
components[i] = components[i][len(distributionLast):]
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(repo.Components) == 0 {
|
||||
repo.Components = components
|
||||
@@ -385,6 +390,8 @@ ok:
|
||||
return err
|
||||
}
|
||||
|
||||
delete(stanza, "SHA512")
|
||||
|
||||
repo.Meta = stanza
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user