Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #44 from trueos/fix-incremental-pkg
Browse files Browse the repository at this point in the history
Bugfix when doing incremental updates, we need to make sure
  • Loading branch information
beanpole135 authored May 31, 2019
2 parents 2136e74 + 2820767 commit 8b11fbb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.12
require (
github.com/client9/misspell v0.3.4 // indirect
github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc // indirect
github.com/gordonklaus/ineffassign v0.0.0-20190531140324-8863c8f9d746 // indirect
github.com/gorilla/websocket v1.4.0
github.com/magefile/mage v1.8.0
golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835 h1:roDmqJ4Qes7hrDOsW
github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835/go.mod h1:BjL/N0+C+j9uNX+1xcNuM9vdSIcXCZrQZUYbXOFbgN8=
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc h1:cJlkeAx1QYgO5N80aF5xRGstVsRQwgLR7uA2FnP1ZjY=
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
github.com/gordonklaus/ineffassign v0.0.0-20190531140324-8863c8f9d746 h1:RlrReUDDybSbREJYQEFtzr/0vkgKTL3Y2LVUmVsYGHE=
github.com/gordonklaus/ineffassign v0.0.0-20190531140324-8863c8f9d746/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/magefile/mage v1.8.0 h1:mzL+xIopvPURVBwHG9A50JcjBO+xV3b5iZ7khFRI+5E=
Expand Down
20 changes: 20 additions & 0 deletions update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func DoUpdate(message []byte) {
// Start downloading our files if we aren't doing stand-alone upgrade
if defines.UpdateFileFlag == "" {
logger.LogToFile("Fetching file updates")
startpkgfetch()
startfetch()
}

Expand Down Expand Up @@ -1056,6 +1057,25 @@ func rebootNow() {
exec.Command("reboot").Run()
}

func startpkgfetch() error {

cmd := exec.Command(
defines.PKGBIN, "-C", defines.PkgConf, "upgrade", "-F", "-y", "-U",
)
cmd.Args = append(cmd.Args, "-f")
cmd.Args = append(cmd.Args, "ports-mgmt/pkg")

ws.SendMsg("Starting package update download")
out, err := cmd.CombinedOutput()
if err != nil {
ws.SendMsg(string(out))
ws.SendMsg("Failed package fetch!", "fatal")
return err
}
ws.SendMsg(string(out))
return nil
}

func startfetch() error {

cmd := exec.Command(
Expand Down

0 comments on commit 8b11fbb

Please sign in to comment.