Refactoring: build pool path in Package. #8

This commit is contained in:
Andrey Smirnov
2014-04-22 16:20:51 +04:00
parent 45335da0ed
commit 1bac201687
3 changed files with 13 additions and 17 deletions
+6 -4
View File
@@ -388,16 +388,18 @@ func (p *Package) LinkFromPool(publishedStorage aptly.PublishedStorage, packageP
return err
}
relPath, err := publishedStorage.LinkFromPool(prefix, component, poolDir, packagePool, sourcePath)
relPath := filepath.Join("pool", component, poolDir)
publishedDirectory := filepath.Join(prefix, relPath)
err = publishedStorage.LinkFromPool(publishedDirectory, packagePool, sourcePath)
if err != nil {
return err
}
dir := filepath.Dir(relPath)
if p.IsSource {
p.Extra()["Directory"] = dir
p.Extra()["Directory"] = relPath
} else {
p.Files()[i].downloadPath = dir
p.Files()[i].downloadPath = relPath
}
}