Skip to content

Commit d5fd544

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 568ca8e commit d5fd544

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
@@ -416,7 +416,8 @@ 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,
420+
dep14 bool, pristineTar bool) (string, error) {
420421
wd, err := os.Getwd()
421422
if err != nil {
422423
return "", fmt.Errorf("get cwd: %w", err)
@@ -462,7 +463,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
462463

463464
// Preconfigure branches
464465

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

498499
arg := []string{"import-orig", "--no-interactive", "--debian-branch=" + debianBranch}
500+
if dep14 {
501+
arg = append(arg, "--upstream-branch=upstream/latest")
502+
}
499503
if pristineTar {
500504
arg = append(arg, "--pristine-tar")
501505
}
@@ -777,7 +781,7 @@ func execMake(args []string, usage func()) {
777781
fs.BoolVar(&dep14,
778782
"dep14",
779783
true,
780-
"Follow DEP-14 branch naming and use debian/sid (instead of master)\n"+
784+
"Follow DEP-14 branch naming and use debian/latest (instead of master)\n"+
781785
"as the default debian-branch.")
782786

783787
var pristineTar bool
@@ -887,7 +891,7 @@ func execMake(args []string, usage func()) {
887891
// Set the debian branch.
888892
debBranch := "master"
889893
if dep14 {
890-
debBranch = "debian/sid"
894+
debBranch = "debian/latest"
891895
}
892896

893897
switch strings.TrimSpace(wrapAndSort) {
@@ -978,7 +982,7 @@ func execMake(args []string, usage func()) {
978982

979983
debversion := u.version + "-1"
980984

981-
dir, err := createGitRepository(debsrc, gopkg, orig, u, includeUpstreamHistory, allowUnknownHoster, debBranch, pristineTar)
985+
dir, err := createGitRepository(debsrc, gopkg, orig, u, includeUpstreamHistory, allowUnknownHoster, debBranch, dep14, pristineTar)
982986
if err != nil {
983987
log.Fatalf("Could not create git repository: %v\n", err)
984988
}

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)