Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ugorji/go/codec to latest version #855

Merged
merged 4 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ List of contributors, in chronological order:
* Strajan Sebastian (https://github.com/strajansebastian)
* Artem Smirnov (https://github.com/urpylka)
* William Manley (https://github.com/wmanley)
* Shengjing Zhu (https://github.com/zhsj)
21 changes: 11 additions & 10 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

[[override]]
name = "github.com/ugorji/go"
revision = "71c2886f5a673a35f909803f38ece5810165097b"
version = "=1.1.4"

[[override]]
branch = "master"
Expand Down
4 changes: 2 additions & 2 deletions deb/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// LocalRepo is a collection of packages created locally
type LocalRepo struct {
// Permanent internal ID
UUID string `json:"-"`
UUID string `codec:"UUID" json:"-"`
// User-assigned name
Name string
// Comment
Expand All @@ -25,7 +25,7 @@ type LocalRepo struct {
// DefaultComponent
DefaultComponent string `codec:",omitempty"`
// Uploaders configuration
Uploaders *Uploaders `code:",omitempty" json:"-"`
Uploaders *Uploaders `codec:"Uploaders,omitempty" json:"-"`
// "Snapshot" of current list of packages
packageRefs *PackageRefList
}
Expand Down
12 changes: 12 additions & 0 deletions deb/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,18 @@ func (repo *RemoteRepo) Decode(input []byte) error {
repo.ReleaseFiles = repo11.ReleaseFiles
repo.Filter = repo11.Filter
repo.FilterWithDeps = repo11.FilterWithDeps
} else if strings.Contains(err.Error(), "invalid length of bytes for decoding time") {
// DB created by old codec version, time.Time is not builtin type.
// https://github.com/ugorji/go-codec/issues/269
decoder := codec.NewDecoderBytes(input, &codec.MsgpackHandle{
// only can be configured in Deprecated BasicHandle struct
BasicHandle: codec.BasicHandle{ // nolint: staticcheck
TimeNotBuiltin: true,
},
})
if err = decoder.Decode(repo); err != nil {
return err
}
} else {
return err
}
Expand Down
18 changes: 15 additions & 3 deletions deb/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import (
// Snapshot is immutable state of repository: list of packages
type Snapshot struct {
// Persisten internal ID
UUID string `json:"-"`
UUID string `codec:"UUID" json:"-"`
// Human-readable name
Name string
// Date of creation
CreatedAt time.Time

// Source: kind + ID
SourceKind string `json:"-"`
SourceIDs []string `json:"-"`
SourceKind string `codec:"SourceKind" json:"-"`
SourceIDs []string `codec:"SourceIDs" json:"-"`
// Description of how snapshot was created
Description string

Expand Down Expand Up @@ -163,6 +163,18 @@ func (s *Snapshot) Decode(input []byte) error {
s.SourceKind = snapshot11.SourceKind
s.SourceIDs = snapshot11.SourceIDs
s.Description = snapshot11.Description
} else if strings.Contains(err.Error(), "invalid length of bytes for decoding time") {
// DB created by old codec version, time.Time is not builtin type.
// https://github.com/ugorji/go-codec/issues/269
decoder := codec.NewDecoderBytes(input, &codec.MsgpackHandle{
// only can be configured in Deprecated BasicHandle struct
BasicHandle: codec.BasicHandle{ // nolint: staticcheck
TimeNotBuiltin: true,
},
})
if err = decoder.Decode(s); err != nil {
return err
}
} else {
return err
}
Expand Down
13 changes: 13 additions & 0 deletions vendor/github.com/ugorji/go/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 18 additions & 21 deletions vendor/github.com/ugorji/go/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 36 additions & 5 deletions vendor/github.com/ugorji/go/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/ugorji/go/codec/0_importpath.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading