Merge pull request #1035 from Maryse47/master

Use BuildDir instead of cacheHome to store PKGBUILDS with -G
This commit is contained in:
J Guerreiro 2019-09-30 16:22:05 +01:00 committed by GitHub
commit 99d1df6f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,12 +299,12 @@ func getPkgbuildsfromABS(pkgs []string, path string) (bool, error) {
download := func(pkg string, url string) {
defer wg.Done()
if _, err := gitDownloadABS(url, cacheHome, pkg); err != nil {
if _, err := gitDownloadABS(url, config.BuildDir, pkg); err != nil {
errs.Add(fmt.Errorf("%s Failed to get pkgbuild: %s: %s", bold(red(arrow)), bold(cyan(pkg)), bold(red(err.Error()))))
return
}
_, stderr, err := capture(exec.Command("ln", "-s", filepath.Join(cacheHome, pkg, "trunk"), filepath.Join(path, pkg)))
_, stderr, err := capture(exec.Command("ln", "-s", filepath.Join(config.BuildDir, pkg, "trunk"), filepath.Join(path, pkg)))
mux.Lock()
downloaded++
if err != nil {
@ -326,6 +326,6 @@ func getPkgbuildsfromABS(pkgs []string, path string) (bool, error) {
}
wg.Wait()
errs.Add(os.RemoveAll(filepath.Join(cacheHome, "packages")))
errs.Add(os.RemoveAll(filepath.Join(config.BuildDir, "packages")))
return len(missing) != 0, errs.Return()
}