From 88748fec2f55c9d34f3d2a6ea9225ce00769b586 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Tue, 31 Dec 2019 03:23:59 -0700 Subject: [PATCH] template: Sort dependency list like wrap-and-sort i.e., place variables like ${misc:Depends} and ${shlibs:Depends} at the end of the list. Fixes #121 --- template.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/template.go b/template.go index 2533aa8..38181c1 100644 --- a/template.go +++ b/template.go @@ -104,10 +104,10 @@ func addDescription(f *os.File, gopkg, comment string) { func addLibraryPackage(f *os.File, gopkg, debLib string, dependencies []string) { fmt.Fprintf(f, "\n") fmt.Fprintf(f, "Package: %s\n", debLib) - deps := []string{"${misc:Depends}"} fmt.Fprintf(f, "Architecture: all\n") - deps = append(deps, dependencies...) + deps := dependencies sort.Strings(deps) + deps = append(deps, "${misc:Depends}") fprintfControlField(f, "Depends", deps) addDescription(f, gopkg, "(library)") } @@ -115,10 +115,10 @@ func addLibraryPackage(f *os.File, gopkg, debLib string, dependencies []string) func addProgramPackage(f *os.File, gopkg, debProg string, dependencies []string) { fmt.Fprintf(f, "\n") fmt.Fprintf(f, "Package: %s\n", debProg) - deps := []string{"${misc:Depends}"} fmt.Fprintf(f, "Architecture: any\n") - deps = append(deps, "${shlibs:Depends}") + deps := dependencies sort.Strings(deps) + deps = append(deps, "${misc:Depends}", "${shlibs:Depends}") fprintfControlField(f, "Depends", deps) fmt.Fprintf(f, "Built-Using: ${misc:Built-Using}\n") addDescription(f, gopkg, "(program)")