Skip to content

Commit

Permalink
Fix -latest binary libs update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Jan 21, 2020
1 parent 61481fa commit d8178be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions cli/build_local.go
Expand Up @@ -36,15 +36,15 @@ import (

"github.com/golang/glog"
"github.com/juju/errors"
"github.com/mongoose-os/mos/common/multierror"
"github.com/mongoose-os/mos/common/ourio"
"github.com/mongoose-os/mos/cli/build"
moscommon "github.com/mongoose-os/mos/cli/common"
"github.com/mongoose-os/mos/cli/flags"
"github.com/mongoose-os/mos/cli/interpreter"
"github.com/mongoose-os/mos/cli/manifest_parser"
"github.com/mongoose-os/mos/cli/mosgit"
"github.com/mongoose-os/mos/cli/ourutil"
"github.com/mongoose-os/mos/common/multierror"
"github.com/mongoose-os/mos/common/ourio"
yaml "gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -134,10 +134,14 @@ func buildLocal2(ctx context.Context, bParams *buildParams, clean bool) (err err
return errors.Trace(err)
}

libsUpdateIntvl := *libsUpdateInterval
if *noLibsUpdate {
libsUpdateIntvl = 0
}
manifest, fp, err := manifest_parser.ReadManifestFinal(
appDir, &bParams.ManifestAdjustments, logWriter, interp,
&manifest_parser.ReadManifestCallbacks{ComponentProvider: &compProvider},
true /* requireArch */, *preferPrebuiltLibs, *libsUpdateInterval)
true /* requireArch */, *preferPrebuiltLibs, libsUpdateIntvl)
if err != nil {
return errors.Trace(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/manifest_parser/manifest_parser.go
Expand Up @@ -308,7 +308,7 @@ func ReadManifestFinal(
if err == nil {
// Local file exists, check it.
// We want to re-fetch "latest" libs regularly (same way as repos get pulled).
if variant != version.LatestVersionName || binaryLibsUpdateInterval == 0 ||
if libVersion != version.LatestVersionName || binaryLibsUpdateInterval == 0 ||
fi.ModTime().Add(binaryLibsUpdateInterval).After(time.Now()) {
if fi.Size() == 0 {
// It's a tombstone, meaning this variant does not exist. Skip it.
Expand Down

0 comments on commit d8178be

Please sign in to comment.