From ecf65f3d0adfd90dd42d956515648e86b38b911b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 8 Jun 2021 08:11:43 +0200 Subject: [PATCH] Update golang.org/x/sys and remove OpenBSD workarounds The latest version of golang.org/x/sys contains AT_REMOVEDIR also on OpenBSD. --- go.mod | 2 +- go.sum | 4 ++-- remote/sync/files.go | 2 +- remote/sync/files_compat.go | 26 -------------------------- remote/sync/files_compat_openbsd.go | 26 -------------------------- 5 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 remote/sync/files_compat.go delete mode 100644 remote/sync/files_compat_openbsd.go diff --git a/go.mod b/go.mod index cdfcef5..d85dcad 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/google/go-cmp v0.5.5 github.com/ianbruene/go-difflib v1.2.0 - golang.org/x/sys v0.0.0-20210324051608-47abb6519492 // indirect + golang.org/x/sys v0.0.0-20210608053332-aa57babbf139 golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 3a8b414..5812c81 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/ianbruene/go-difflib v1.2.0 h1:iARmgaCq6nW5QptdoFm0PYAyNGix3xw/xRgEwphJSZw= github.com/ianbruene/go-difflib v1.2.0/go.mod h1:uJbrQ06VPxjRiRIrync+E6VcWFGW2dWqw2gvQp6HQPY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210608053332-aa57babbf139 h1:C+AwYEtBp/VQwoLntUmQ/yx3MS9vmZaKNdw5eOpoQe8= +golang.org/x/sys v0.0.0-20210608053332-aa57babbf139/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 h1:EC6+IGYTjPpRfv9a2b/6Puw0W+hLtAhkV1tPsXhutqs= golang.org/x/term v0.0.0-20210317153231-de623e64d2a6/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/remote/sync/files.go b/remote/sync/files.go index e110b52..2c8b704 100644 --- a/remote/sync/files.go +++ b/remote/sync/files.go @@ -324,7 +324,7 @@ reopen: err := unix.Unlinkat(parentFd, baseName, 0) if err != nil && !os.IsNotExist(err) { err2 := unix.Unlinkat(parentFd, baseName, - AT_REMOVEDIR) + unix.AT_REMOVEDIR) if err2 != nil && !os.IsNotExist(err2) { // See src/os/file_unix.go in Go's sources if err2 == unix.ENOTDIR { diff --git a/remote/sync/files_compat.go b/remote/sync/files_compat.go deleted file mode 100644 index b293148..0000000 --- a/remote/sync/files_compat.go +++ /dev/null @@ -1,26 +0,0 @@ -// MsgSyncReq: copy files to the remote host; compatibility - -// Copyright (C) 2021 Simon Ruderich -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// +build !openbsd,!windows - -package sync - -import ( - "golang.org/x/sys/unix" -) - -const AT_REMOVEDIR = unix.AT_REMOVEDIR diff --git a/remote/sync/files_compat_openbsd.go b/remote/sync/files_compat_openbsd.go deleted file mode 100644 index f684883..0000000 --- a/remote/sync/files_compat_openbsd.go +++ /dev/null @@ -1,26 +0,0 @@ -// MsgSyncReq: copy files to the remote host; OpenBSD compatibility - -// Copyright (C) 2021 Simon Ruderich -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// +build openbsd - -package sync - -// Currently not defined in golang.org/x/sys/unix, see also -// https://github.com/golang/go/issues/46342 -// -// From /usr/include/fcntl.h -const AT_REMOVEDIR = 0x08 -- 2.43.2