summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argv.go30
-rw-r--r--doBuild.debian.go3
-rw-r--r--doLinux.go13
-rw-r--r--subCommand.go11
4 files changed, 33 insertions, 24 deletions
diff --git a/argv.go b/argv.go
index 6813437..dc376a9 100644
--- a/argv.go
+++ b/argv.go
@@ -11,16 +11,16 @@ package main
var argv args
type args struct {
- Git *GitCmd `arg:"subcommand:git" help:"git stuff"`
Build *BuildCmd `arg:"subcommand:build" help:"build and install things"`
+ Upgrade *UpgradeCmd `arg:"subcommand:upgrade" help:"apt upgrade packages installed from mirrors.wit.com"`
+ Git *GitCmd `arg:"subcommand:git" help:"git stuff"`
+ Publish *PublishCmd `arg:"subcommand:publish" help:"publish packages"`
ListPkgs *EmptyCmd `arg:"subcommand:list" help:"list all the packages on mirrors.wit.com"`
Clone *CloneCmd `arg:"subcommand:go-clone" help:"go-clone from a gowebd repomap"`
Linux *LinuxCmd `arg:"subcommand:linux" help:"helpful linux things"`
Zoo *EmptyCmd `arg:"subcommand:zoo" help:"WIT Private Cloud info"`
PB *ProtoCmd `arg:"subcommand:pb" help:"example .pb files"`
Droplet *DropletCmd `arg:"subcommand:droplet" help:"do things on virtual machines"`
- Upgrade *UpgradeCmd `arg:"subcommand:upgrade" help:"apt upgrade packages installed from mirrors.wit.com"`
- Publish *PublishCmd `arg:"subcommand:publish" help:"publish packages"`
Test *TestCmd `arg:"subcommand:test" help:"test things"`
RepoMap string `arg:"--repomap" help:"location of the repomap"`
DryRun bool `arg:"--dry-run" help:"only show what would be packaged"`
@@ -36,7 +36,7 @@ type args struct {
type BuildCmd struct {
Debian *DebianCmd `arg:"subcommand:deb" help:"build missing .deb packages"`
MacBuild *EmptyCmd `arg:"subcommand:macos" help:"build macos packages"`
- Install *DefaultCmd `arg:"subcommand:install" help:"run make install in each repo"`
+ Install *InstallCmd `arg:"subcommand:install" help:"run make install in each repo"`
}
type ProtoCmd struct {
@@ -53,18 +53,19 @@ type TestCmd struct {
}
type LinuxCmd struct {
- Rdate *EmptyCmd `arg:"subcommand:rdate" help:"rdate: check the time from the network"`
+ Rdate *EmptyCmd `arg:"subcommand:rdate" help:"rdate: check the time from the network"`
+ Reboots *EmptyCmd `arg:"subcommand:reboots" help:"show reboots"`
+ Dmesg *EmptyCmd `arg:"subcommand:dmesg" help:"show last dmesg"`
}
type DebianCmd struct {
- Release bool `arg:"--release" help:"use go-deb --release"`
- DryRun bool `arg:"--dry-run" help:"only show what would be packaged"`
- Verbose bool `arg:"--verbose" help:"be loud about it"`
- Force bool `arg:"--force" help:"force devel .deb builds into /incoming"`
- Priv bool `arg:"--private" help:"build private repos"`
- All bool `arg:"--all" help:"build everything again"`
- BuildVersion int `arg:"--buildversion" help:"the build version"`
- Arch string `arg:"--arch" help:"what arch"`
+ All bool `arg:"--all" help:"build everything again"`
+ DryRun bool `arg:"--dry-run" help:"only show what would be packaged"`
+ Release bool `arg:"--release" help:"use go-deb --release"`
+ Verbose bool `arg:"--verbose" help:"be loud about it"`
+ Force bool `arg:"--force" help:"force devel .deb builds into /incoming"`
+ Priv bool `arg:"--private" help:"build private repos"`
+ Arch string `arg:"--arch" help:"what arch"`
}
type CloneCmd struct {
@@ -85,10 +86,9 @@ type PublishCmd struct {
Gomod bool `arg:"--keep-gomod" help:"don't really do anything"`
}
-type DefaultCmd struct {
+type InstallCmd struct {
DryRun bool `arg:"--dry-run" help:"show what has not yet come to pass"`
Verbose bool `arg:"--verbose" help:"be loud about it"`
- Force bool `arg:"--force" help:"rebuild everything"`
}
type GitCmd struct {
diff --git a/doBuild.debian.go b/doBuild.debian.go
index d6120c4..4944907 100644
--- a/doBuild.debian.go
+++ b/doBuild.debian.go
@@ -229,9 +229,6 @@ func getOutdir(repo *gitpb.Repo) string {
if me.forge.Config.IsPrivate(repo.GetNamespace()) {
return "/home/jcarr/incoming-private"
}
- if argv.Force {
- return "/home/jcarr/incoming"
- }
if repo.GetLastTag() != repo.GetMasterVersion() {
return "/home/jcarr/incoming-devel"
}
diff --git a/doLinux.go b/doLinux.go
index 66ce02b..ff318c5 100644
--- a/doLinux.go
+++ b/doLinux.go
@@ -13,11 +13,18 @@ import (
// kernel logs only
// journalctl -b -1 -k
-func doUptime() {
- checkSuperuser()
+func doReboots() (string, error) {
+ // checkSuperuser()
exitOnError([]string{"journalctl", "--list-boots"})
- exitOnError([]string{"journalctl", "-b", "-1"}) // the last boot log
+ return "reboots", nil
+}
+
+func doDmesg() (string, error) {
+ // checkSuperuser()
+
+ exitOnError([]string{"journalctl", "-b", "-0"}) // the current boot log
+ return "reboots", nil
}
func doRdate() (string, error) {
diff --git a/subCommand.go b/subCommand.go
index 33078f0..ca91360 100644
--- a/subCommand.go
+++ b/subCommand.go
@@ -21,10 +21,15 @@ func subCommand() (string, error) {
if argv.Linux != nil {
if argv.Linux.Rdate != nil {
- s, err = doRdate()
- } else {
- setTerminalTitle("pinging google", "ping", []string{"google.com"})
+ return doRdate()
+ }
+ if argv.Linux.Reboots != nil {
+ return doReboots()
+ }
+ if argv.Linux.Dmesg != nil {
+ return doDmesg()
}
+ setTerminalTitle("pinging google", "ping", []string{"google.com"})
}
if argv.Build != nil {