2021-11-03 16:22:40 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
|
|
"git.wit.org/wit/gui"
|
|
|
|
)
|
|
|
|
|
2021-11-03 17:12:13 -05:00
|
|
|
func aptGroup(tab *gui.Node) {
|
2021-11-03 16:22:40 -05:00
|
|
|
n := tab.AddGroup("apt Resets")
|
|
|
|
|
2021-11-03 17:12:13 -05:00
|
|
|
n.AddButton("update apt-file", func (*gui.Node) {
|
|
|
|
// shell.Script("apt -y install apt-file\napt-file update")
|
|
|
|
// xterm("apt -y install apt-file; apt-file update")
|
2021-11-03 22:41:01 -05:00
|
|
|
// gui.ErrorWindow("test error window", "this is the error")
|
2021-11-03 22:20:49 -05:00
|
|
|
err := sudo( func() error {
|
|
|
|
err := bash("apt install moon-buggy")
|
|
|
|
return err
|
|
|
|
})
|
|
|
|
if (err != nil) {
|
2021-11-03 22:41:01 -05:00
|
|
|
gui.ErrorWindow("Error", "Failed to run:\napt install moon-buggy")
|
|
|
|
return
|
2021-11-03 22:20:49 -05:00
|
|
|
}
|
|
|
|
err = bash("bash -x /tmp/jcarr")
|
|
|
|
bash("apt -y install apt-file")
|
|
|
|
bash("apt-file update")
|
2021-11-03 16:22:40 -05:00
|
|
|
})
|
2021-11-04 04:47:46 -05:00
|
|
|
|
|
|
|
n.AddButton("install packages", func (*gui.Node) {
|
|
|
|
aptPackagesWindow(nil)
|
|
|
|
})
|
|
|
|
|
2021-11-03 22:56:17 -05:00
|
|
|
n.AddButton("install base packages", func (*gui.Node) {
|
|
|
|
sudo( func() error {
|
|
|
|
line := "apt install moon-buggy2"
|
|
|
|
err := bash(line)
|
|
|
|
if (err != nil) {
|
|
|
|
gui.ErrorWindow("Error", "Failed to run:\n" + line)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
})
|
2021-11-03 16:22:40 -05:00
|
|
|
n.AddButton("purge rc-only", func (*gui.Node) {
|
|
|
|
xterm("dpkg -l |grep ^rc | awk '{print $2}' |xargs apt remove --purge -y")
|
|
|
|
})
|
|
|
|
n.AddButton("install defaults", func (*gui.Node) {
|
|
|
|
xterm("./resources/bin/setup-packages-default")
|
|
|
|
})
|
|
|
|
n.AddButton("install kvm", func (*gui.Node) {
|
|
|
|
xterm("./resources/bin/setup-packages-kvm")
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|