Skip to content

Commit 4fdef9c

Browse files
committed
Use repository root when it does not match the specified import path
fixes #88
1 parent 51d628b commit 4fdef9c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

make.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,14 @@ func execMake(args []string, usage func()) {
731731
gopkg := fs.Arg(0)
732732

733733
// Ensure the specified argument is a Go package import path.
734-
if _, err := vcs.RepoRootForImportPath(gopkg, false); err != nil {
734+
rr, err := vcs.RepoRootForImportPath(gopkg, false)
735+
if err != nil {
735736
log.Fatalf("Verifying arguments: %v — did you specify a Go package import path?", err)
736737
}
738+
if gopkg != rr.Root {
739+
log.Printf("Continuing with repository root %q instead of specified import path %q (repositories are the unit of packaging in Debian)", rr.Root, gopkg)
740+
gopkg = rr.Root
741+
}
737742

738743
debsrc := debianNameFromGopkg(gopkg, "library", allowUnknownHoster)
739744

0 commit comments

Comments
 (0)