Skip to content

Commit 132b413

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 9fbf9e3 commit 132b413

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
}
@@ -780,7 +784,7 @@ func execMake(args []string, usage func()) {
780784
fs.BoolVar(&dep14,
781785
"dep14",
782786
true,
783-
"Follow DEP-14 branch naming and use debian/sid (instead of master)\n"+
787+
"Follow DEP-14 branch naming and use debian/latest (instead of master)\n"+
784788
"as the default debian-branch.")
785789

786790
var pristineTar bool
@@ -890,7 +894,7 @@ func execMake(args []string, usage func()) {
890894
// Set the debian branch.
891895
debBranch := "master"
892896
if dep14 {
893-
debBranch = "debian/sid"
897+
debBranch = "debian/latest"
894898
}
895899

896900
switch strings.TrimSpace(wrapAndSort) {
@@ -981,7 +985,7 @@ func execMake(args []string, usage func()) {
981985

982986
debversion := u.version + "-1"
983987

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

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)