summaryrefslogtreecommitdiff
path: root/apt.go
diff options
context:
space:
mode:
Diffstat (limited to 'apt.go')
-rw-r--r--apt.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/apt.go b/apt.go
new file mode 100644
index 0000000..ee7935f
--- /dev/null
+++ b/apt.go
@@ -0,0 +1,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", "install", "-y", pkgname}
+ log.Info("Running:", cmd)
+ exitOnError(cmd)
+}
+
+func aptRemove(pkgname string) {
+ if pkgname == "mirrors.wit.com" {
+ return
+ }
+ cmd := []string{"apt", "remove", "-y", pkgname}
+ log.Info("Running:", cmd)
+ exitOnError(cmd)
+}
+
+func aptUpdate() {
+ cmd := []string{"apt", "update"}
+ exitOnError(cmd)
+
+ aptInstall("wit-tools")
+}