From 538df6361246324ff7e774cdaa51fa97b2da5edd Mon Sep 17 00:00:00 2001 From: Pauli Jokela Date: Wed, 16 Oct 2019 11:05:46 +0300 Subject: [PATCH] Dependency updates and slight progress in fixing Clover building --- cmd/root.go | 35 ++++--- go.mod | 4 +- go.sum | 2 + vendor/github.com/otiai10/copy/.gitignore | 3 - vendor/github.com/otiai10/copy/.travis.yml | 11 --- vendor/github.com/otiai10/copy/LICENSE | 21 ---- vendor/github.com/otiai10/copy/README.md | 14 --- vendor/github.com/otiai10/copy/copy.go | 106 --------------------- vendor/github.com/otiai10/copy/go.mod | 6 -- vendor/github.com/otiai10/copy/go.sum | 4 - vendor/modules.txt | 2 - 11 files changed, 20 insertions(+), 188 deletions(-) delete mode 100644 vendor/github.com/otiai10/copy/.gitignore delete mode 100644 vendor/github.com/otiai10/copy/.travis.yml delete mode 100644 vendor/github.com/otiai10/copy/LICENSE delete mode 100644 vendor/github.com/otiai10/copy/README.md delete mode 100644 vendor/github.com/otiai10/copy/copy.go delete mode 100644 vendor/github.com/otiai10/copy/go.mod delete mode 100644 vendor/github.com/otiai10/copy/go.sum diff --git a/cmd/root.go b/cmd/root.go index 6b7acae..c2cd8d4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -207,21 +207,18 @@ var rootCmd = &cobra.Command{ } if !UpdateOnly && !InstallerOnly { - // Override HOME environment variable (use chroot-like logic for the build process) - log.Debug("Overriding HOME..") + // Override environment variable + log.Debug("Setting up environment variables..") os.Setenv("HOME", util.GetClobberPath()) - - // Override TOOLCHAIR_DIR environment variable - log.Debug("Overriding TOOLCHAIN_DIR..") os.Setenv("TOOLCHAIN_DIR", util.GetSourcePath()+"/opt/local") - - // Override TOOLCHAIN environment variable - // log.Debug("Overriding TOOLCHAIN..") - // os.Setenv("TOOLCHAIN", "XCODE8") - - // Override TOOLCHAIN environment variable - // log.Debug("Overriding EDK_TOOLS_PATH..") - // os.Setenv("EDK_TOOLS_PATH", util.GetCloverPath()+"/BaseTools/BuildEnv") + os.Setenv("DIR_MAIN", util.GetSourcePath()) + os.Setenv("DIR_TOOLS", os.Getenv("DIR_MAIN")+"/tools") + os.Setenv("DIR_DOWNLOADS", os.Getenv("DIR_TOOLS")+"/download") + os.Setenv("DIR_LOGS", os.Getenv("DIR_TOOLS")+"/logs") + os.Setenv("PREFIX", os.Getenv("TOOLCHAIN_DIR")) + os.Setenv("EDK_TOOLS_PATH", util.GetCloverPath()+"/BaseTools") + os.Setenv("PATH", os.Getenv("PATH")+":"+util.GetCloverPath()+"/BaseTools/BinWrappers/PosixLike") + os.Setenv("GETTEXT_PREFIX", os.Getenv("TOOLCHAIN_DIR")) // Build base tools log.Debug("Building base tools..") @@ -237,12 +234,12 @@ var rootCmd = &cobra.Command{ Spinner.Prefix = formatSpinnerText("Building base tools", true) // Setup EDK - log.Debug("Setting up EDK..") - Spinner.Prefix = formatSpinnerText("Setting up EDK", false) - if err := runCommand("cd " + util.GetCloverPath() + " && " + "source edksetup.sh"); err != nil { - log.Fatal("Error: Failure detected, aborting") - } - Spinner.Prefix = formatSpinnerText("Setting up EDK", true) + // log.Debug("Setting up EDK..") + // Spinner.Prefix = formatSpinnerText("Setting up EDK", false) + // if err := runCommand("cd " + util.GetCloverPath() + " && " + "source edksetup.sh" + " && " + "printenv"); err != nil { + // log.Fatal("Error: Failure detected, aborting") + // } + // Spinner.Prefix = formatSpinnerText("Setting up EDK", true) // Build gettext, mtoc and nasm (if necessary) if _, err := os.Stat(util.GetSourcePath() + "/opt/local/bin/gettext"); os.IsNotExist(err) { diff --git a/go.mod b/go.mod index c60e405..8234f29 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/nwaples/rardecode v1.0.0 // indirect github.com/onsi/ginkgo v1.8.0 // indirect github.com/onsi/gomega v1.5.0 // indirect - github.com/otiai10/copy v1.0.1 + github.com/otiai10/copy v1.0.1 // indirect github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 // indirect github.com/pierrec/lz4 v2.2.6+incompatible // indirect github.com/rhysd/go-github-selfupdate v1.1.0 @@ -41,7 +41,7 @@ require ( golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect - golang.org/x/tools v0.0.0-20191014141550-5fa5b1782b2c // indirect + golang.org/x/tools v0.0.0-20191015211201-9c6d90b5a7d0 // indirect google.golang.org/appengine v1.6.2 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 diff --git a/go.sum b/go.sum index dd1c93f..32db793 100644 --- a/go.sum +++ b/go.sum @@ -233,6 +233,8 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191014141550-5fa5b1782b2c h1:PCDsQ/i3XTQEuyIMOOa9pgQZsQi3ETM+3at2Z02nBo4= golang.org/x/tools v0.0.0-20191014141550-5fa5b1782b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191015211201-9c6d90b5a7d0 h1:KPtnBRFVP7cXAlZnb0bT/gohhmrkpXkk8DP9eZ+Aius= +golang.org/x/tools v0.0.0-20191015211201-9c6d90b5a7d0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/vendor/github.com/otiai10/copy/.gitignore b/vendor/github.com/otiai10/copy/.gitignore deleted file mode 100644 index 5b5ae0a..0000000 --- a/vendor/github.com/otiai10/copy/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -testdata.copy -coverage.txt -vendor diff --git a/vendor/github.com/otiai10/copy/.travis.yml b/vendor/github.com/otiai10/copy/.travis.yml deleted file mode 100644 index 65f32d9..0000000 --- a/vendor/github.com/otiai10/copy/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: go -go: - - 1.9 - - tip -before_script: - - go get -t ./... -script: - - go test ./... -v - - go test -race -coverprofile=coverage.txt -covermode=atomic -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/otiai10/copy/LICENSE b/vendor/github.com/otiai10/copy/LICENSE deleted file mode 100644 index 1f0cc5d..0000000 --- a/vendor/github.com/otiai10/copy/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 otiai10 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/otiai10/copy/README.md b/vendor/github.com/otiai10/copy/README.md deleted file mode 100644 index f5729fa..0000000 --- a/vendor/github.com/otiai10/copy/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# copy - -[![Build Status](https://travis-ci.org/otiai10/copy.svg?branch=master)](https://travis-ci.org/otiai10/copy) -[![codecov](https://codecov.io/gh/otiai10/copy/branch/master/graph/badge.svg)](https://codecov.io/gh/otiai10/copy) -[![GoDoc](https://godoc.org/github.com/otiai10/copy?status.svg)](https://godoc.org/github.com/otiai10/copy) -[![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/copy)](https://goreportcard.com/report/github.com/otiai10/copy) - -`copy` copies directories recursively. - -Example: - -```go -err := Copy("your/directory", "your/directory.copy") -``` diff --git a/vendor/github.com/otiai10/copy/copy.go b/vendor/github.com/otiai10/copy/copy.go deleted file mode 100644 index 52afac4..0000000 --- a/vendor/github.com/otiai10/copy/copy.go +++ /dev/null @@ -1,106 +0,0 @@ -package copy - -import ( - "io" - "io/ioutil" - "os" - "path/filepath" -) - -const ( - // tmpPermissionForDirectory makes the destination directory writable, - // so that stuff can be copied recursively even if any original directory is NOT writable. - // See https://github.com/otiai10/copy/pull/9 for more information. - tmpPermissionForDirectory = os.FileMode(0755) -) - -// Copy copies src to dest, doesn't matter if src is a directory or a file -func Copy(src, dest string) error { - info, err := os.Lstat(src) - if err != nil { - return err - } - return copy(src, dest, info) -} - -// copy dispatches copy-funcs according to the mode. -// Because this "copy" could be called recursively, -// "info" MUST be given here, NOT nil. -func copy(src, dest string, info os.FileInfo) error { - if info.Mode()&os.ModeSymlink != 0 { - return lcopy(src, dest, info) - } - if info.IsDir() { - return dcopy(src, dest, info) - } - return fcopy(src, dest, info) -} - -// fcopy is for just a file, -// with considering existence of parent directory -// and file permission. -func fcopy(src, dest string, info os.FileInfo) error { - - if err := os.MkdirAll(filepath.Dir(dest), os.ModePerm); err != nil { - return err - } - - f, err := os.Create(dest) - if err != nil { - return err - } - defer f.Close() - - if err = os.Chmod(f.Name(), info.Mode()); err != nil { - return err - } - - s, err := os.Open(src) - if err != nil { - return err - } - defer s.Close() - - _, err = io.Copy(f, s) - return err -} - -// dcopy is for a directory, -// with scanning contents inside the directory -// and pass everything to "copy" recursively. -func dcopy(srcdir, destdir string, info os.FileInfo) error { - - originalMode := info.Mode() - - // Make dest dir with 0755 so that everything writable. - if err := os.MkdirAll(destdir, tmpPermissionForDirectory); err != nil { - return err - } - // Recover dir mode with original one. - defer os.Chmod(destdir, originalMode) - - contents, err := ioutil.ReadDir(srcdir) - if err != nil { - return err - } - - for _, content := range contents { - cs, cd := filepath.Join(srcdir, content.Name()), filepath.Join(destdir, content.Name()) - if err := copy(cs, cd, content); err != nil { - // If any error, exit immediately - return err - } - } - - return nil -} - -// lcopy is for a symlink, -// with just creating a new symlink by replicating src symlink. -func lcopy(src, dest string, info os.FileInfo) error { - src, err := os.Readlink(src) - if err != nil { - return err - } - return os.Symlink(src, dest) -} diff --git a/vendor/github.com/otiai10/copy/go.mod b/vendor/github.com/otiai10/copy/go.mod deleted file mode 100644 index a436c21..0000000 --- a/vendor/github.com/otiai10/copy/go.mod +++ /dev/null @@ -1,6 +0,0 @@ -module github.com/otiai10/copy - -require ( - bou.ke/monkey v1.0.1 // indirect - github.com/otiai10/mint v1.2.3 -) diff --git a/vendor/github.com/otiai10/copy/go.sum b/vendor/github.com/otiai10/copy/go.sum deleted file mode 100644 index 37b5672..0000000 --- a/vendor/github.com/otiai10/copy/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -bou.ke/monkey v1.0.1 h1:zEMLInw9xvNakzUUPjfS4Ds6jYPqCFx3m7bRmG5NH2U= -bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= -github.com/otiai10/mint v1.2.3 h1:PsrRBmrxR68kyNu6YlqYHbNlItc5vOkuS6LBEsNttVA= -github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= diff --git a/vendor/modules.txt b/vendor/modules.txt index 047b451..2afa020 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -69,8 +69,6 @@ github.com/mitchellh/go-homedir github.com/nsf/termbox-go # github.com/nwaples/rardecode v1.0.0 github.com/nwaples/rardecode -# github.com/otiai10/copy v1.0.1 -github.com/otiai10/copy # github.com/pierrec/lz4 v2.2.6+incompatible github.com/pierrec/lz4 github.com/pierrec/lz4/internal/xxh32