@@ -71,11 +71,11 @@ func fprintfControlField(f *os.File, field string, valueArray []string) {
7171 case "a" :
7272 // Current default, also what "cme fix dpkg" generates
7373 fmt .Fprintf (f , "%s: %s\n " , field , strings .Join (valueArray , ",\n " + strings .Repeat (" " , len (field )+ 2 )))
74- case "at" , "ta" :
74+ case "at" :
7575 // -t, --trailing-comma, preferred by Martina Ferrari
7676 // and currently used in quite a few packages
7777 fmt .Fprintf (f , "%s: %s,\n " , field , strings .Join (valueArray , ",\n " + strings .Repeat (" " , len (field )+ 2 )))
78- case "ast" , "ats" , "sat" , "sta" , "tas" , "tsa" :
78+ case "ast" :
7979 // -s, --short-indent too, proposed by Guillem Jover
8080 fmt .Fprintf (f , "%s:\n %s,\n " , field , strings .Join (valueArray , ",\n " ))
8181 default :
@@ -203,21 +203,28 @@ func writeDebianCopyright(dir, gopkg string, vendorDirs []string) error {
203203 copyright = "TODO"
204204 }
205205
206+ var indent = " "
207+ var linebreak = ""
208+ if wrapAndSort == "ast" {
209+ indent = " "
210+ linebreak = "\n "
211+ }
212+
206213 fmt .Fprintf (f , "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\n " )
207214 fmt .Fprintf (f , "Source: %s\n " , getHomepageForGopkg (gopkg ))
208215 fmt .Fprintf (f , "Upstream-Name: %s\n " , filepath .Base (gopkg ))
209216 fmt .Fprintf (f , "Files-Excluded:\n " )
210217 for _ , dir := range vendorDirs {
211- fmt .Fprintf (f , " %s\n " , dir )
218+ fmt .Fprintf (f , indent + " %s\n " , dir )
212219 }
213- fmt .Fprintf (f , " Godeps/_workspace\n " )
220+ fmt .Fprintf (f , indent + " Godeps/_workspace\n " )
214221 fmt .Fprintf (f , "\n " )
215- fmt .Fprintf (f , "Files:\n *\n " )
216- fmt .Fprintf (f , "Copyright:\n %s\n " , copyright )
222+ fmt .Fprintf (f , "Files:" + linebreak + " *\n " )
223+ fmt .Fprintf (f , "Copyright:" + linebreak + " %s\n " , copyright )
217224 fmt .Fprintf (f , "License: %s\n " , license )
218225 fmt .Fprintf (f , "\n " )
219- fmt .Fprintf (f , "Files:\n debian/*\n " )
220- fmt .Fprintf (f , "Copyright:\n %s %s <%s>\n " , time .Now ().Format ("2006" ), getDebianName (), getDebianEmail ())
226+ fmt .Fprintf (f , "Files:" + linebreak + " debian/*\n " )
227+ fmt .Fprintf (f , "Copyright:" + linebreak + " %s %s <%s>\n " , time .Now ().Format ("2006" ), getDebianName (), getDebianEmail ())
221228 fmt .Fprintf (f , "License: %s\n " , license )
222229 fmt .Fprintf (f , "Comment: Debian packaging is licensed under the same terms as upstream\n " )
223230 fmt .Fprintf (f , "\n " )
0 commit comments