From 91786a849321f7e832b11563d83d0d6359e6a290 Mon Sep 17 00:00:00 2001 From: Michal Filka Date: Fri, 9 Sep 2022 10:06:56 +0200 Subject: [PATCH] Replaced egrep with grep -E. bsc#1203227 --- src/modules/Scanner.rb | 8 ++++---- tools/autodetect_scanners | 2 +- tools/create_scanner_database | 4 ++-- tools/determine_network_scanner_config | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/Scanner.rb b/src/modules/Scanner.rb index e27085f..8f9ab02 100644 --- a/src/modules/Scanner.rb +++ b/src/modules/Scanner.rb @@ -738,7 +738,7 @@ def DependantPrintQueueExists(backend_name) # is required by a print queue for LPRng or for a third-party printing system. if "hpaio" == backend_name return ExecuteBashCommand( - "/usr/bin/lpstat -v | /bin/egrep -q ': hp:/|: hpfax:/'" + "/usr/bin/lpstat -v | /bin/grep -E -q ': hp:/|: hpfax:/'" ) end if "hpoj" == backend_name @@ -2547,10 +2547,10 @@ def SetupNetworkScanningConfig end # Determine if any kind of firewall seems to be active by calling - # "iptables -n -L | egrep -q 'DROP|REJECT'" + # "iptables -n -L | grep -E -q 'DROP|REJECT'" # to find out if there are currently dropping or rejecting packet filter rules. # One might use a more specific test via - # "iptables -n -L | grep -v '^LOG' | egrep -q '^DROP|^REJECT'" + # "iptables -n -L | grep -v '^LOG' | grep -E -q '^DROP|^REJECT'" # to match only for DROP and REJECT targets and exclude LOG targets # but it does not cause real problems when there is a false positive result here # because all what happens it that then a needless firewall info popup would be shown. @@ -2558,7 +2558,7 @@ def SetupNetworkScanningConfig # regarding scanning via network and firewall. # @return true if any kind of firewall seems to be active def ShowFirewallPopup - if ExecuteBashCommand("iptables -n -L | egrep -q 'DROP|REJECT'") + if ExecuteBashCommand("iptables -n -L | grep -E -q 'DROP|REJECT'") Builtins.y2milestone("A firewall seems to be active.") Popup.MessageDetails( _("Check that your firewall allows scanning via network."), diff --git a/tools/autodetect_scanners b/tools/autodetect_scanners index 230f830..a694e18 100755 --- a/tools/autodetect_scanners +++ b/tools/autodetect_scanners @@ -54,7 +54,7 @@ else echo "Cannot execute /usr/bin/sane-find-scanner" 1>&2 exit 2 fi # Only USB and SCSI scanners are taken into account: -egrep '^found SCSI |^found USB ' <$TMP_DATA_RAW | sort -u | sed -e 's/^found //' | tr \" \' >$TMP_DATA +grep -E '^found SCSI |^found USB ' <$TMP_DATA_RAW | sort -u | sed -e 's/^found //' | tr \" \' >$TMP_DATA # Append the raw data for HP all-in-one devices via "hp-probe". # The scanner unit in HP all-in-one USB devices works even without a CUPS queue diff --git a/tools/create_scanner_database b/tools/create_scanner_database index cb5e06c..b4fea13 100755 --- a/tools/create_scanner_database +++ b/tools/create_scanner_database @@ -41,7 +41,7 @@ cat /dev/null >$TMP_DATA # Function to extract entries from a description file with SANE syntax. # Quoted quotation marks '\"' (happens in comments) are replaced by ' ': Extract() -{ cat $1 | sed -e 's/\\"/ /g' | egrep -o '^[[:space:]]*:backend[[:space:]]*"[^"]*"|^[[:space:]]*:version[[:space:]]*"[^"]*"|^[[:space:]]*:mfg[[:space:]]*"[^"]*"|^[[:space:]]*:model[[:space:]]*"[^"]*"|^[[:space:]]*:firmware[[:space:]]*"[^"]*"|^[[:space:]]*:interface[[:space:]]*"[^"]*"|^[[:space:]]*:usbid[[:space:]]*"0x[0-9A-Fa-f]*"[[:space:]]*"0x[0-9A-Fa-f]*"|^[[:space:]]*:status[[:space:]]*:[a-z]*|^[[:space:]]*:comment[[:space:]]*"[^"]*"' +{ cat $1 | sed -e 's/\\"/ /g' | grep -E -o '^[[:space:]]*:backend[[:space:]]*"[^"]*"|^[[:space:]]*:version[[:space:]]*"[^"]*"|^[[:space:]]*:mfg[[:space:]]*"[^"]*"|^[[:space:]]*:model[[:space:]]*"[^"]*"|^[[:space:]]*:firmware[[:space:]]*"[^"]*"|^[[:space:]]*:interface[[:space:]]*"[^"]*"|^[[:space:]]*:usbid[[:space:]]*"0x[0-9A-Fa-f]*"[[:space:]]*"0x[0-9A-Fa-f]*"|^[[:space:]]*:status[[:space:]]*:[a-z]*|^[[:space:]]*:comment[[:space:]]*"[^"]*"' } # Process the SANE description files: @@ -125,7 +125,7 @@ Output() [ -z "$USBID" ] && USBID='""' [ -z "$COMMENT" ] && COMMENT='""' if [ "$PACKAGE" = '"iscan"' -o "$PACKAGE" = '"iscan-free"' ] - then if echo "$COMMENT" | egrep -q 'requires a DFSG non-free module|requires DFSG non-free' + then if echo "$COMMENT" | grep -E -q 'requires a DFSG non-free module|requires DFSG non-free' then PACKAGE='"iscan"' else PACKAGE='"iscan-free"' fi diff --git a/tools/determine_network_scanner_config b/tools/determine_network_scanner_config index d3ac917..21e629e 100755 --- a/tools/determine_network_scanner_config +++ b/tools/determine_network_scanner_config @@ -37,7 +37,7 @@ SANED_CONFIG_FILE="/etc/sane.d/saned.conf" # Function to extract entries from a SANE config file: Extract() -{ egrep -v '^#|^[[:space:]]*$' $1 | tr -d '[:blank:]' | sort -u | tr -s '\n' ',' +{ grep -E -v '^#|^[[:space:]]*$' $1 | tr -d '[:blank:]' | sort -u | tr -s '\n' ',' } # Get and output the hosts in $NET_BACKEND_CONFIG_FILE