From 0338d14862cdf5c50be451809af94232d8ca60a8 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 15 May 2022 01:12:05 +0000 Subject: [PATCH] Replace obsolete usage of 'egrep' with 'grep -E' egrep is considered deprecated (and is an alias to grep -E), so replace it with grep -E. --- a/doc/todo/regex_in_20-warn-problem-files.mdwn +++ b/doc/todo/regex_in_20-warn-problem-files.mdwn @@ -1,11 +1,11 @@ exclude_internal () { - egrep -v '(^|/)(.git|.hg|.bzr|_darcs)/' + grep -E -v '(^|/)(.git|.hg|.bzr|_darcs)/' } should probably escape the `.`s. exclude_internal () { - egrep -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/' + grep -E -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/' } > [[fixed|done]] --[[Joey]] --- a/etckeeper +++ b/etckeeper @@ -84,7 +84,7 @@ elif [ "$command" = "pre-apt" ]; then command=pre-install fi -if echo "$command" | LANG=C egrep -q '[^-a-z_]'; then +if echo "$command" | LANG=C grep -E -q '[^-a-z_]'; then echo "etckeeper: invalid command $command" >&2 exit 1 fi @@ -142,7 +142,7 @@ else # fallback if perl isn't present for script in $ETCKEEPER_CONF_DIR/$command.d/*; do if [ ! -d "$script" -a -x "$script" ]; then - echo "$script" | egrep -q "/[-a-zA-Z0-9]+$" + echo "$script" | grep -E -q "/[-a-zA-Z0-9]+$" [ $? -eq 0 ] && "$script" "$@" fi done --- a/list-installed.d/50list-installed +++ b/list-installed.d/50list-installed @@ -17,7 +17,7 @@ else # format "package version\n" (or something similar). if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \ - egrep '(ok installed|ok config-files)' | cut -f2,3 + grep -E '(ok installed|ok config-files)' | cut -f2,3 elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then --- a/post-install.d/50vcs-commit +++ b/post-install.d/50vcs-commit @@ -66,7 +66,7 @@ if etckeeper unclean; then get_changed_packages | sort | uniq > $pl.found-pkgs if [ -s $pl.found-pkgs ]; then sed -i 's/^/^[-+]/;s/$/ /' $pl.found-pkgs - etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages if [ -s $pl.found-packages ]; then echo "Packages with configuration changes:" cat $pl.found-packages || true @@ -74,7 +74,7 @@ if etckeeper unclean; then fi fi echo "Package changes:" - etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' || true + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' || true ) | etckeeper commit --stdin else etckeeper commit "$(printf "$message")" --- a/pre-commit.d/20warn-problem-files +++ b/pre-commit.d/20warn-problem-files @@ -2,7 +2,7 @@ set -e exclude_internal () { - egrep -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/' + grep -E -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/' } if [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then