Replace calls to egrep and fgrep with grep and the according options
Closes: #1019328
Thanks to Vincent Lefevre for the reminder!
Axel Beckert
1 year, 7 months ago
|
0 |
debian-goodies (0.89) UNRELEASED; urgency=medium
|
|
1 |
|
|
2 |
* Replace calls to egrep and fgrep with grep and the according options.
|
|
3 |
(Closes: #1019328) Thanks to Vincent Lefevre for the reminder.
|
|
4 |
|
|
5 |
-- Axel Beckert <abe@debian.org> Fri, 09 Sep 2022 12:18:18 +0200
|
|
6 |
|
0 | 7 |
debian-goodies (0.88) unstable; urgency=low
|
1 | 8 |
|
2 | 9 |
[ Axel Beckert ]
|
61 | 61 |
done
|
62 | 62 |
|
63 | 63 |
pattern="$1"
|
64 | |
if echo "$pattern" | fgrep -q ":"; then
|
|
64 |
if echo "$pattern" | grep -Fq ":"; then
|
65 | 65 |
package=$(echo "$pattern" | awk -F: '{print $1}')
|
66 | 66 |
arch=$(echo "$pattern" | awk -F: '{print $2}')
|
67 | 67 |
archfilter="grep-dctrl -FArchitecture $arch"
|
65 | 65 |
shift
|
66 | 66 |
done
|
67 | 67 |
|
68 | |
for pkgglob in "$@"; do dglob -0f "$pkgglob"; done | xargs -0r $prog $opts "$pat"
|
|
68 |
# *SIGH*, unfortunately needed for GNU grep 3.8
|
|
69 |
case "$prog" in
|
|
70 |
egrep) prog=grep; opts="$opts -E" ;;
|
|
71 |
fgrep) prog=grep; opts="$opts -F" ;;
|
|
72 |
esac
|
|
73 |
|
|
74 |
for pkgglob in "$@"; do dglob -0f "$pkgglob"; done | xargs -0r "$prog" $opts "$pat"
|
16 | 16 |
in those packages. It uses dglob's substring pattern matching for the package
|
17 | 17 |
names.
|
18 | 18 |
|
19 | |
If B<dgrep> is invoked as B<degrep>, B<dfgrep> or B<dzgrep> then L<egrep(1)>,
|
20 | |
L<fgrep(1)> or L<zgrep(1)> is used instead of L<grep(1)>.
|
|
19 |
If B<dgrep> is invoked as B<degrep>, B<dfgrep> or B<dzgrep>, etc. then
|
|
20 |
L<grep(1)> with option C<-E> or C<-F> respectively the command
|
|
21 |
L<zgrep(1)> is used instead of L<grep(1)>.
|
21 | 22 |
|
22 | 23 |
=head1 OPTIONS
|
23 | 24 |
|
|
60 | 61 |
|
61 | 62 |
=head1 SEE ALSO
|
62 | 63 |
|
63 | |
L<grep(1)>, L<egrep(1)>, L<fgrep(1)>, L<zgrep(1)>, L<dglob(1)>, L<regex(7)>, L<dpkg(8)>
|
|
64 |
L<grep(1)>, L<zgrep(1)>, L<dglob(1)>, L<regex(7)>, L<dpkg(8)>
|
48 | 48 |
file=$2
|
49 | 49 |
curl $CURLOPTS "$url" >"$file" 2>/dev/null
|
50 | 50 |
if ! [ -s "$file" ] ||
|
51 | |
egrep -q "<title>403.*Forbidden</title>" "$file" ||
|
52 | |
egrep -q "<h1>Manpage not found</h1>" "$file" ; then
|
|
51 |
grep -Eq "<title>403.*Forbidden</title>" "$file" ||
|
|
52 |
grep -Eq "<h1>Manpage not found</h1>" "$file" ; then
|
53 | 53 |
return 1
|
54 | 54 |
fi
|
55 | 55 |
return 0
|
21 | 21 |
elif [ -n "$srcdir" ]; then
|
22 | 22 |
cat debian/control | sed ':a;N;$!ba;s/\(Build-Depends[^ ]*:[^\n:]*\)\n/\1 /g'
|
23 | 23 |
fi | \
|
24 | |
fgrep Build-Depends | \
|
|
24 |
grep -F Build-Depends | \
|
25 | 25 |
tr '|,' ' ' | \
|
26 | 26 |
sed -e 's/^Build-Depends[^ ]*://; s/([^()]*)//g; s/<[^<>]*>//g; s/\[[^]]*\]//g;'
|
27 | 27 |
)
|
|
30 | 30 |
for pkg in $bd; do
|
31 | 31 |
which-pkg-broke $pkg
|
32 | 32 |
done | \
|
33 | |
fgrep -v "has no install time info" | \
|
|
33 |
grep -Fv "has no install time info" | \
|
34 | 34 |
while read pkg date; do
|
35 | 35 |
echo `date +%s -d "$date"` $pkg
|
36 | 36 |
done | \
|