From 5d301fb1b7c0c414e4a050cae18e386d5fad1d2b Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Mon, 27 Nov 2017 11:08:31 +0100 Subject: [PATCH] Prepare archive root when editing it --- cmd/mirror_edit.go | 2 +- deb/remote.go | 6 ++++++ system/t04_mirror/EditMirror10Test_gold | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/mirror_edit.go b/cmd/mirror_edit.go index 2b19c774..8b896ec0 100644 --- a/cmd/mirror_edit.go +++ b/cmd/mirror_edit.go @@ -38,7 +38,7 @@ func aptlyMirrorEdit(cmd *commander.Command, args []string) error { case "with-udebs": repo.DownloadUdebs = flag.Value.Get().(bool) case "archive-url": - repo.ArchiveRoot = flag.Value.String() + repo.SetArchiveRoot(flag.Value.String()) fetchMirror = true } }) diff --git a/deb/remote.go b/deb/remote.go index d8152ed8..530d02c7 100644 --- a/deb/remote.go +++ b/deb/remote.go @@ -112,6 +112,12 @@ func NewRemoteRepo(name string, archiveRoot string, distribution string, compone return result, nil } +// SetArchiveRoot of remote repo +func (repo *RemoteRepo) SetArchiveRoot(archiveRoot string) { + repo.ArchiveRoot = archiveRoot + repo.prepare() +} + func (repo *RemoteRepo) prepare() error { var err error diff --git a/system/t04_mirror/EditMirror10Test_gold b/system/t04_mirror/EditMirror10Test_gold index b1e4e197..c07bfdb2 100644 --- a/system/t04_mirror/EditMirror10Test_gold +++ b/system/t04_mirror/EditMirror10Test_gold @@ -1,2 +1,2 @@ -Downloading ftp://ftp.ru.debian.org/debian/dists/wheezy/Release... -Mirror [mirror10]: ftp://ftp.ch.debian.org/debian wheezy successfully updated. +Downloading ftp://ftp.ch.debian.org/debian/dists/wheezy/Release... +Mirror [mirror10]: ftp://ftp.ch.debian.org/debian/ wheezy successfully updated.