Support for locking, unlocking, interruption, cleanup. #45 #114

This commit is contained in:
Andrey Smirnov
2014-10-03 01:34:22 +04:00
parent a356f3dff9
commit ad11053412
6 changed files with 81 additions and 11 deletions
+5
View File
@@ -24,6 +24,11 @@ func aptlyMirrorRename(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to rename: %s", err)
}
err = repo.CheckLock()
if err != nil {
return fmt.Errorf("unable to rename: %s", err)
}
_, err = context.CollectionFactory().RemoteRepoCollection().ByName(newName)
if err == nil {
return fmt.Errorf("unable to rename: mirror %s already exists", newName)