From f372ddb776265c7e8c6e134763f6d9fd81b5a756 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Sat, 2 May 2020 21:53:52 +0200 Subject: coreutils: update to 8.32 License-Update: copyright years, http changed to https (From OE-Core rev: 6e1052d401da5a9fa7f535786d76e033a39bc30a) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...tore-8.31-behavior-on-removed-directories.patch | 99 +++++++++++ .../coreutils/coreutils/fix-selinux-flask.patch | 13 +- .../coreutils/remove-usr-local-lib-from-m4.patch | 23 ++- .../coreutils/strtod_fix_clash_with_strtold.patch | 56 ------ meta/recipes-core/coreutils/coreutils_8.31.bb | 190 --------------------- meta/recipes-core/coreutils/coreutils_8.32.bb | 190 +++++++++++++++++++++ 6 files changed, 311 insertions(+), 260 deletions(-) create mode 100644 meta/recipes-core/coreutils/coreutils/0001-ls-restore-8.31-behavior-on-removed-directories.patch delete mode 100644 meta/recipes-core/coreutils/coreutils/strtod_fix_clash_with_strtold.patch delete mode 100644 meta/recipes-core/coreutils/coreutils_8.31.bb create mode 100644 meta/recipes-core/coreutils/coreutils_8.32.bb diff --git a/meta/recipes-core/coreutils/coreutils/0001-ls-restore-8.31-behavior-on-removed-directories.patch b/meta/recipes-core/coreutils/coreutils/0001-ls-restore-8.31-behavior-on-removed-directories.patch new file mode 100644 index 0000000000..fa900e3a76 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils/0001-ls-restore-8.31-behavior-on-removed-directories.patch @@ -0,0 +1,99 @@ +From 7c273e5c6041f8c70f73f5b280fbb8f27d9b5a36 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 5 Mar 2020 17:25:29 -0800 +Subject: [PATCH] ls: restore 8.31 behavior on removed directories + +* NEWS: Mention this. +* src/ls.c: Do not include +(print_dir): Don't worry about whether the directory is removed. +* tests/ls/removed-directory.sh: Adjust to match new (i.e., old) +behavior. + +Upstream-Status: Backport [https://github.com/coreutils/coreutils/commit/10fcb97bd728f09d4a027eddf8ad2900f0819b0a] +Signed-off-by: Alexander Kanavin +--- + src/ls.c | 22 ---------------------- + tests/ls/removed-directory.sh | 10 ++-------- + 2 files changed, 2 insertions(+), 30 deletions(-) + +diff --git a/src/ls.c b/src/ls.c +index 637fe7a..0111f49 100644 +--- a/src/ls.c ++++ b/src/ls.c +@@ -49,10 +49,6 @@ + # include + #endif + +-#ifdef __linux__ +-# include +-#endif +- + #include + #include + #include +@@ -2895,7 +2891,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + struct dirent *next; + uintmax_t total_blocks = 0; + static bool first = true; +- bool found_any_entries = false; + + errno = 0; + dirp = opendir (name); +@@ -2971,7 +2966,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + next = readdir (dirp); + if (next) + { +- found_any_entries = true; + if (! file_ignored (next->d_name)) + { + enum filetype type = unknown; +@@ -3017,22 +3011,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + if (errno != EOVERFLOW) + break; + } +-#ifdef __linux__ +- else if (! found_any_entries) +- { +- /* If readdir finds no directory entries at all, not even "." or +- "..", then double check that the directory exists. */ +- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1 +- && errno != EINVAL) +- { +- /* We exclude EINVAL as that pertains to buffer handling, +- and we've passed NULL as the buffer for simplicity. +- ENOENT is returned if appropriate before buffer handling. */ +- file_failure (command_line_arg, _("reading directory %s"), name); +- } +- break; +- } +-#endif + else + break; + +diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh +index e8c835d..fe8f929 100755 +--- a/tests/ls/removed-directory.sh ++++ b/tests/ls/removed-directory.sh +@@ -26,20 +26,14 @@ case $host_triplet in + *) skip_ 'non linux kernel' ;; + esac + +-LS_FAILURE=2 +- +-cat <<\EOF >exp-err || framework_failure_ +-ls: reading directory '.': No such file or directory +-EOF +- + cwd=$(pwd) + mkdir d || framework_failure_ + cd d || framework_failure_ + rmdir ../d || framework_failure_ + +-returns_ $LS_FAILURE ls >../out 2>../err || fail=1 ++ls >../out 2>../err || fail=1 + cd "$cwd" || framework_failure_ + compare /dev/null out || fail=1 +-compare exp-err err || fail=1 ++compare /dev/null err || fail=1 + + Exit $fail diff --git a/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch b/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch index 9d1ae55d47..173a57925b 100644 --- a/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch +++ b/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch @@ -1,4 +1,4 @@ -From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001 +From 7e20a7242ba2657f73311bbf5278093da67f0721 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 16 Sep 2014 01:59:08 -0700 Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to @@ -13,20 +13,20 @@ compilation terminated. Upstream-Status: Pending Signed-off-by: Robert Yang + --- - m4/gnulib-comp.m4 | 2 +- + m4/gnulib-comp.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 -index 472d3a0..5f09734 100644 +index dead90e..0abf0bd 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 -@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT], +@@ -1860,10 +1860,10 @@ AC_DEFUN([gl_INIT], AC_LIBOBJ([select]) fi gl_SYS_SELECT_MODULE_INDICATOR([select]) - AC_CHECK_HEADERS([selinux/flask.h]) - AC_LIBOBJ([selinux-at]) gl_HEADERS_SELINUX_SELINUX_H gl_HEADERS_SELINUX_CONTEXT_H if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then @@ -34,6 +34,3 @@ index 472d3a0..5f09734 100644 AC_LIBOBJ([getfilecon]) fi gl_SERVENT --- -1.7.9.5 - diff --git a/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch b/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch index 2ef8a548ac..1a8a9b9983 100644 --- a/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch +++ b/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch @@ -1,3 +1,8 @@ +From a26530083a29eeee910bfd606ecc621acecd547a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 3 Aug 2011 14:12:30 -0700 +Subject: [PATCH] coreutils: Fix build on uclibc + We have problem using hardcoded directories like /usr/local here which will be checked for cross builds. This is a special case which is valid for AIX only. We do not have AIX as one of our supported @@ -8,11 +13,15 @@ Signed-off-by: Khem Raj Upstream-Status: Inappropriate [Upstream does care for AIX while we may not] -Index: coreutils-8.14/m4/getloadavg.m4 -=================================================================== ---- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700 -+++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700 -@@ -41,16 +41,6 @@ +--- + m4/getloadavg.m4 | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 +index 8e96965..63782a2 100644 +--- a/m4/getloadavg.m4 ++++ b/m4/getloadavg.m4 +@@ -41,18 +41,6 @@ AC_CHECK_FUNC([getloadavg], [], [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes]) fi @@ -20,7 +29,9 @@ Index: coreutils-8.14/m4/getloadavg.m4 - # There is a commonly available library for RS/6000 AIX. - # Since it is not a standard part of AIX, it might be installed locally. - gl_getloadavg_LIBS=$LIBS -- LIBS="-L/usr/local/lib $LIBS" +- if test $cross_compiling != yes; then +- LIBS="-L/usr/local/lib $LIBS" +- fi - AC_CHECK_LIB([getloadavg], [getloadavg], - [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], - [LIBS=$gl_getloadavg_LIBS]) diff --git a/meta/recipes-core/coreutils/coreutils/strtod_fix_clash_with_strtold.patch b/meta/recipes-core/coreutils/coreutils/strtod_fix_clash_with_strtold.patch deleted file mode 100644 index 77770093cd..0000000000 --- a/meta/recipes-core/coreutils/coreutils/strtod_fix_clash_with_strtold.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0562b040fa17f1722ba2b3096067b45d0582ca53 Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Mon, 11 Mar 2019 16:40:29 -0700 -Subject: [PATCH] strtod: fix clash with strtold - -Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). -* lib/strtod.c (compute_minus_zero, minus_zero): -Simplify by remving the macro / external variable, -and having just a function. User changed. This avoids -the need for an external variable that might clash. - -Upstream-Status: Backport [rhel5] - -Signed-off-by: Oleksandr Kravchuk - ---- - ChangeLog | 9 +++++++++ - lib/strtod.c | 11 +++++------ - 2 files changed, 14 insertions(+), 6 deletions(-) - -diff --git a/lib/strtod.c b/lib/strtod.c -index b9eaa51b4..69b1564e1 100644 ---- a/lib/strtod.c -+++ b/lib/strtod.c -@@ -294,16 +294,15 @@ parse_number (const char *nptr, - ICC 10.0 has a bug when optimizing the expression -zero. - The expression -MIN * MIN does not work when cross-compiling - to PowerPC on Mac OS X 10.5. */ --#if defined __hpux || defined __sgi || defined __ICC - static DOUBLE --compute_minus_zero (void) -+minus_zero (void) - { -+#if defined __hpux || defined __sgi || defined __ICC - return -MIN * MIN; --} --# define minus_zero compute_minus_zero () - #else --DOUBLE minus_zero = -0.0; -+ return -0.0; - #endif -+} - - /* Convert NPTR to a DOUBLE. If ENDPTR is not NULL, a pointer to the - character after the last one used in the number is put in *ENDPTR. */ -@@ -479,6 +478,6 @@ STRTOD (const char *nptr, char **endptr) - /* Special case -0.0, since at least ICC miscompiles negation. We - can't use copysign(), as that drags in -lm on some platforms. */ - if (!num && negative) -- return minus_zero; -+ return minus_zero (); - return negative ? -num : num; - } --- -2.20.1 - diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb b/meta/recipes-core/coreutils/coreutils_8.31.bb deleted file mode 100644 index 2b196b7512..0000000000 --- a/meta/recipes-core/coreutils/coreutils_8.31.bb +++ /dev/null @@ -1,190 +0,0 @@ -SUMMARY = "The basic file, shell and text manipulation utilities" -DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ -manipulation utilities. These are the core utilities which are expected to exist on \ -every system." -HOMEPAGE = "http://www.gnu.org/software/coreutils/" -BUGTRACKER = "http://debbugs.gnu.org/coreutils" -LICENSE = "GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ - file://src/ls.c;beginline=1;endline=15;md5=c456f9896277a0543e3866777ccc0255" -DEPENDS = "gmp libcap" -DEPENDS_class-native = "" - -inherit autotools gettext texinfo - -SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ - file://remove-usr-local-lib-from-m4.patch \ - file://fix-selinux-flask.patch \ - file://0001-uname-report-processor-and-hardware-correctly.patch \ - file://disable-ls-output-quoting.patch \ - file://0001-local.mk-fix-cross-compiling-problem.patch \ - file://run-ptest \ - " - -SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch" - -SRC_URI[md5sum] = "0009a224d8e288e8ec406ef0161f9293" -SRC_URI[sha256sum] = "ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd" - -EXTRA_OECONF_class-native = "--without-gmp" -EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}" -EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname" - -# acl and xattr are not default features -# -PACKAGECONFIG_class-target ??= "\ - ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ -" - -# The lib/oe/path.py requires xattr -PACKAGECONFIG_class-native ??= "xattr" - -# with, without, depends, rdepends -# -PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," -PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," -PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,," - -# [ df mktemp nice printenv base64 gets a special treatment and is not included in this -bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \ - env expand expr factor fmt fold groups head hostid id install \ - join link logname md5sum mkfifo nl nohup nproc od paste pathchk \ - pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \ - sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \ - tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes" - -# hostname gets a special treatment and is not included in this -base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \ - mknod mv pwd rm rmdir sleep stty sync touch true uname stat" - -sbindir_progs= "chroot" - -PACKAGE_BEFORE_PN_class-target += "coreutils-stdbuf" -FILES_coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so" -RDEPENDS_coreutils_class-target += "coreutils-stdbuf" - -# Let aclocal use the relative path for the m4 file rather than the -# absolute since coreutils has a lot of m4 files, otherwise there might -# be an "Argument list too long" error when it is built in a long/deep -# directory. -acpaths = "-I ./m4" - -# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h -do_compile_prepend () { - mkdir -p ${B}/src -} - -do_install_class-native() { - autotools_do_install - # remove groups to fix conflict with shadow-native - rm -f ${D}${STAGING_BINDIR_NATIVE}/groups - # The return is a must since native doesn't need the - # do_install_append() in the below. - return -} - -do_install_append() { - for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done - - install -d ${D}${base_bindir} - [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done - - install -d ${D}${sbindir} - [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done - - # [ requires special handling because [.coreutils will cause the sed stuff - # in update-alternatives to fail, therefore use lbracket - the name used - # for the actual source file. - mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} -} - -inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" -# Make hostname's priority higher than busybox but lower than net-tools -ALTERNATIVE_PRIORITY[hostname] = "90" -ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df" -ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1" - -ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" - -ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" -ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" -ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" - -ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" -ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" -ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" - -ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" -ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" -ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" - -ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice" -ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}" -ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1" - -ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv" -ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}" - -ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" -ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" - -ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" -ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" -ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" -ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" - -python __anonymous() { - for prog in d.getVar('base_bindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) - - for prog in d.getVar('sbindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog)) -} - -BBCLASSEXTEND = "native nativesdk" - -inherit ptest - -RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl libmodule-build-perl make perl perl-module-file-stat python3-core sed shadow" - -# -dev automatic dependencies fails as we don't want libmodule-build-perl-dev, its too heavy -# may need tweaking if DEPENDS changes -RRECOMMENDS_coreutils-dev[nodeprrecs] = "1" -RRECOMMENDS_coreutils-dev = "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev" - -do_install_ptest () { - install -d ${D}${PTEST_PATH}/tests - cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests - sed -i 's/ginstall/install/g' `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq` - install -d ${D}${PTEST_PATH}/build-aux - install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ - cp ${B}/Makefile ${D}${PTEST_PATH}/ - cp ${S}/init.cfg ${D}${PTEST_PATH}/ - cp -r ${B}/src ${D}${PTEST_PATH}/ - cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src - sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile - sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile - sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile - sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile - sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile - sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile - sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile - chmod -R 777 ${D}${PTEST_PATH} - - # Disable subcase stty-pairs.sh, it will cause test framework hang - sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile - - # Disable subcase tail-2/assert.sh as it has issues on 32-bit systems - sed -i '/assert.sh/d' ${D}${PTEST_PATH}/Makefile - - # Tweak test d_type-check to use python3 instead of python - sed -i "1s@.*@#!/usr/bin/python3@" ${D}${PTEST_PATH}/tests/d_type-check - install ${B}/src/getlimits ${D}/${bindir} - - # handle multilib - sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest -} - -FILES_${PN}-ptest += "${bindir}/getlimits" diff --git a/meta/recipes-core/coreutils/coreutils_8.32.bb b/meta/recipes-core/coreutils/coreutils_8.32.bb new file mode 100644 index 0000000000..2422f8634e --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils_8.32.bb @@ -0,0 +1,190 @@ +SUMMARY = "The basic file, shell and text manipulation utilities" +DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ +manipulation utilities. These are the core utilities which are expected to exist on \ +every system." +HOMEPAGE = "http://www.gnu.org/software/coreutils/" +BUGTRACKER = "http://debbugs.gnu.org/coreutils" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ + file://src/ls.c;beginline=1;endline=15;md5=b7d80abf5b279320fb0e4b1007ed108b \ + " +DEPENDS = "gmp libcap" +DEPENDS_class-native = "" + +inherit autotools gettext texinfo + +SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ + file://remove-usr-local-lib-from-m4.patch \ + file://fix-selinux-flask.patch \ + file://0001-uname-report-processor-and-hardware-correctly.patch \ + file://disable-ls-output-quoting.patch \ + file://0001-local.mk-fix-cross-compiling-problem.patch \ + file://run-ptest \ + file://0001-ls-restore-8.31-behavior-on-removed-directories.patch \ + " + +SRC_URI[md5sum] = "022042695b7d5bcf1a93559a9735e668" +SRC_URI[sha256sum] = "4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa" + +EXTRA_OECONF_class-native = "--without-gmp" +EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}" +EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname" + +# acl and xattr are not default features +# +PACKAGECONFIG_class-target ??= "\ + ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ +" + +# The lib/oe/path.py requires xattr +PACKAGECONFIG_class-native ??= "xattr" + +# with, without, depends, rdepends +# +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," +PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," +PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,," + +# [ df mktemp nice printenv base64 gets a special treatment and is not included in this +bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \ + env expand expr factor fmt fold groups head hostid id install \ + join link logname md5sum mkfifo nl nohup nproc od paste pathchk \ + pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \ + sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \ + tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes" + +# hostname gets a special treatment and is not included in this +base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \ + mknod mv pwd rm rmdir sleep stty sync touch true uname stat" + +sbindir_progs= "chroot" + +PACKAGE_BEFORE_PN_class-target += "coreutils-stdbuf" +FILES_coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so" +RDEPENDS_coreutils_class-target += "coreutils-stdbuf" + +# Let aclocal use the relative path for the m4 file rather than the +# absolute since coreutils has a lot of m4 files, otherwise there might +# be an "Argument list too long" error when it is built in a long/deep +# directory. +acpaths = "-I ./m4" + +# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h +do_compile_prepend () { + mkdir -p ${B}/src +} + +do_install_class-native() { + autotools_do_install + # remove groups to fix conflict with shadow-native + rm -f ${D}${STAGING_BINDIR_NATIVE}/groups + # The return is a must since native doesn't need the + # do_install_append() in the below. + return +} + +do_install_append() { + for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done + + install -d ${D}${base_bindir} + [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done + + install -d ${D}${sbindir} + [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done + + # [ requires special handling because [.coreutils will cause the sed stuff + # in update-alternatives to fail, therefore use lbracket - the name used + # for the actual source file. + mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +# Make hostname's priority higher than busybox but lower than net-tools +ALTERNATIVE_PRIORITY[hostname] = "90" +ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df" +ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1" + +ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" + +ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" +ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" +ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" + +ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" +ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" +ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" + +ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" +ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" +ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" + +ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice" +ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}" +ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1" + +ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv" +ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}" + +ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" +ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" + +ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" +ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" +ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" +ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" + +python __anonymous() { + for prog in d.getVar('base_bindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) + + for prog in d.getVar('sbindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog)) +} + +BBCLASSEXTEND = "native nativesdk" + +inherit ptest + +RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl libmodule-build-perl make perl perl-module-file-stat python3-core sed shadow" + +# -dev automatic dependencies fails as we don't want libmodule-build-perl-dev, its too heavy +# may need tweaking if DEPENDS changes +RRECOMMENDS_coreutils-dev[nodeprrecs] = "1" +RRECOMMENDS_coreutils-dev = "acl-dev attr-dev gmp-dev libcap-dev bash-dev findutils-dev gawk-dev shadow-dev" + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/tests + cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests + sed -i 's/ginstall/install/g' `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq` + install -d ${D}${PTEST_PATH}/build-aux + install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ + cp ${B}/Makefile ${D}${PTEST_PATH}/ + cp ${S}/init.cfg ${D}${PTEST_PATH}/ + cp -r ${B}/src ${D}${PTEST_PATH}/ + cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src + sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile + sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile + sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile + sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile + sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile + sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile + sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile + chmod -R 777 ${D}${PTEST_PATH} + + # Disable subcase stty-pairs.sh, it will cause test framework hang + sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile + + # Disable subcase tail-2/assert.sh as it has issues on 32-bit systems + sed -i '/assert.sh/d' ${D}${PTEST_PATH}/Makefile + + # Tweak test d_type-check to use python3 instead of python + sed -i "1s@.*@#!/usr/bin/python3@" ${D}${PTEST_PATH}/tests/d_type-check + install ${B}/src/getlimits ${D}/${bindir} + + # handle multilib + sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest +} + +FILES_${PN}-ptest += "${bindir}/getlimits" -- cgit v1.2.3-54-g00ecf