summaryrefslogtreecommitdiff
path: root/apt.go
blob: d2524b5c84b55b697ffd87484d8dd22fdd2df50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0

package main

import (
	"go.wit.com/log"
)

func aptInstall(pkgname string) {
	cmd := []string{"apt-get", "install", "-y", pkgname}
	log.Info("Running:", cmd)
	exitOnError(cmd)
}

func aptRemove(pkgname string) {
	if pkgname == "mirrors.wit.com" {
		return
	}
	cmd := []string{"apt-get", "remove", "-y", pkgname}
	log.Info("Running:", cmd)
	exitOnError(cmd)
}

func aptUpdate() {
	cmd := []string{"apt", "update"}
	exitOnError(cmd)

	aptInstall("wit-tools")
}