Skip to content

Commit 2e29860

Browse files
committed
Fix --dep14=false behaviour
1 parent ebcdcc6 commit 2e29860

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

make.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func runGitCommandIn(dir string, arg ...string) error {
289289
return cmd.Run()
290290
}
291291

292-
func createGitRepository(debsrc, gopkg, orig string) (string, error) {
292+
func createGitRepository(debsrc, gopkg, orig string, dep14 bool) (string, error) {
293293
wd, err := os.Getwd()
294294
if err != nil {
295295
return "", err
@@ -303,8 +303,10 @@ func createGitRepository(debsrc, gopkg, orig string) (string, error) {
303303
return dir, err
304304
}
305305

306-
if err := runGitCommandIn(dir, "checkout", "-b", "debian/sid"); err != nil {
307-
return dir, err
306+
if dep14 {
307+
if err := runGitCommandIn(dir, "checkout", "-b", "debian/sid"); err != nil {
308+
return dir, err
309+
}
308310
}
309311

310312
if debianName := getDebianName(); debianName != "TODO" {
@@ -331,7 +333,12 @@ func createGitRepository(debsrc, gopkg, orig string) (string, error) {
331333
return dir, err
332334
}
333335

334-
cmd := exec.Command("gbp", "import-orig", "--debian-branch=debian/sid", "--no-interactive", filepath.Join(wd, orig))
336+
var cmd *exec.Cmd
337+
if dep14 {
338+
cmd = exec.Command("gbp", "import-orig", "--debian-branch=debian/sid", "--no-interactive", filepath.Join(wd, orig))
339+
} else {
340+
cmd = exec.Command("gbp", "import-orig", "--no-interactive", filepath.Join(wd, orig))
341+
}
335342
cmd.Dir = dir
336343
cmd.Stderr = os.Stderr
337344
if err := cmd.Run(); err != nil {
@@ -745,7 +752,7 @@ func execMake(args []string, usage func()) {
745752

746753
debversion := u.version + "-1"
747754

748-
dir, err := createGitRepository(debsrc, gopkg, orig)
755+
dir, err := createGitRepository(debsrc, gopkg, orig, dep14)
749756
if err != nil {
750757
log.Fatalf("Could not create git repository: %v\n", err)
751758
}

template.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ func writeDebianSourceFormat(dir string) error {
270270
}
271271

272272
func writeDebianGbpConf(dir string, dep14, pristineTar bool) error {
273+
if !(dep14 || pristineTar) {
274+
return nil
275+
}
276+
273277
f, err := os.Create(filepath.Join(dir, "debian", "gbp.conf"))
274278
if err != nil {
275279
return err

0 commit comments

Comments
 (0)