Skip to content

Commit 79a2cc6

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 0846d5a commit 79a2cc6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

make.go

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

418418
func createGitRepository(debsrc, gopkg, orig string, u *upstream,
419-
includeUpstreamHistory bool, allowUnknownHoster bool, debianBranch string, pristineTar bool) (string, error) {
419+
includeUpstreamHistory bool, allowUnknownHoster bool, debianBranch string, dep14 bool, pristineTar bool) (string, error) {
420420
wd, err := os.Getwd()
421421
if err != nil {
422422
return "", fmt.Errorf("get cwd: %w", err)
@@ -471,7 +471,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
471471

472472
// Preconfigure branches
473473

474-
branches := []string{debianBranch, "upstream"}
474+
branches := []string{debianBranch, "upstream/latest"}
475475
if pristineTar {
476476
branches = append(branches, "pristine-tar")
477477
}
@@ -505,6 +505,9 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
505505
// Import upstream orig tarball
506506

507507
arg := []string{"import-orig", "--no-interactive", "--debian-branch=" + debianBranch}
508+
if dep14 {
509+
arg = append(arg, "--upstream-branch=upstream/latest")
510+
}
508511
if pristineTar {
509512
arg = append(arg, "--pristine-tar")
510513
}
@@ -786,7 +789,7 @@ func execMake(args []string, usage func()) {
786789
fs.BoolVar(&dep14,
787790
"dep14",
788791
true,
789-
"Follow DEP-14 branch naming and use debian/sid (instead of master)\n"+
792+
"Follow DEP-14 branch naming and use debian/latest (instead of master)\n"+
790793
"as the default debian-branch.")
791794

792795
var pristineTar bool
@@ -896,7 +899,7 @@ func execMake(args []string, usage func()) {
896899
// Set the debian branch.
897900
debBranch := "master"
898901
if dep14 {
899-
debBranch = "debian/sid"
902+
debBranch = "debian/latest"
900903
}
901904

902905
switch strings.TrimSpace(wrapAndSort) {
@@ -987,7 +990,7 @@ func execMake(args []string, usage func()) {
987990

988991
debversion := u.version + "-1"
989992

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

template.go

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

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

0 commit comments

Comments
 (0)