Skip to content

Commit

Permalink
Put build artifacts in debian/build/ to avoid polluting upstream so…
Browse files Browse the repository at this point in the history
…urces

Instead of putting build artifacts in `_build/` at the project root,
where they pollute the upstream sources and lure some people to also
modify the upstream `.gitignore` file, put it in `debian/build/` along
with all other build artifacts that get generated in `debian/`.
  • Loading branch information
ottok committed Nov 29, 2024
1 parent 98bb595 commit d57090d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion template.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func writeDebianGitIgnore(dir, debLib, debProg string, pkgType packageType) erro
fmt.Fprintf(f, "*.log\n")
fmt.Fprintf(f, "*.substvars\n")
fmt.Fprintf(f, "/.debhelper/\n")
fmt.Fprintf(f, "/build/\n")
fmt.Fprintf(f, "/debhelper-build-stamp\n")
fmt.Fprintf(f, "/files\n")

Expand Down Expand Up @@ -299,7 +300,7 @@ func writeDebianRules(dir string, pkgType packageType) error {
fmt.Fprintf(f, "#!/usr/bin/make -f\n")
fmt.Fprintf(f, "\n")
fmt.Fprintf(f, "%%:\n")
fmt.Fprintf(f, "\tdh $@ --builddirectory=_build --buildsystem=golang\n")
fmt.Fprintf(f, "\tdh $@ --builddirectory=debian/build --buildsystem=golang\n")
if pkgType == typeProgram {
fmt.Fprintf(f, "\n")
fmt.Fprintf(f, "override_dh_auto_install:\n")
Expand Down

0 comments on commit d57090d

Please sign in to comment.