Skip to content

Commit

Permalink
template: Sort dependency list like wrap-and-sort
Browse files Browse the repository at this point in the history
i.e., place variables like ${misc:Depends} and ${shlibs:Depends}
at the end of the list.

Fixes #121
  • Loading branch information
anthonyfok committed Dec 31, 2019
1 parent b5c52b2 commit 88748fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions template.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ 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)")
}

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)")
Expand Down

0 comments on commit 88748fe

Please sign in to comment.