You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

87 lines
2.9 KiB

Index: src/github.com/docker/docker/pkg/archive/archive_unix.go
--- src/github.com/docker/docker/pkg/archive/archive_unix.go.orig 2018-05-01 12:10:27.000000000 +0200
+++ src/github.com/docker/docker/pkg/archive/archive_unix.go 2018-05-01 12:14:41.712582000 +0200
@@ -62,7 +62,7 @@
s, ok := stat.(*syscall.Stat_t)
if ok {
- inode = s.Ino
+ inode = uint64(s.Ino)
}
return
Index: src/github.com/docker/docker/pkg/archive/changes_unix.go
--- src/github.com/docker/docker/pkg/archive/changes_unix.go.orig 2018-05-01 12:10:27.000000000 +0200
+++ src/github.com/docker/docker/pkg/archive/changes_unix.go 2018-05-01 12:14:41.712712000 +0200
@@ -29,7 +29,7 @@
}
func getIno(fi os.FileInfo) uint64 {
- return fi.Sys().(*syscall.Stat_t).Ino
+ return uint64(fi.Sys().(*syscall.Stat_t).Ino)
}
func hasHardlinks(fi os.FileInfo) bool {
Index: src/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go
--- src/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go.orig 2018-05-01 12:10:27.000000000 +0200
+++ src/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go 2018-05-01 12:17:31.988948000 +0200
@@ -37,7 +37,7 @@
if filter != nil {
// filter out entries we're not interested in
- skip, stop = filter(p)
+ skip, stop = filter(&mountinfo)
if skip {
continue
}
Index: src/github.com/jwilder/docker-gen/template.go
--- src/github.com/jwilder/docker-gen/template.go.orig 2018-05-01 12:09:49.000000000 +0200
+++ src/github.com/jwilder/docker-gen/template.go 2018-05-01 12:14:41.712906000 +0200
@@ -16,6 +16,7 @@
"regexp"
"strconv"
"strings"
+ "sort"
"syscall"
"text/template"
)
@@ -409,6 +410,30 @@
return strings.TrimSpace(s)
}
+// sortStrings returns a sorted array of strings
+func sortStrings(values []string) []string {
+ sort.Strings(values)
+ return values
+}
+
+// sortObjects returns a sorted array of objects (sorted by object key field)
+func sortObjects(objs interface{}, key string) (interface{}, error) {
+ objsVal, err := getArrayValues("sortObj", objs)
+ if err != nil {
+ return nil, err
+ }
+ data := make([]interface{}, objsVal.Len())
+ for i := 0; i < objsVal.Len(); i++ {
+ data[i] = objsVal.Index(i).Interface()
+ }
+ sort.Slice(data, func(i, j int) bool {
+ a := reflect.ValueOf(deepGet(data[i], key)).Interface().(string)
+ b := reflect.ValueOf(deepGet(data[j], key)).Interface().(string)
+ return a < b
+ })
+ return data, nil
+}
+
// when returns the trueValue when the condition is true and the falseValue otherwise
func when(condition bool, trueValue, falseValue interface{}) interface{} {
if condition {
@@ -447,6 +472,8 @@
"trimPrefix": trimPrefix,
"trimSuffix": trimSuffix,
"trim": trim,
+ "sortStrings": sortStrings,
+ "sortObjects": sortObjects,
"when": when,
"where": where,
"whereNot": whereNot,