|
|
@ -694,7 +694,7 @@ func doDebianSource(cmdline []string) { |
|
|
|
} |
|
|
|
} |
|
|
|
// Download and verify the Go source packages.
|
|
|
|
// Download and verify the Go source packages.
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
gobootbundle = downloadGoBootstrapSources(*cachedir) |
|
|
|
gobootbundles = downloadGoBootstrapSources(*cachedir) |
|
|
|
gobundle = downloadGoSources(*cachedir) |
|
|
|
gobundle = downloadGoSources(*cachedir) |
|
|
|
) |
|
|
|
) |
|
|
|
// Download all the dependencies needed to build the sources and run the ci script
|
|
|
|
// Download all the dependencies needed to build the sources and run the ci script
|
|
|
@ -714,12 +714,14 @@ func doDebianSource(cmdline []string) { |
|
|
|
pkgdir := stageDebianSource(*workdir, meta) |
|
|
|
pkgdir := stageDebianSource(*workdir, meta) |
|
|
|
|
|
|
|
|
|
|
|
// Add bootstrapper Go source code
|
|
|
|
// Add bootstrapper Go source code
|
|
|
|
|
|
|
|
for i, gobootbundle := range gobootbundles { |
|
|
|
if err := build.ExtractArchive(gobootbundle, pkgdir); err != nil { |
|
|
|
if err := build.ExtractArchive(gobootbundle, pkgdir); err != nil { |
|
|
|
log.Fatalf("Failed to extract bootstrapper Go sources: %v", err) |
|
|
|
log.Fatalf("Failed to extract bootstrapper Go sources: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
if err := os.Rename(filepath.Join(pkgdir, "go"), filepath.Join(pkgdir, ".goboot")); err != nil { |
|
|
|
if err := os.Rename(filepath.Join(pkgdir, "go"), filepath.Join(pkgdir, fmt.Sprintf(".goboot-%d", i+1))); err != nil { |
|
|
|
log.Fatalf("Failed to rename bootstrapper Go source folder: %v", err) |
|
|
|
log.Fatalf("Failed to rename bootstrapper Go source folder: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// Add builder Go source code
|
|
|
|
// Add builder Go source code
|
|
|
|
if err := build.ExtractArchive(gobundle, pkgdir); err != nil { |
|
|
|
if err := build.ExtractArchive(gobundle, pkgdir); err != nil { |
|
|
|
log.Fatalf("Failed to extract builder Go sources: %v", err) |
|
|
|
log.Fatalf("Failed to extract builder Go sources: %v", err) |
|
|
@ -754,11 +756,14 @@ func doDebianSource(cmdline []string) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// downloadGoBootstrapSources downloads the Go source tarball that will be used
|
|
|
|
// downloadGoBootstrapSources downloads the Go source tarball(s) that will be used
|
|
|
|
// to bootstrap the builder Go.
|
|
|
|
// to bootstrap the builder Go.
|
|
|
|
func downloadGoBootstrapSources(cachedir string) string { |
|
|
|
func downloadGoBootstrapSources(cachedir string) []string { |
|
|
|
csdb := build.MustLoadChecksums("build/checksums.txt") |
|
|
|
csdb := build.MustLoadChecksums("build/checksums.txt") |
|
|
|
gobootVersion, err := build.Version(csdb, "ppa-builder") |
|
|
|
|
|
|
|
|
|
|
|
var bundles []string |
|
|
|
|
|
|
|
for _, booter := range []string{"ppa-builder-1", "ppa-builder-2"} { |
|
|
|
|
|
|
|
gobootVersion, err := build.Version(csdb, booter) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Fatal(err) |
|
|
|
log.Fatal(err) |
|
|
|
} |
|
|
|
} |
|
|
@ -768,7 +773,9 @@ func downloadGoBootstrapSources(cachedir string) string { |
|
|
|
if err := csdb.DownloadFile(url, dst); err != nil { |
|
|
|
if err := csdb.DownloadFile(url, dst); err != nil { |
|
|
|
log.Fatal(err) |
|
|
|
log.Fatal(err) |
|
|
|
} |
|
|
|
} |
|
|
|
return dst |
|
|
|
bundles = append(bundles, dst) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return bundles |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// downloadGoSources downloads the Go source tarball.
|
|
|
|
// downloadGoSources downloads the Go source tarball.
|
|
|
|