Final round of updates, everything except mirror download should be ready

This commit is contained in:
Andrey Smirnov
2017-04-08 23:59:37 +03:00
parent 2535367c3c
commit 72d233b587
14 changed files with 154 additions and 99 deletions
+13 -1
View File
@@ -164,7 +164,7 @@ func (pool *PackagePool) Import(srcPath, basename string, checksums *utils.Check
}
// trying to overwrite file?
return "", fmt.Errorf("unable to import into pool: file %s already exists", poolPath)
return "", fmt.Errorf("unable to import into pool: file %s already exists", fullPoolPath)
}
if pool.supportLegacyPaths {
@@ -254,6 +254,18 @@ func (pool *PackagePool) Link(path, dstPath string) error {
return os.Link(filepath.Join(pool.rootPath, path), dstPath)
}
// Symlink generates symlink to destination path
func (pool *PackagePool) Symlink(path, dstPath string) error {
return os.Symlink(filepath.Join(pool.rootPath, path), dstPath)
}
// FullPath generates full path to the file in pool
//
// Please use with care: it's not supposed to be used to access files
func (pool *PackagePool) FullPath(path string) string {
return filepath.Join(pool.rootPath, path)
}
// GenerateTempPath generates temporary path for download (which is fast to import into package pool later on)
func (pool *PackagePool) GenerateTempPath(filename string) (string, error) {
random := uuid.NewRandom().String()