Package: aptly / 1.3.0+ds1-2.2

Fix-UUID-struct-field-not-encoded-in-msgpack.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Shengjing Zhu <zhsj@debian.org>
Date: Tue, 26 Mar 2019 15:49:40 +0800
Subject: Fix UUID struct field not encoded in msgpack
Description: golang-github-ugorji-go-codec-dev 1.1.1 takes the json field tag
 by default, thus the field which has `json:"-"` is ignored when
 marshal into msgpack.
Upstream uses the old codec library, so there's no problem.
Bug-Debian: https://bugs.debian.org/923866
Forwarded: no
---
 deb/local.go    | 4 ++--
 deb/snapshot.go | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/deb/local.go b/deb/local.go
index e9fa17c..fb3e404 100644
--- a/deb/local.go
+++ b/deb/local.go
@@ -14,7 +14,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
@@ -24,7 +24,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
 }
diff --git a/deb/snapshot.go b/deb/snapshot.go
index fc7689c..1aca3e3 100644
--- a/deb/snapshot.go
+++ b/deb/snapshot.go
@@ -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