Skip to content

Commit 5bcc117

Browse files
committed
Use DEP-14 branch names debian/latest and upstream/latest
In DEP-14, the preferred branch name for the Debian packaging target branch is `debian/latest` and the preferred name for the upstream import target branch is `upstream/latest`. Note that the upstream development branch name can be whatever and should stay as it is upstream, typically `main` or `master`. The branch `upstream/latest` should not point to the latest upstream development commit, but to the latest commit that was used as the upstream release that the Debian revision was derived from.
1 parent a6fe7fa commit 5bcc117

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

make.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ func runGitCommandIn(dir string, arg ...string) error {
417417
}
418418

419419
func createGitRepository(debsrc, gopkg, orig string, u *upstream,
420-
includeUpstreamHistory bool, allowUnknownHoster bool, debianBranch string, pristineTar bool) (string, error) {
420+
includeUpstreamHistory bool, allowUnknownHoster bool, debianBranch string,
421+
dep14 bool, pristineTar bool) (string, error) {
421422
wd, err := os.Getwd()
422423
if err != nil {
423424
return "", fmt.Errorf("get cwd: %w", err)
@@ -463,7 +464,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
463464

464465
// Preconfigure branches
465466

466-
branches := []string{debianBranch, "upstream"}
467+
branches := []string{debianBranch, "upstream/latest"}
467468
if pristineTar {
468469
branches = append(branches, "pristine-tar")
469470
}
@@ -497,6 +498,9 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
497498
// Import upstream orig tarball
498499

499500
arg := []string{"import-orig", "--no-interactive", "--debian-branch=" + debianBranch}
501+
if dep14 {
502+
arg = append(arg, "--upstream-branch=upstream/latest")
503+
}
500504
if pristineTar {
501505
arg = append(arg, "--pristine-tar")
502506
}
@@ -782,7 +786,7 @@ func execMake(args []string, usage func()) {
782786
fs.BoolVar(&dep14,
783787
"dep14",
784788
true,
785-
"Follow DEP-14 branch naming and use debian/sid (instead of master)\n"+
789+
"Follow DEP-14 branch naming and use debian/latest (instead of master)\n"+
786790
"as the default debian-branch.")
787791

788792
var pristineTar bool
@@ -892,7 +896,7 @@ func execMake(args []string, usage func()) {
892896
// Set the debian branch.
893897
debBranch := "master"
894898
if dep14 {
895-
debBranch = "debian/sid"
899+
debBranch = "debian/latest"
896900
}
897901

898902
switch strings.TrimSpace(wrapAndSort) {
@@ -983,7 +987,7 @@ func execMake(args []string, usage func()) {
983987

984988
debversion := u.version + "-1"
985989

986-
dir, err := createGitRepository(debsrc, gopkg, orig, u, includeUpstreamHistory, allowUnknownHoster, debBranch, pristineTar)
990+
dir, err := createGitRepository(debsrc, gopkg, orig, u, includeUpstreamHistory, allowUnknownHoster, debBranch, dep14, pristineTar)
987991
if err != nil {
988992
log.Fatalf("Could not create git repository: %v\n", err)
989993
}

template.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ func writeDebianGbpConf(dir string, dep14, pristineTar bool) error {
336336

337337
fmt.Fprintf(f, "[DEFAULT]\n")
338338
if dep14 {
339-
fmt.Fprintf(f, "debian-branch = debian/sid\n")
339+
fmt.Fprintf(f, "debian-branch = debian/latest\n")
340+
fmt.Fprintf(f, "upstream-branch = upstream/latest\n")
340341
fmt.Fprintf(f, "dist = DEP14\n")
341342
}
342343
if pristineTar {

0 commit comments

Comments
 (0)