From 5a8ea165926cb0737ab03bc48c18dc5198ab5305 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 2 Jan 2020 15:05:27 -0800 Subject: libgo: update to Go1.14beta1 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297 --- libgo/misc/cgo/testplugin/overlaydir_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'libgo/misc/cgo/testplugin/overlaydir_test.go') diff --git a/libgo/misc/cgo/testplugin/overlaydir_test.go b/libgo/misc/cgo/testplugin/overlaydir_test.go index b68436a..e2c32d8 100644 --- a/libgo/misc/cgo/testplugin/overlaydir_test.go +++ b/libgo/misc/cgo/testplugin/overlaydir_test.go @@ -21,12 +21,9 @@ func overlayDir(dstRoot, srcRoot string) error { return err } - symBase, err := filepath.Rel(srcRoot, dstRoot) + srcRoot, err := filepath.Abs(srcRoot) if err != nil { - symBase, err = filepath.Abs(srcRoot) - if err != nil { - return err - } + return err } return filepath.Walk(srcRoot, func(srcPath string, info os.FileInfo, err error) error { @@ -52,11 +49,11 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.MkdirAll(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. - if err := os.Symlink(filepath.Join(symBase, suffix), dstPath); err == nil { + if err := os.Symlink(srcPath, dstPath); err == nil { return nil } -- cgit v1.1