mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-15 11:57:59 +00:00
[debian] swagger: remove test
This commit is contained in:
+7
-7
@@ -169,7 +169,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
|
||||
|
||||
var dstStat os.FileInfo
|
||||
|
||||
dstStat, err = os.Stat(filepath.Join(poolPath, baseName))
|
||||
dstStat, err = os.Stat(destinationPath)
|
||||
if err == nil {
|
||||
// already exists, check source file
|
||||
|
||||
@@ -188,7 +188,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
|
||||
} else {
|
||||
// if source and destination have the same checksums, no need to copy
|
||||
var dstMD5 string
|
||||
dstMD5, err = utils.MD5ChecksumForFile(filepath.Join(poolPath, baseName))
|
||||
dstMD5, err = utils.MD5ChecksumForFile(destinationPath)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -219,11 +219,11 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
|
||||
|
||||
// source and destination have different inodes, if !forced, this is fatal error
|
||||
if !force {
|
||||
return fmt.Errorf("error linking file to %s: file already exists and is different", filepath.Join(poolPath, baseName))
|
||||
return fmt.Errorf("error linking file to %s: file already exists and is different", destinationPath)
|
||||
}
|
||||
|
||||
// forced, so remove destination
|
||||
err = os.Remove(filepath.Join(poolPath, baseName))
|
||||
err = os.Remove(destinationPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -238,7 +238,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
|
||||
}
|
||||
|
||||
var dst *os.File
|
||||
dst, err = os.Create(filepath.Join(poolPath, baseName))
|
||||
dst, err = os.Create(destinationPath)
|
||||
if err != nil {
|
||||
_ = r.Close()
|
||||
return err
|
||||
@@ -266,9 +266,9 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
|
||||
|
||||
err = dst.Close()
|
||||
} else if storage.linkMethod == LinkMethodSymLink {
|
||||
err = localSourcePool.Symlink(sourcePath, filepath.Join(poolPath, baseName))
|
||||
err = localSourcePool.Symlink(sourcePath, destinationPath)
|
||||
} else {
|
||||
err = localSourcePool.Link(sourcePath, filepath.Join(poolPath, baseName))
|
||||
err = localSourcePool.Link(sourcePath, destinationPath)
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user