The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/265
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From ae3fef6742271d912f27364d4f30c8289b3817cc Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Thu, 21 Nov 2019 15:17:30 +0100 Subject: [PATCH] managers/apk: Add repo handler Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- managers/apk.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/managers/apk.go b/managers/apk.go index 7d77106..29f2d81 100644 --- a/managers/apk.go +++ b/managers/apk.go @@ -1,5 +1,11 @@ package managers +import ( + "os" + + "github.com/lxc/distrobuilder/shared" +) + // NewApk creates a new Manager instance. func NewApk() *Manager { return &Manager{ @@ -27,5 +33,19 @@ func NewApk() *Manager { "upgrade", }, }, + RepoHandler: func(repoAction shared.DefinitionPackagesRepository) error { + f, err := os.OpenFile("/etc/apk/repositories", os.O_WRONLY|os.O_APPEND, 0644) + if err != nil { + return err + } + defer f.Close() + + _, err = f.WriteString(repoAction.URL + "\n") + if err != nil { + return err + } + + return nil + }, } }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel