Skip to content

Commit 0f04910

Browse files
committed
make: Fix "gbp import-orig" call for -pristine-tar=true
so that the pristine-tar branch is actually created when requested.
1 parent 3276880 commit 0f04910

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

make.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func runGitCommandIn(dir string, arg ...string) error {
295295
return cmd.Run()
296296
}
297297

298-
func createGitRepository(debsrc, gopkg, orig string, dep14 bool) (string, error) {
298+
func createGitRepository(debsrc, gopkg, orig string, dep14, pristineTar bool) (string, error) {
299299
wd, err := os.Getwd()
300300
if err != nil {
301301
return "", err
@@ -315,36 +315,39 @@ func createGitRepository(debsrc, gopkg, orig string, dep14 bool) (string, error)
315315
}
316316
}
317317

318+
// Set repository options
319+
318320
if debianName := getDebianName(); debianName != "TODO" {
319321
if err := runGitCommandIn(dir, "config", "user.name", debianName); err != nil {
320322
return dir, err
321323
}
322324
}
323-
324325
if debianEmail := getDebianEmail(); debianEmail != "TODO" {
325326
if err := runGitCommandIn(dir, "config", "user.email", debianEmail); err != nil {
326327
return dir, err
327328
}
328329
}
329-
330330
if err := runGitCommandIn(dir, "config", "push.default", "matching"); err != nil {
331331
return dir, err
332332
}
333-
334333
if err := runGitCommandIn(dir, "config", "--add", "remote.origin.push", "+refs/heads/*:refs/heads/*"); err != nil {
335334
return dir, err
336335
}
337-
338336
if err := runGitCommandIn(dir, "config", "--add", "remote.origin.push", "+refs/tags/*:refs/tags/*"); err != nil {
339337
return dir, err
340338
}
341339

342-
var cmd *exec.Cmd
340+
// Import upstream orig tarball
341+
342+
arg := []string{"import-orig", "--no-interactive"}
343343
if dep14 {
344-
cmd = exec.Command("gbp", "import-orig", "--debian-branch=debian/sid", "--no-interactive", filepath.Join(wd, orig))
345-
} else {
346-
cmd = exec.Command("gbp", "import-orig", "--no-interactive", filepath.Join(wd, orig))
344+
arg = append(arg, "--debian-branch=debian/sid")
345+
}
346+
if pristineTar {
347+
arg = append(arg, "--pristine-tar")
347348
}
349+
arg = append(arg, filepath.Join(wd, orig))
350+
cmd := exec.Command("gbp", arg...)
348351
cmd.Dir = dir
349352
cmd.Stderr = os.Stderr
350353
if err := cmd.Run(); err != nil {
@@ -758,7 +761,7 @@ func execMake(args []string, usage func()) {
758761

759762
debversion := u.version + "-1"
760763

761-
dir, err := createGitRepository(debsrc, gopkg, orig, dep14)
764+
dir, err := createGitRepository(debsrc, gopkg, orig, dep14, pristineTar)
762765
if err != nil {
763766
log.Fatalf("Could not create git repository: %v\n", err)
764767
}

0 commit comments

Comments
 (0)