From d57090dc82bf73cb43f9f53bd6b07fc9aa522105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Thu, 28 Nov 2024 21:29:03 -0800 Subject: [PATCH] Put build artifacts in `debian/build/` to avoid polluting upstream sources 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/`. --- template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template.go b/template.go index a1a1687..e4c7dcf 100644 --- a/template.go +++ b/template.go @@ -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") @@ -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")