commit: 712498410a2cbcec9b685e1282d408df60357b42
parent 105306af9914e130b99eeec27b6927ac0c8c66f7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 11 Jul 2024 02:36:52 +0200
dev-go/sys: Apply cl/597555
Diffstat:
3 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/dev-go/sys/Manifest b/dev-go/sys/Manifest
@@ -1 +1,2 @@
DIST sys-0.13.0.tar.gz 1442250 BLAKE2B 232a921d4a7f2dd9d2bae56959627b421787c2257e7cbaa2a1576d7303baa255350e02fcbc70b39b0d66ec11b3481e357d7b163a12e0997eab5768b67708d645 SHA512 1697317c8bc48dae90ac65854937f4b203963689f1c473c2e6de4a39fe97ecaff0fecedbf661db5fcd4f93df3f2037b1638b1f7d7004f021123af1d5808df86a
+DIST sys-0.22.0.tar.gz 1498230 BLAKE2B 7817ac6abc782f22f8eb7382239e1cbd6dbd22c1b3fb73882b9b7663374d1f469328c6edd33a65046de83e70de45e0fb598a212f9ea4b7c37b112a3f915a4e33 SHA512 fa90b75f007d264357ca32e58ddf803183c81be2f4f340bf637eb6870c2d0ad3d726f73a0b9bdc9fbad5fb1e385a122442c19eed667db7faa6a055f9bdb3cdcd
diff --git a/dev-go/sys/files/sys-0.22.0-fileDedupeRange-EOPNOTSUPP.patch b/dev-go/sys/files/sys-0.22.0-fileDedupeRange-EOPNOTSUPP.patch
@@ -0,0 +1,32 @@
+From c5324d88c77ca2f40606149209558a06475e9d98 Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Wed, 10 Jul 2024 10:50:10 -0700
+Subject: [PATCH] unix: skip TestIoctlFileDedupeRange on EOPNOTSUPP error
+
+Fixes golang/go#68372
+
+Change-Id: Id3b8fb920b1458e39e7370195591183ee7e450ff
+---
+
+diff --git a/unix/syscall_linux_test.go b/unix/syscall_linux_test.go
+index 69c42b5..53e6445 100644
+--- a/sys-0.22.0/unix/syscall_linux_test.go
++++ b/sys-0.22.0/unix/syscall_linux_test.go
+@@ -1087,7 +1087,7 @@
+ // The first Info should be equal
+ if dedupe.Info[0].Status < 0 {
+ errno := unix.Errno(-dedupe.Info[0].Status)
+- if errno == unix.EINVAL {
++ if errno == unix.EINVAL || errno == unix.EOPNOTSUPP {
+ t.Skip("deduplication not supported on this filesystem")
+ }
+ t.Errorf("Unexpected error in FileDedupeRange: %s", unix.ErrnoName(errno))
+@@ -1102,7 +1102,7 @@
+ // The second Info should be different
+ if dedupe.Info[1].Status < 0 {
+ errno := unix.Errno(-dedupe.Info[1].Status)
+- if errno == unix.EINVAL {
++ if errno == unix.EINVAL || errno == unix.EOPNOTSUPP {
+ t.Skip("deduplication not supported on this filesystem")
+ }
+ t.Errorf("Unexpected error in FileDedupeRange: %s", unix.ErrnoName(errno))
diff --git a/dev-go/sys/sys-0.22.0.ebuild b/dev-go/sys/sys-0.22.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 2023 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+EGO_PN="golang.org/x/sys"
+
+DESCRIPTION="supplemental Go packages for low-level interactions with the operating system"
+HOMEPAGE="https://golang.org/x/sys"
+SRC_URI="https://github.com/golang/sys/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-lang/go )"
+
+PATCHES=(
+ "${FILESDIR}/sys-0.22.0-fileDedupeRange-EOPNOTSUPP.patch"
+)
+
+src_prepare() {
+ default
+
+ mkdir -p "$(dirname "${WORKDIR}/src/${EGO_PN}")" || die
+ mv "${S}/${P}" "${WORKDIR}/src/${EGO_PN}" || die
+}
+
+src_test() {
+ # disable module-aware mode
+ export GO111MODULE=off
+
+ # With GO111MODULE=off WORKDIR needs to be included
+ export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
+
+ # `go test` doesn't recurses in directories by itself
+ go test "${EGO_PN}/cpu" "${EGO_PN}/execabs" "${EGO_PN}/unix" || die
+}
+
+src_install() {
+ mkdir -p "${ED}/usr/lib/go-gentoo/" || die
+ cp -r "${WORKDIR}/src" "${ED}/usr/lib/go-gentoo/src" || die
+ test -f "${ED}/usr/lib/go-gentoo/src/${EGO_PN}/go.mod" || die
+}