mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 11:51:14 +02:00
sys-apps/coreutils: Sync with Gentoo
It's from Gentoo commit d0560cacf244bf8622d071fd88c20e20527f29f7.
This commit is contained in:
parent
1cd4780a85
commit
4f9da548dd
@ -3,7 +3,5 @@ DIST coreutils-8.32.tar.xz 5547836 BLAKE2B 0ad99c176c19ec214fcfd0845523e5362f015
|
||||
DIST coreutils-9.0_p20220409-patches-01.tar.xz 6244 BLAKE2B 8ca9855680719660782931467ec70095c826e66b9850890b8cf456963f8114f63940707386b97c766172d01e55e17b7db2aa1c329208a873a76e2293b29f565f SHA512 4b43c25832122d241f33e6b4eff24bc1fa045b9ca5af45a49d22ecb1fa282986c4e4a045ef24c34b3d94fd9a2247247c42c344261e3f464d881969e6f3351d3f
|
||||
DIST coreutils-9.1.tar.xz 5712104 BLAKE2B f5654e4935535275615d44a56c071d1c0746af36cf4615fcc0a5a0d387af9c9023adac31f31a52e16b3d1105b9d4c0fb7ebff9b2862498849f867a866049dd6e SHA512 a6ee2c549140b189e8c1b35e119d4289ec27244ec0ed9da0ac55202f365a7e33778b1dc7c4e64d1669599ff81a8297fe4f5adbcc8a3a2f75c919a43cd4b9bdfa
|
||||
DIST coreutils-9.1.tar.xz.sig 833 BLAKE2B e9627a066f3c67596feaa8d43d5785076230f440bacea84d8b5736e51a22787c2d5df1f3e2cd8523d01fb7b468933d3c17fce3cb1fbefef322a0e0d820b81842 SHA512 9f0766531afd4faa3e2c337730f61db55605cf06729e9c61f644594883732c2e0b1ddb0005b492be309c53e6f45b8ff875398163a48699d52517ea49e9bdbc91
|
||||
DIST coreutils-9.2.tar.xz 5773008 BLAKE2B 026e01718d79dd95bf645088d395584cbd422bb318f414a6ad325aea5deeec7aecb63217c1ce8231e81dd3b6fee1c85c60616c57ef8e2e1d0b9d764fa5a68908 SHA512 7e3108fefba4ef995cc73c64ac5f4e09827a44649a97ddd624eb61d67ce82da5ed6dc8c0f79d3e269f5cdb7d43877a61ef5b93194dd905bec432a7e31f9f479c
|
||||
DIST coreutils-9.2.tar.xz.sig 833 BLAKE2B 225f6ea9d6c2a2b0e47093b6c10d648b8d847daf0733eeb779eb01cffde47f67b3328bdfb214298d669689f5de76f3c64384a6471dfc4ccc3a238bfc1943e654 SHA512 4219f3103d829841a11bf1fe42ae277a44347e555fbbaf48e5e87cce48deb96753cb6d25f2571b88685a164acb9f016ff7ea02346b799ce954599fa0124ef070
|
||||
DIST coreutils-9.3.tar.xz 5808696 BLAKE2B 11502cd2dbeef150d0d4cece2546bf6b835941b94456c258f6058338f0477f22e68e88934d075b08fe51ee4d1c0c50cb23d8084ac06a457d6e8975f01643b1cd SHA512 242271f212a6860bdc6c8d7e5c4f85ce66c1b48ef781aca9daa56e0fe7c2b7809ef72b4392120219fe5b687637c83ce89ceef8bb35f6274f43f8f968a6901694
|
||||
DIST coreutils-9.3.tar.xz.sig 833 BLAKE2B c45ae10ff706907ae65d31228e432f7d6f34acbdb733bf521437d9e2fc75828a59da9d432d894a1ed8b7341f7e15d0e8d4e816e209c799b75c14d0ec055bfdf2 SHA512 522a2072f8ef940228ccdd856a4041c3c16b98e309168ccf2066fe7c1013685ba6cdea8a7317dfa1f4507b37ca016ecedaf54438d4a5007927b0e1a8fd223eb5
|
||||
|
||||
@ -1,269 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Try to keep an eye on Fedora's packaging: https://src.fedoraproject.org/rpms/coreutils
|
||||
# The upstream coreutils maintainers also maintain the package in Fedora and may
|
||||
# backport fixes which we want to pick up.
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/coreutils.asc
|
||||
inherit flag-o-matic python-any-r1 toolchain-funcs verify-sig
|
||||
|
||||
MY_PATCH="${PN}-9.0_p20220409-patches-01"
|
||||
DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
|
||||
HOMEPAGE="https://www.gnu.org/software/coreutils/"
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/coreutils.git"
|
||||
inherit git-r3
|
||||
elif [[ ${PV} == *_p* ]] ; then
|
||||
# Note: could put this in devspace, but if it's gone, we don't want
|
||||
# it in tree anyway. It's just for testing.
|
||||
MY_SNAPSHOT="$(ver_cut 1-2).198-e68b1"
|
||||
SRC_URI="https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz -> ${P}.tar.xz"
|
||||
SRC_URI+=" verify-sig? ( https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz.sig -> ${P}.tar.xz.sig )"
|
||||
S="${WORKDIR}"/${PN}-${MY_SNAPSHOT}
|
||||
else
|
||||
SRC_URI="
|
||||
mirror://gnu/${PN}/${P}.tar.xz
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
|
||||
fi
|
||||
|
||||
SRC_URI+=" !vanilla? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCH}.tar.xz )"
|
||||
|
||||
LICENSE="GPL-3+"
|
||||
SLOT="0"
|
||||
IUSE="acl caps gmp hostname kill multicall nls +openssl selinux +split-usr static test vanilla xattr"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
LIB_DEPEND="
|
||||
acl? ( sys-apps/acl[static-libs] )
|
||||
caps? ( sys-libs/libcap )
|
||||
gmp? ( dev-libs/gmp:=[static-libs] )
|
||||
openssl? ( dev-libs/openssl:=[static-libs] )
|
||||
xattr? ( sys-apps/attr[static-libs] )
|
||||
"
|
||||
RDEPEND="
|
||||
!static? ( ${LIB_DEPEND//\[static-libs]} )
|
||||
selinux? ( sys-libs/libselinux )
|
||||
nls? ( virtual/libintl )
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
static? ( ${LIB_DEPEND} )
|
||||
"
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
dev-lang/perl
|
||||
test? (
|
||||
dev-lang/perl
|
||||
dev-perl/Expect
|
||||
dev-util/strace
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
verify-sig? ( sec-keys/openpgp-keys-coreutils )
|
||||
"
|
||||
RDEPEND+="
|
||||
hostname? ( !sys-apps/net-tools[hostname] )
|
||||
kill? (
|
||||
!sys-apps/util-linux[kill]
|
||||
!sys-process/procps[kill]
|
||||
)
|
||||
!app-misc/realpath
|
||||
!<sys-apps/util-linux-2.13
|
||||
!<sys-apps/sandbox-2.10-r4
|
||||
!sys-apps/stat
|
||||
!net-mail/base64
|
||||
!sys-apps/mktemp
|
||||
!<app-forensics/tct-1.18-r1
|
||||
!<net-fs/netatalk-2.0.3-r4"
|
||||
|
||||
pkg_setup() {
|
||||
if use test ; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
git-r3_src_unpack
|
||||
|
||||
cd "${S}" || die
|
||||
./bootstrap || die
|
||||
|
||||
sed -i -e "s:submodule-checks ?= no-submodule-changes public-submodule-commit:submodule-checks ?= no-submodule-changes:" gnulib/top/maint.mk || die
|
||||
elif use verify-sig ; then
|
||||
# Needed for downloaded patch (which is unsigned, which is fine)
|
||||
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
local PATCHES=(
|
||||
# Upstream patches
|
||||
"${FILESDIR}"/${P}-cksum-result-reporting.patch
|
||||
"${FILESDIR}"/${P}-cp-reflink-auto-fallback.patch
|
||||
)
|
||||
|
||||
if ! use vanilla && [[ -d "${WORKDIR}"/patch ]] ; then
|
||||
PATCHES+=( "${WORKDIR}"/patch )
|
||||
fi
|
||||
|
||||
default
|
||||
|
||||
# Since we've patched many .c files, the make process will try to
|
||||
# re-build the manpages by running `./bin --help`. When doing a
|
||||
# cross-compile, we can't do that since 'bin' isn't a native bin.
|
||||
#
|
||||
# Also, it's not like we changed the usage on any of these things,
|
||||
# so let's just update the timestamps and skip the help2man step.
|
||||
set -- man/*.x
|
||||
touch ${@/%x/1} || die
|
||||
|
||||
# Avoid perl dep for compiled in dircolors default (bug #348642)
|
||||
if ! has_version dev-lang/perl ; then
|
||||
touch src/dircolors.h || die
|
||||
touch ${@/%x/1} || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local myconf=(
|
||||
--with-packager="Gentoo"
|
||||
--with-packager-version="${PVR} (p${PATCH_VER:-0})"
|
||||
--with-packager-bug-reports="https://bugs.gentoo.org/"
|
||||
# kill/uptime - procps
|
||||
# groups/su - shadow
|
||||
# hostname - net-tools
|
||||
--enable-install-program="arch,$(usev hostname),$(usev kill)"
|
||||
--enable-no-install-program="groups,$(usev !hostname),$(usev !kill),su,uptime"
|
||||
--enable-largefile
|
||||
$(usex caps '' --disable-libcap)
|
||||
$(use_enable nls)
|
||||
$(use_enable acl)
|
||||
$(use_enable multicall single-binary)
|
||||
$(use_enable xattr)
|
||||
$(use_with gmp libgmp)
|
||||
$(use_with openssl)
|
||||
)
|
||||
|
||||
if use gmp ; then
|
||||
myconf+=( --with-libgmp-prefix="${ESYSROOT}"/usr )
|
||||
fi
|
||||
|
||||
if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
|
||||
# bug #311569
|
||||
export fu_cv_sys_stat_statfs2_bsize=yes
|
||||
# bug #416629
|
||||
export gl_cv_func_realpath_works=yes
|
||||
fi
|
||||
|
||||
# bug #409919
|
||||
export gl_cv_func_mknod_works=yes
|
||||
|
||||
if use static ; then
|
||||
append-ldflags -static
|
||||
# bug #321821
|
||||
sed -i '/elf_sys=yes/s:yes:no:' configure || die
|
||||
fi
|
||||
|
||||
if ! use selinux ; then
|
||||
# bug #301782
|
||||
export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no
|
||||
fi
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# Known to fail with FEATURES=usersandbox (bug #439574):
|
||||
# - tests/du/long-from-unreadable.sh} (bug #413621)
|
||||
# - tests/rm/deep-2.sh (bug #413621)
|
||||
# - tests/dd/no-allocate.sh (bug #629660)
|
||||
if has usersandbox ${FEATURES} ; then
|
||||
ewarn "You are emerging ${P} with 'usersandbox' enabled." \
|
||||
"Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
|
||||
fi
|
||||
|
||||
# Non-root tests will fail if the full path isn't
|
||||
# accessible to non-root users
|
||||
chmod -R go-w "${WORKDIR}" || die
|
||||
chmod a+rx "${WORKDIR}" || die
|
||||
|
||||
# coreutils tests like to do `mount` and such with temp dirs,
|
||||
# so make sure:
|
||||
# - /etc/mtab is writable (bug #265725)
|
||||
# - /dev/loop* can be mounted (bug #269758)
|
||||
mkdir -p "${T}"/mount-wrappers || die
|
||||
mkwrap() {
|
||||
local w ww
|
||||
for w in "${@}" ; do
|
||||
ww="${T}/mount-wrappers/${w}"
|
||||
cat <<-EOF > "${ww}"
|
||||
#!${EPREFIX}/bin/sh
|
||||
exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P ${w}) "\$@"
|
||||
EOF
|
||||
chmod a+rx "${ww}" || die
|
||||
done
|
||||
}
|
||||
mkwrap mount umount
|
||||
|
||||
addwrite /dev/full
|
||||
#export RUN_EXPENSIVE_TESTS="yes"
|
||||
#export FETISH_GROUPS="portage wheel"
|
||||
env PATH="${T}/mount-wrappers:${PATH}" gl_public_submodule_commit= \
|
||||
emake -k check VERBOSE=yes
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
insinto /etc
|
||||
newins src/dircolors.hin DIR_COLORS
|
||||
|
||||
if use split-usr ; then
|
||||
cd "${ED}"/usr/bin || die
|
||||
dodir /bin
|
||||
|
||||
# Move critical binaries into /bin (required by FHS)
|
||||
local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
|
||||
mkdir mknod mv pwd rm rmdir stty sync true uname"
|
||||
mv ${fhs} ../../bin/ || die "Could not move FHS bins!"
|
||||
|
||||
if use hostname ; then
|
||||
mv hostname ../../bin/ || die
|
||||
fi
|
||||
|
||||
if use kill ; then
|
||||
mv kill ../../bin/ || die
|
||||
fi
|
||||
|
||||
# Move critical binaries into /bin (common scripts)
|
||||
# (Why are these required for booting?)
|
||||
local com="basename chroot cut dir dirname du env expr head mkfifo
|
||||
mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
|
||||
mv ${com} ../../bin/ || die "Could not move common bins!"
|
||||
|
||||
# Create a symlink for uname in /usr/bin/ since autotools require it.
|
||||
# (Other than uname, we need to figure out why we are
|
||||
# creating symlinks for these in /usr/bin instead of leaving
|
||||
# the files there in the first place...)
|
||||
local x
|
||||
for x in ${com} uname ; do
|
||||
dosym ../../bin/${x} /usr/bin/${x}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
ewarn "Make sure you run 'hash -r' in your active shells."
|
||||
ewarn "You should also re-source your shell settings for LS_COLORS"
|
||||
ewarn " changes, such as: source /etc/profile"
|
||||
}
|
||||
@ -1,269 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Try to keep an eye on Fedora's packaging: https://src.fedoraproject.org/rpms/coreutils
|
||||
# The upstream coreutils maintainers also maintain the package in Fedora and may
|
||||
# backport fixes which we want to pick up.
|
||||
#
|
||||
# Also recommend subscribing to the coreutils and bug-coreutils MLs.
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/coreutils.asc
|
||||
inherit flag-o-matic python-any-r1 toolchain-funcs verify-sig
|
||||
|
||||
MY_PATCH="${PN}-9.0_p20220409-patches-01"
|
||||
DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
|
||||
HOMEPAGE="https://www.gnu.org/software/coreutils/"
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/coreutils.git"
|
||||
inherit git-r3
|
||||
elif [[ ${PV} == *_p* ]] ; then
|
||||
# Note: could put this in devspace, but if it's gone, we don't want
|
||||
# it in tree anyway. It's just for testing.
|
||||
MY_SNAPSHOT="$(ver_cut 1-2).18-ffd62"
|
||||
SRC_URI="https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz -> ${P}.tar.xz"
|
||||
SRC_URI+=" verify-sig? ( https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz.sig -> ${P}.tar.xz.sig )"
|
||||
S="${WORKDIR}"/${PN}-${MY_SNAPSHOT}
|
||||
else
|
||||
SRC_URI="
|
||||
mirror://gnu/${PN}/${P}.tar.xz
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
|
||||
KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~x86-linux"
|
||||
fi
|
||||
|
||||
SRC_URI+=" !vanilla? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCH}.tar.xz )"
|
||||
|
||||
LICENSE="GPL-3+"
|
||||
SLOT="0"
|
||||
IUSE="acl caps gmp hostname kill multicall nls +openssl selinux +split-usr static test vanilla xattr"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
LIB_DEPEND="
|
||||
acl? ( sys-apps/acl[static-libs] )
|
||||
caps? ( sys-libs/libcap )
|
||||
gmp? ( dev-libs/gmp:=[static-libs] )
|
||||
openssl? ( dev-libs/openssl:=[static-libs] )
|
||||
xattr? ( sys-apps/attr[static-libs] )
|
||||
"
|
||||
RDEPEND="
|
||||
!static? ( ${LIB_DEPEND//\[static-libs]} )
|
||||
selinux? ( sys-libs/libselinux )
|
||||
nls? ( virtual/libintl )
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
static? ( ${LIB_DEPEND} )
|
||||
"
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
dev-lang/perl
|
||||
test? (
|
||||
dev-lang/perl
|
||||
dev-perl/Expect
|
||||
dev-util/strace
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
verify-sig? ( sec-keys/openpgp-keys-coreutils )
|
||||
"
|
||||
RDEPEND+="
|
||||
hostname? ( !sys-apps/net-tools[hostname] )
|
||||
kill? (
|
||||
!sys-apps/util-linux[kill]
|
||||
!sys-process/procps[kill]
|
||||
)
|
||||
!app-misc/realpath
|
||||
!<sys-apps/util-linux-2.13
|
||||
!<sys-apps/sandbox-2.10-r4
|
||||
!sys-apps/stat
|
||||
!net-mail/base64
|
||||
!sys-apps/mktemp
|
||||
!<app-forensics/tct-1.18-r1
|
||||
!<net-fs/netatalk-2.0.3-r4"
|
||||
|
||||
pkg_setup() {
|
||||
if use test ; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
git-r3_src_unpack
|
||||
|
||||
cd "${S}" || die
|
||||
./bootstrap || die
|
||||
|
||||
sed -i -e "s:submodule-checks ?= no-submodule-changes public-submodule-commit:submodule-checks ?= no-submodule-changes:" gnulib/top/maint.mk || die
|
||||
elif use verify-sig ; then
|
||||
# Needed for downloaded patch (which is unsigned, which is fine)
|
||||
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
local PATCHES=(
|
||||
# Upstream patches
|
||||
"${FILESDIR}"/${P}-cp-parents-preserve-permissions.patch
|
||||
)
|
||||
|
||||
if ! use vanilla && [[ -d "${WORKDIR}"/patch ]] ; then
|
||||
PATCHES+=( "${WORKDIR}"/patch )
|
||||
fi
|
||||
|
||||
default
|
||||
|
||||
# Since we've patched many .c files, the make process will try to
|
||||
# re-build the manpages by running `./bin --help`. When doing a
|
||||
# cross-compile, we can't do that since 'bin' isn't a native bin.
|
||||
#
|
||||
# Also, it's not like we changed the usage on any of these things,
|
||||
# so let's just update the timestamps and skip the help2man step.
|
||||
set -- man/*.x
|
||||
touch ${@/%x/1} || die
|
||||
|
||||
# Avoid perl dep for compiled in dircolors default (bug #348642)
|
||||
if ! has_version dev-lang/perl ; then
|
||||
touch src/dircolors.h || die
|
||||
touch ${@/%x/1} || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local myconf=(
|
||||
--with-packager="Gentoo"
|
||||
--with-packager-version="${PVR} (p${PATCH_VER:-0})"
|
||||
--with-packager-bug-reports="https://bugs.gentoo.org/"
|
||||
# kill/uptime - procps
|
||||
# groups/su - shadow
|
||||
# hostname - net-tools
|
||||
--enable-install-program="arch,$(usev hostname),$(usev kill)"
|
||||
--enable-no-install-program="groups,$(usev !hostname),$(usev !kill),su,uptime"
|
||||
$(usex caps '' --disable-libcap)
|
||||
$(use_enable nls)
|
||||
$(use_enable acl)
|
||||
$(use_enable multicall single-binary)
|
||||
$(use_enable xattr)
|
||||
$(use_with gmp libgmp)
|
||||
$(use_with openssl)
|
||||
)
|
||||
|
||||
if use gmp ; then
|
||||
myconf+=( --with-libgmp-prefix="${ESYSROOT}"/usr )
|
||||
fi
|
||||
|
||||
if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
|
||||
# bug #311569
|
||||
export fu_cv_sys_stat_statfs2_bsize=yes
|
||||
# bug #416629
|
||||
export gl_cv_func_realpath_works=yes
|
||||
fi
|
||||
|
||||
# bug #409919
|
||||
export gl_cv_func_mknod_works=yes
|
||||
|
||||
if use static ; then
|
||||
append-ldflags -static
|
||||
# bug #321821
|
||||
sed -i '/elf_sys=yes/s:yes:no:' configure || die
|
||||
fi
|
||||
|
||||
if ! use selinux ; then
|
||||
# bug #301782
|
||||
export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no
|
||||
fi
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# Known to fail with FEATURES=usersandbox (bug #439574):
|
||||
# - tests/du/long-from-unreadable.sh} (bug #413621)
|
||||
# - tests/rm/deep-2.sh (bug #413621)
|
||||
# - tests/dd/no-allocate.sh (bug #629660)
|
||||
if has usersandbox ${FEATURES} ; then
|
||||
ewarn "You are emerging ${P} with 'usersandbox' enabled." \
|
||||
"Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
|
||||
fi
|
||||
|
||||
# Non-root tests will fail if the full path isn't
|
||||
# accessible to non-root users
|
||||
chmod -R go-w "${WORKDIR}" || die
|
||||
chmod a+rx "${WORKDIR}" || die
|
||||
|
||||
# coreutils tests like to do `mount` and such with temp dirs,
|
||||
# so make sure:
|
||||
# - /etc/mtab is writable (bug #265725)
|
||||
# - /dev/loop* can be mounted (bug #269758)
|
||||
mkdir -p "${T}"/mount-wrappers || die
|
||||
mkwrap() {
|
||||
local w ww
|
||||
for w in "${@}" ; do
|
||||
ww="${T}/mount-wrappers/${w}"
|
||||
cat <<-EOF > "${ww}"
|
||||
#!${EPREFIX}/bin/sh
|
||||
exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P ${w}) "\$@"
|
||||
EOF
|
||||
chmod a+rx "${ww}" || die
|
||||
done
|
||||
}
|
||||
mkwrap mount umount
|
||||
|
||||
addwrite /dev/full
|
||||
#export RUN_EXPENSIVE_TESTS="yes"
|
||||
#export FETISH_GROUPS="portage wheel"
|
||||
env PATH="${T}/mount-wrappers:${PATH}" gl_public_submodule_commit= \
|
||||
emake -k check VERBOSE=yes
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
insinto /etc
|
||||
newins src/dircolors.hin DIR_COLORS
|
||||
|
||||
if use split-usr ; then
|
||||
cd "${ED}"/usr/bin || die
|
||||
dodir /bin
|
||||
|
||||
# Move critical binaries into /bin (required by FHS)
|
||||
local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
|
||||
mkdir mknod mv pwd rm rmdir stty sync true uname"
|
||||
mv ${fhs} ../../bin/ || die "Could not move FHS bins!"
|
||||
|
||||
if use hostname ; then
|
||||
mv hostname ../../bin/ || die
|
||||
fi
|
||||
|
||||
if use kill ; then
|
||||
mv kill ../../bin/ || die
|
||||
fi
|
||||
|
||||
# Move critical binaries into /bin (common scripts)
|
||||
# (Why are these required for booting?)
|
||||
local com="basename chroot cut dir dirname du env expr head mkfifo
|
||||
mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
|
||||
mv ${com} ../../bin/ || die "Could not move common bins!"
|
||||
|
||||
# Create a symlink for uname in /usr/bin/ since autotools require it.
|
||||
# (Other than uname, we need to figure out why we are
|
||||
# creating symlinks for these in /usr/bin instead of leaving
|
||||
# the files there in the first place...)
|
||||
local x
|
||||
for x in ${com} uname ; do
|
||||
dosym ../../bin/${x} /usr/bin/${x}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
ewarn "Make sure you run 'hash -r' in your active shells."
|
||||
ewarn "You should also re-source your shell settings for LS_COLORS"
|
||||
ewarn " changes, such as: source /etc/profile"
|
||||
}
|
||||
@ -33,7 +33,7 @@ else
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~x86-linux"
|
||||
fi
|
||||
|
||||
SRC_URI+=" !vanilla? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCH}.tar.xz )"
|
||||
|
||||
@ -1,266 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Try to keep an eye on Fedora's packaging: https://src.fedoraproject.org/rpms/coreutils
|
||||
# The upstream coreutils maintainers also maintain the package in Fedora and may
|
||||
# backport fixes which we want to pick up.
|
||||
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/coreutils.asc
|
||||
inherit flag-o-matic python-any-r1 toolchain-funcs verify-sig
|
||||
|
||||
MY_PATCH="${PN}-9.0_p20220409-patches-01"
|
||||
DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
|
||||
HOMEPAGE="https://www.gnu.org/software/coreutils/"
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://git.savannah.gnu.org/git/coreutils.git"
|
||||
inherit git-r3
|
||||
elif [[ ${PV} == *_p* ]] ; then
|
||||
# Note: could put this in devspace, but if it's gone, we don't want
|
||||
# it in tree anyway. It's just for testing.
|
||||
MY_SNAPSHOT="$(ver_cut 1-2).18-ffd62"
|
||||
SRC_URI="https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz -> ${P}.tar.xz"
|
||||
SRC_URI+=" verify-sig? ( https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz.sig -> ${P}.tar.xz.sig )"
|
||||
S="${WORKDIR}"/${PN}-${MY_SNAPSHOT}
|
||||
else
|
||||
SRC_URI="
|
||||
mirror://gnu/${PN}/${P}.tar.xz
|
||||
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
|
||||
"
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
|
||||
fi
|
||||
|
||||
SRC_URI+=" !vanilla? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCH}.tar.xz )"
|
||||
|
||||
LICENSE="GPL-3+"
|
||||
SLOT="0"
|
||||
IUSE="acl caps gmp hostname kill multicall nls +openssl selinux +split-usr static test vanilla xattr"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
LIB_DEPEND="
|
||||
acl? ( sys-apps/acl[static-libs] )
|
||||
caps? ( sys-libs/libcap )
|
||||
gmp? ( dev-libs/gmp:=[static-libs] )
|
||||
openssl? ( dev-libs/openssl:=[static-libs] )
|
||||
xattr? ( sys-apps/attr[static-libs] )
|
||||
"
|
||||
RDEPEND="
|
||||
!static? ( ${LIB_DEPEND//\[static-libs]} )
|
||||
selinux? ( sys-libs/libselinux )
|
||||
nls? ( virtual/libintl )
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
static? ( ${LIB_DEPEND} )
|
||||
"
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
dev-lang/perl
|
||||
test? (
|
||||
dev-lang/perl
|
||||
dev-perl/Expect
|
||||
dev-util/strace
|
||||
${PYTHON_DEPS}
|
||||
)
|
||||
verify-sig? ( sec-keys/openpgp-keys-coreutils )
|
||||
"
|
||||
RDEPEND+="
|
||||
hostname? ( !sys-apps/net-tools[hostname] )
|
||||
kill? (
|
||||
!sys-apps/util-linux[kill]
|
||||
!sys-process/procps[kill]
|
||||
)
|
||||
!app-misc/realpath
|
||||
!<sys-apps/util-linux-2.13
|
||||
!<sys-apps/sandbox-2.10-r4
|
||||
!sys-apps/stat
|
||||
!net-mail/base64
|
||||
!sys-apps/mktemp
|
||||
!<app-forensics/tct-1.18-r1
|
||||
!<net-fs/netatalk-2.0.3-r4"
|
||||
|
||||
pkg_setup() {
|
||||
if use test ; then
|
||||
python-any-r1_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
git-r3_src_unpack
|
||||
|
||||
cd "${S}" || die
|
||||
./bootstrap || die
|
||||
|
||||
sed -i -e "s:submodule-checks ?= no-submodule-changes public-submodule-commit:submodule-checks ?= no-submodule-changes:" gnulib/top/maint.mk || die
|
||||
elif use verify-sig ; then
|
||||
# Needed for downloaded patch (which is unsigned, which is fine)
|
||||
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
local PATCHES=(
|
||||
# Upstream patches
|
||||
)
|
||||
|
||||
if ! use vanilla && [[ -d "${WORKDIR}"/patch ]] ; then
|
||||
PATCHES+=( "${WORKDIR}"/patch )
|
||||
fi
|
||||
|
||||
default
|
||||
|
||||
# Since we've patched many .c files, the make process will try to
|
||||
# re-build the manpages by running `./bin --help`. When doing a
|
||||
# cross-compile, we can't do that since 'bin' isn't a native bin.
|
||||
#
|
||||
# Also, it's not like we changed the usage on any of these things,
|
||||
# so let's just update the timestamps and skip the help2man step.
|
||||
set -- man/*.x
|
||||
touch ${@/%x/1} || die
|
||||
|
||||
# Avoid perl dep for compiled in dircolors default (bug #348642)
|
||||
if ! has_version dev-lang/perl ; then
|
||||
touch src/dircolors.h || die
|
||||
touch ${@/%x/1} || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local myconf=(
|
||||
--with-packager="Gentoo"
|
||||
--with-packager-version="${PVR} (p${PATCH_VER:-0})"
|
||||
--with-packager-bug-reports="https://bugs.gentoo.org/"
|
||||
# kill/uptime - procps
|
||||
# groups/su - shadow
|
||||
# hostname - net-tools
|
||||
--enable-install-program="arch,$(usev hostname),$(usev kill)"
|
||||
--enable-no-install-program="groups,$(usev !hostname),$(usev !kill),su,uptime"
|
||||
$(usex caps '' --disable-libcap)
|
||||
$(use_enable nls)
|
||||
$(use_enable acl)
|
||||
$(use_enable multicall single-binary)
|
||||
$(use_enable xattr)
|
||||
$(use_with gmp libgmp)
|
||||
$(use_with openssl)
|
||||
)
|
||||
|
||||
if use gmp ; then
|
||||
myconf+=( --with-libgmp-prefix="${ESYSROOT}"/usr )
|
||||
fi
|
||||
|
||||
if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
|
||||
# bug #311569
|
||||
export fu_cv_sys_stat_statfs2_bsize=yes
|
||||
# bug #416629
|
||||
export gl_cv_func_realpath_works=yes
|
||||
fi
|
||||
|
||||
# bug #409919
|
||||
export gl_cv_func_mknod_works=yes
|
||||
|
||||
if use static ; then
|
||||
append-ldflags -static
|
||||
# bug #321821
|
||||
sed -i '/elf_sys=yes/s:yes:no:' configure || die
|
||||
fi
|
||||
|
||||
if ! use selinux ; then
|
||||
# bug #301782
|
||||
export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no
|
||||
fi
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
# Known to fail with FEATURES=usersandbox (bug #439574):
|
||||
# - tests/du/long-from-unreadable.sh} (bug #413621)
|
||||
# - tests/rm/deep-2.sh (bug #413621)
|
||||
# - tests/dd/no-allocate.sh (bug #629660)
|
||||
if has usersandbox ${FEATURES} ; then
|
||||
ewarn "You are emerging ${P} with 'usersandbox' enabled." \
|
||||
"Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
|
||||
fi
|
||||
|
||||
# Non-root tests will fail if the full path isn't
|
||||
# accessible to non-root users
|
||||
chmod -R go-w "${WORKDIR}" || die
|
||||
chmod a+rx "${WORKDIR}" || die
|
||||
|
||||
# coreutils tests like to do `mount` and such with temp dirs,
|
||||
# so make sure:
|
||||
# - /etc/mtab is writable (bug #265725)
|
||||
# - /dev/loop* can be mounted (bug #269758)
|
||||
mkdir -p "${T}"/mount-wrappers || die
|
||||
mkwrap() {
|
||||
local w ww
|
||||
for w in "${@}" ; do
|
||||
ww="${T}/mount-wrappers/${w}"
|
||||
cat <<-EOF > "${ww}"
|
||||
#!${EPREFIX}/bin/sh
|
||||
exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P ${w}) "\$@"
|
||||
EOF
|
||||
chmod a+rx "${ww}" || die
|
||||
done
|
||||
}
|
||||
mkwrap mount umount
|
||||
|
||||
addwrite /dev/full
|
||||
#export RUN_EXPENSIVE_TESTS="yes"
|
||||
#export FETISH_GROUPS="portage wheel"
|
||||
env PATH="${T}/mount-wrappers:${PATH}" gl_public_submodule_commit= \
|
||||
emake -k check VERBOSE=yes
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
insinto /etc
|
||||
newins src/dircolors.hin DIR_COLORS
|
||||
|
||||
if use split-usr ; then
|
||||
cd "${ED}"/usr/bin || die
|
||||
dodir /bin
|
||||
|
||||
# Move critical binaries into /bin (required by FHS)
|
||||
local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
|
||||
mkdir mknod mv pwd rm rmdir stty sync true uname"
|
||||
mv ${fhs} ../../bin/ || die "Could not move FHS bins!"
|
||||
|
||||
if use hostname ; then
|
||||
mv hostname ../../bin/ || die
|
||||
fi
|
||||
|
||||
if use kill ; then
|
||||
mv kill ../../bin/ || die
|
||||
fi
|
||||
|
||||
# Move critical binaries into /bin (common scripts)
|
||||
# (Why are these required for booting?)
|
||||
local com="basename chroot cut dir dirname du env expr head mkfifo
|
||||
mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
|
||||
mv ${com} ../../bin/ || die "Could not move common bins!"
|
||||
|
||||
# Create a symlink for uname in /usr/bin/ since autotools require it.
|
||||
# (Other than uname, we need to figure out why we are
|
||||
# creating symlinks for these in /usr/bin instead of leaving
|
||||
# the files there in the first place...)
|
||||
local x
|
||||
for x in ${com} uname ; do
|
||||
dosym ../../bin/${x} /usr/bin/${x}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
ewarn "Make sure you run 'hash -r' in your active shells."
|
||||
ewarn "You should also re-source your shell settings for LS_COLORS"
|
||||
ewarn " changes, such as: source /etc/profile"
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
https://www.reddit.com/r/archlinux/comments/11zdecf/sha256sum_c_prints_ok_for_a_failed_checksum_when/
|
||||
https://bugs.archlinux.org/task/77969
|
||||
https://bugs.gnu.org/62403
|
||||
|
||||
https://github.com/coreutils/coreutils/commit/76f2fb627118a26c25003dbd98c22c153b7ee1d2
|
||||
|
||||
From 76f2fb627118a26c25003dbd98c22c153b7ee1d2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
|
||||
Date: Thu, 23 Mar 2023 12:31:24 +0000
|
||||
Subject: [PATCH] cksum: fix reporting of failed checks
|
||||
|
||||
This applies to all checksumming utilities,
|
||||
where we incorrectly report all subsequent files as checking 'OK'
|
||||
once any file has passed a digest check.
|
||||
The exit status was not impacted, only the printed status.
|
||||
|
||||
* src/digest.c (digest_check): Use the correct state variable
|
||||
to determine if the _current_ file has passed or not.
|
||||
* tests/misc/md5sum.pl: Add a test case.
|
||||
Fixes https://bugs.gnu.org/62403
|
||||
--- a/src/digest.c
|
||||
+++ b/src/digest.c
|
||||
@@ -1254,14 +1254,14 @@ digest_check (char const *checkfile_name)
|
||||
|
||||
if (!status_only)
|
||||
{
|
||||
- if ( ! matched_checksums || ! quiet)
|
||||
+ if (! match || ! quiet)
|
||||
{
|
||||
if (needs_escape)
|
||||
putchar ('\\');
|
||||
print_filename (filename, needs_escape);
|
||||
}
|
||||
|
||||
- if ( ! matched_checksums)
|
||||
+ if (! match)
|
||||
printf (": %s\n", _("FAILED"));
|
||||
else if (!quiet)
|
||||
printf (": %s\n", _("OK"));
|
||||
--- a/tests/misc/md5sum.pl
|
||||
+++ b/tests/misc/md5sum.pl
|
||||
@@ -101,6 +101,16 @@
|
||||
. "md5sum: WARNING: 1 line is improperly formatted\n"
|
||||
. "md5sum: WARNING: 2 computed checksums did NOT match\n"},
|
||||
{EXIT=> 1}],
|
||||
+ # Ensure we use appropriate state to track failures (broken in 9.2)
|
||||
+ ['check-multifail-state', '--check', '--warn',
|
||||
+ {IN=>{'f.md5' =>
|
||||
+ "$degenerate f\n"
|
||||
+ . "$degenerate g\n"
|
||||
+ . "$degenerate f\n" }},
|
||||
+ {AUX=> {f=> ''}}, {AUX=> {g=> 'a'}},
|
||||
+ {OUT=>"f: OK\ng: FAILED\nf: OK\n"},
|
||||
+ {ERR=>"md5sum: WARNING: 1 computed checksum did NOT match\n"},
|
||||
+ {EXIT=> 1}],
|
||||
# The sha1sum and md5sum drivers share a lot of code.
|
||||
# Ensure that md5sum does *not* share the part that makes
|
||||
# sha1sum accept BSD format.
|
||||
|
||||
@ -1,130 +0,0 @@
|
||||
https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=093a8b4bfaba60005f14493ce7ef11ed665a0176
|
||||
|
||||
From 093a8b4bfaba60005f14493ce7ef11ed665a0176 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
|
||||
Date: Thu, 23 Mar 2023 13:19:04 +0000
|
||||
Subject: copy: fix --reflink=auto to fallback in more cases
|
||||
|
||||
On restricted systems like android or some containers,
|
||||
FICLONE could return EPERM, EACCES, or ENOTTY,
|
||||
which would have induced the command to fail to copy
|
||||
rather than falling back to a more standard copy.
|
||||
|
||||
* src/copy.c (is_terminal_failure): A new function refactored
|
||||
from handle_clone_fail().
|
||||
(is_CLONENOTSUP): Merge in the handling of EACCES, ENOTTY, EPERM
|
||||
as they also pertain to determination of whether cloning is supported
|
||||
if we ever use this function in that context.
|
||||
(handle_clone_fail): Use is_terminal_failure() in all cases,
|
||||
so that we assume a terminal failure in less errno cases.
|
||||
* NEWS: Mention the bug fix.
|
||||
Addresses https://bugs.gnu.org/62404
|
||||
--- a/src/copy.c
|
||||
+++ b/src/copy.c
|
||||
@@ -278,15 +278,27 @@ create_hole (int fd, char const *name, bool punch_holes, off_t size)
|
||||
}
|
||||
|
||||
|
||||
-/* Whether the errno from FICLONE, or copy_file_range
|
||||
- indicates operation is not supported for this file or file system. */
|
||||
+/* Whether the errno indicates the operation is a transient failure.
|
||||
+ I.e., a failure that would indicate the operation _is_ supported,
|
||||
+ but has failed in a terminal way. */
|
||||
+
|
||||
+static bool
|
||||
+is_terminal_error (int err)
|
||||
+{
|
||||
+ return err == EIO || err == ENOMEM || err == ENOSPC || err == EDQUOT;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* Whether the errno from FICLONE, or copy_file_range indicates
|
||||
+ the operation is not supported/allowed for this file or process. */
|
||||
|
||||
static bool
|
||||
is_CLONENOTSUP (int err)
|
||||
{
|
||||
- return err == ENOSYS || is_ENOTSUP (err)
|
||||
+ return err == ENOSYS || err == ENOTTY || is_ENOTSUP (err)
|
||||
|| err == EINVAL || err == EBADF
|
||||
- || err == EXDEV || err == ETXTBSY;
|
||||
+ || err == EXDEV || err == ETXTBSY
|
||||
+ || err == EPERM || err == EACCES;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,20 +351,18 @@ sparse_copy (int src_fd, int dest_fd, char **abuf, size_t buf_size,
|
||||
{
|
||||
copy_debug.offload = COPY_DEBUG_UNSUPPORTED;
|
||||
|
||||
- if (is_CLONENOTSUP (errno))
|
||||
- break;
|
||||
-
|
||||
- /* copy_file_range might not be enabled in seccomp filters,
|
||||
- so retry with a standard copy. EPERM can also occur
|
||||
- for immutable files, but that would only be in the edge case
|
||||
- where the file is made immutable after creating/truncating,
|
||||
+ /* Consider operation unsupported only if no data copied.
|
||||
+ For example, EPERM could occur if copy_file_range not enabled
|
||||
+ in seccomp filters, so retry with a standard copy. EPERM can
|
||||
+ also occur for immutable files, but that would only be in the
|
||||
+ edge case where the file is made immutable after creating,
|
||||
in which case the (more accurate) error is still shown. */
|
||||
- if (errno == EPERM && *total_n_read == 0)
|
||||
+ if (*total_n_read == 0 && is_CLONENOTSUP (errno))
|
||||
break;
|
||||
|
||||
/* ENOENT was seen sometimes across CIFS shares, resulting in
|
||||
no data being copied, but subsequent standard copies succeed. */
|
||||
- if (errno == ENOENT && *total_n_read == 0)
|
||||
+ if (*total_n_read == 0 && errno == ENOENT)
|
||||
break;
|
||||
|
||||
if (errno == EINTR)
|
||||
@@ -1172,17 +1182,15 @@ handle_clone_fail (int dst_dirfd, char const* dst_relname,
|
||||
char const* src_name, char const* dst_name,
|
||||
int dest_desc, bool new_dst, enum Reflink_type reflink_mode)
|
||||
{
|
||||
- /* If the clone operation is creating the destination,
|
||||
- then don't try and cater for all non transient file system errors,
|
||||
- and instead only cater for specific transient errors. */
|
||||
- bool transient_failure;
|
||||
- if (dest_desc < 0) /* currently for fclonefileat(). */
|
||||
- transient_failure = errno == EIO || errno == ENOMEM
|
||||
- || errno == ENOSPC || errno == EDQUOT;
|
||||
- else /* currently for FICLONE. */
|
||||
- transient_failure = ! is_CLONENOTSUP (errno);
|
||||
-
|
||||
- if (reflink_mode == REFLINK_ALWAYS || transient_failure)
|
||||
+ /* When the clone operation fails, report failure only with errno values
|
||||
+ known to mean trouble when the clone is supported and called properly.
|
||||
+ Do not report failure merely because !is_CLONENOTSUP (errno),
|
||||
+ as systems may yield oddball errno values here with FICLONE.
|
||||
+ Also is_CLONENOTSUP() is not appropriate for the range of errnos
|
||||
+ possible from fclonefileat(), so it's more consistent to avoid. */
|
||||
+ bool report_failure = is_terminal_error (errno);
|
||||
+
|
||||
+ if (reflink_mode == REFLINK_ALWAYS || report_failure)
|
||||
error (0, errno, _("failed to clone %s from %s"),
|
||||
quoteaf_n (0, dst_name), quoteaf_n (1, src_name));
|
||||
|
||||
@@ -1190,14 +1198,14 @@ handle_clone_fail (int dst_dirfd, char const* dst_relname,
|
||||
but cloned no data. */
|
||||
if (new_dst /* currently not for fclonefileat(). */
|
||||
&& reflink_mode == REFLINK_ALWAYS
|
||||
- && ((! transient_failure) || lseek (dest_desc, 0, SEEK_END) == 0)
|
||||
+ && ((! report_failure) || lseek (dest_desc, 0, SEEK_END) == 0)
|
||||
&& unlinkat (dst_dirfd, dst_relname, 0) != 0 && errno != ENOENT)
|
||||
error (0, errno, _("cannot remove %s"), quoteaf (dst_name));
|
||||
|
||||
- if (! transient_failure)
|
||||
+ if (! report_failure)
|
||||
copy_debug.reflink = COPY_DEBUG_UNSUPPORTED;
|
||||
|
||||
- if (reflink_mode == REFLINK_ALWAYS || transient_failure)
|
||||
+ if (reflink_mode == REFLINK_ALWAYS || report_failure)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
--
|
||||
cgit v1.1
|
||||
Loading…
x
Reference in New Issue
Block a user