Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

managers: Rebranding Macaroni OS Package Manager #800

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/reference/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Valid package manager are:
* `dnf`
* `egoportage` (combination of `portage` and `ego`)
* `equo`
* `luet`
* `anise`
* `opkg`
* `pacman`
* `portage`
Expand Down
32 changes: 17 additions & 15 deletions managers/luet.go → managers/anise.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,44 @@ import (
"github.com/lxc/distrobuilder/shared"
)

type luet struct {
type anise struct {
common
}

func (m *luet) load() error {
func (m *anise) load() error {
m.commands = managerCommands{
clean: "luet",
install: "luet",
refresh: "luet",
remove: "luet",
update: "luet",
clean: "anise",
install: "anise",
refresh: "anise",
remove: "anise",
update: "anise",
}

m.flags = managerFlags{
global: []string{},
clean: []string{
"cleanup",
"cleanup", "--purge-repos",
},
install: []string{
"install",
// Forcing always override of the protected
// files. Not needed on image creation.
"install", "--skip-config-protect",
},
refresh: []string{
"repo", "update",
"repo", "update", "--force",
},
remove: []string{
"uninstall",
"uninstall", "--skip-config-protect",
},
update: []string{
"upgrade",
"upgrade", "--sync-repos", "--skip-config-protect",
},
}

return nil
}

func (m *luet) manageRepository(repoAction shared.DefinitionPackagesRepository) error {
func (m *anise) manageRepository(repoAction shared.DefinitionPackagesRepository) error {
var targetFile string

if repoAction.Name == "" {
Expand All @@ -59,9 +61,9 @@ func (m *luet) manageRepository(repoAction shared.DefinitionPackagesRepository)
}

if strings.HasSuffix(repoAction.Name, ".yml") {
targetFile = filepath.Join("/etc/luet/repos.conf.d", repoAction.Name)
targetFile = filepath.Join("/etc/anise/repos.conf.d", repoAction.Name)
} else {
targetFile = filepath.Join("/etc/luet/repos.conf.d", repoAction.Name+".yml")
targetFile = filepath.Join("/etc/anise/repos.conf.d", repoAction.Name+".yml")
}

if !incus.PathExists(filepath.Dir(targetFile)) {
Expand Down
2 changes: 1 addition & 1 deletion managers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var managers = map[string]func() manager{
"dnf": func() manager { return &dnf{} },
"egoportage": func() manager { return &egoportage{} },
"equo": func() manager { return &equo{} },
"luet": func() manager { return &luet{} },
"anise": func() manager { return &anise{} },
"opkg": func() manager { return &opkg{} },
"pacman": func() manager { return &pacman{} },
"portage": func() manager { return &portage{} },
Expand Down
2 changes: 1 addition & 1 deletion shared/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func (d *Definition) Validate() error {
"equo",
"xbps",
"zypper",
"luet",
"anise",
"slackpkg",
}

Expand Down
Loading