From b982051e7c8e12c3810a0d21d30d687b406b3ae5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 16 Dec 2022 09:35:57 +0000 Subject: gentoo auto-resync : 16:12:2022 - 09:35:57 --- app-alternatives/Manifest.gz | Bin 1675 -> 1677 bytes app-alternatives/awk/Manifest | 1 + app-alternatives/awk/awk-4.ebuild | 95 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 app-alternatives/awk/awk-4.ebuild (limited to 'app-alternatives') diff --git a/app-alternatives/Manifest.gz b/app-alternatives/Manifest.gz index b4f9b38bd53f..877705e60467 100644 Binary files a/app-alternatives/Manifest.gz and b/app-alternatives/Manifest.gz differ diff --git a/app-alternatives/awk/Manifest b/app-alternatives/awk/Manifest index 4af029902a19..1aaccb5c1dac 100644 --- a/app-alternatives/awk/Manifest +++ b/app-alternatives/awk/Manifest @@ -1,3 +1,4 @@ EBUILD awk-1.ebuild 554 BLAKE2B 29fc3ad3018b3ce17a24c250e22789105c8a564fdda0c2185401fe999ccb2d33eae2afacef01042e3b58e968b906452e9fb623f0a804c0a0954042297146abf9 SHA512 53db324987a3b7dc3c49f4d5d2060b8d065aa5798be2084d75c5eea89344205118ca301ca21ecc438d45e28ea1eb60357d44c2fe0b52ae1602636bf85535d1d0 EBUILD awk-3.ebuild 1895 BLAKE2B 03a4a58d22e8e59acebd7811d2e9e8dcd6fc9c2c2601cf85da39f8f863de333164af838868eadf5ed2cd6d30aefbc2450bf917e4737d21297231b01550ec47a5 SHA512 c5b81fe0863e6fadaaf7ba0687834fabd92e92ddb6f7bf33efe4118ed328ef8b694d3471ece7656dbedb97fc25091cd68c4456218093decacdcfc2f5646d81b3 +EBUILD awk-4.ebuild 2565 BLAKE2B 402884620dfc701f8dca5756775840b47da5aede1ba724235640f96793a675eeb3cccad877e66576ffa3349aafcedbbe2d4ceff533fa0e20002480fb3cf3cae0 SHA512 0931e2cf0292ec56b7b3a2b777689419f69087d82622bf8a5f47fbc74bbf5d80a80ce00c4f87dbf4ad89ccc5f712609986b5f1a35877ff578db3b35224ff4702 MISC metadata.xml 829 BLAKE2B bf4375b33e702c61a3f8553e1b63110acab32b68d4ac2d905b6dd12a2204484bc5c2f3a34b2ec127a6c60aac8c105949dbc6eb5ade3a1c8c959afdabdd3658a1 SHA512 32252970d3b12c7a5b9fc7c7ffae821908b9bd4101372e699c70e64572fd7563121427ed5971462417d8c2e6155e47f567ac3bb057d457d58648c5b4d2458974 diff --git a/app-alternatives/awk/awk-4.ebuild b/app-alternatives/awk/awk-4.ebuild new file mode 100644 index 000000000000..127157897532 --- /dev/null +++ b/app-alternatives/awk/awk-4.ebuild @@ -0,0 +1,95 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ALTERNATIVES=( + gawk:sys-apps/gawk + busybox:sys-apps/busybox + mawk:sys-apps/mawk + nawk:sys-apps/nawk +) + +inherit app-alternatives + +DESCRIPTION="/bin/awk and /usr/bin/awk symlinks" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="split-usr" + +RDEPEND=" + !app-eselect/eselect-awk +" + +src_install() { + local alt=$(get_alternative) + local root_prefix= + use split-usr && root_prefix=../../bin/ + + # We could consider setting AWK=... like we do for yacc & lex, + # but it would need some testing with a fair amount of packages first, + # as autoconf prefers gawk. + case ${alt} in + busybox) + dosym "${root_prefix}busybox" /usr/bin/awk + ;; + *) + dosym "${alt}" /usr/bin/awk + ;; + esac + + newman - awk.1 <<<".so ${alt}.1" + + if use split-usr; then + dosym ../usr/bin/awk /bin/awk + fi +} + +pkg_preinst() { + HAD_MAWK=0 + + has_version "app-alternatives/awk[mawk]" && HAD_MAWK=1 + + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test "${v}" -lt 4; then + SHOW_MAWK_WARNING=1 + fi + + # if we are upgrading from a new enough version, leftover manpage + # symlink cleanup was done already + if ver_test "${v}" -ge 3; then + return + fi + done + + # otherwise, remove leftover files/symlinks created by eselect-awk (sic!) + shopt -s nullglob + local files=( "${EROOT}"/usr/share/man/man1/awk.1* ) + shopt -u nullglob + + if [[ ${files[@]} ]]; then + einfo "Cleaning up leftover manpage symlinks from eselect-awk ..." + rm -v "${files[@]}" || die + fi +} + +pkg_postinst() { + # Show the warning on new installs if using mawk, or older installs + # if upgrading from < app-alternatives/awk-4[mawk]. + if [[ -z ${REPLACING_VERSIONS} || ${SHOW_MAWK_WARNING} -eq 1 || ${HAD_MAWK} -eq 0 ]] && use mawk; then + ewarn "mawk (incompletely) implements awk, as it was defined by the now-obsolete" + ewarn "POSIX 1003.2 (draft 11.3) specification. It does not fully implement the standard" + ewarn "extended regular expression syntax and there are other known issues pertaining to POSIX conformance." + fi +} + +pkg_postrm() { + # make sure we don't leave the user without the symlinks, since + # they've not been owned by any other package + if [[ ! -h ${EROOT}/usr/bin/awk ]]; then + ln -s gawk "${EROOT}/usr/bin/awk" || die + fi + if [[ ! -h ${EROOT}/bin/awk ]]; then + ln -s ../usr/bin/awk "${EROOT}/bin/awk" || die + fi +} -- cgit v1.2.3