Skip to content

Commit

Permalink
Merge pull request #800 from geaaru/macaroni
Browse files Browse the repository at this point in the history
managers: Rebranding Macaroni OS Package Manager
  • Loading branch information
stgraber authored Dec 24, 2023
2 parents 69c177e + 1489007 commit 4b691f8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
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

0 comments on commit 4b691f8

Please sign in to comment.