@@ -295,7 +295,7 @@ func runGitCommandIn(dir string, arg ...string) error {
295
295
return cmd .Run ()
296
296
}
297
297
298
- func createGitRepository (debsrc , gopkg , orig string , dep14 bool ) (string , error ) {
298
+ func createGitRepository (debsrc , gopkg , orig string , dep14 , pristineTar bool ) (string , error ) {
299
299
wd , err := os .Getwd ()
300
300
if err != nil {
301
301
return "" , err
@@ -315,36 +315,39 @@ func createGitRepository(debsrc, gopkg, orig string, dep14 bool) (string, error)
315
315
}
316
316
}
317
317
318
+ // Set repository options
319
+
318
320
if debianName := getDebianName (); debianName != "TODO" {
319
321
if err := runGitCommandIn (dir , "config" , "user.name" , debianName ); err != nil {
320
322
return dir , err
321
323
}
322
324
}
323
-
324
325
if debianEmail := getDebianEmail (); debianEmail != "TODO" {
325
326
if err := runGitCommandIn (dir , "config" , "user.email" , debianEmail ); err != nil {
326
327
return dir , err
327
328
}
328
329
}
329
-
330
330
if err := runGitCommandIn (dir , "config" , "push.default" , "matching" ); err != nil {
331
331
return dir , err
332
332
}
333
-
334
333
if err := runGitCommandIn (dir , "config" , "--add" , "remote.origin.push" , "+refs/heads/*:refs/heads/*" ); err != nil {
335
334
return dir , err
336
335
}
337
-
338
336
if err := runGitCommandIn (dir , "config" , "--add" , "remote.origin.push" , "+refs/tags/*:refs/tags/*" ); err != nil {
339
337
return dir , err
340
338
}
341
339
342
- var cmd * exec.Cmd
340
+ // Import upstream orig tarball
341
+
342
+ arg := []string {"import-orig" , "--no-interactive" }
343
343
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" )
347
348
}
349
+ arg = append (arg , filepath .Join (wd , orig ))
350
+ cmd := exec .Command ("gbp" , arg ... )
348
351
cmd .Dir = dir
349
352
cmd .Stderr = os .Stderr
350
353
if err := cmd .Run (); err != nil {
@@ -758,7 +761,7 @@ func execMake(args []string, usage func()) {
758
761
759
762
debversion := u .version + "-1"
760
763
761
- dir , err := createGitRepository (debsrc , gopkg , orig , dep14 )
764
+ dir , err := createGitRepository (debsrc , gopkg , orig , dep14 , pristineTar )
762
765
if err != nil {
763
766
log .Fatalf ("Could not create git repository: %v\n " , err )
764
767
}
0 commit comments