wok-next diff pm-utils/stuff/patches/grep-x.patch @ rev 21578
updated davfs2 (1.5.4 -> 1.5.6)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Jun 23 15:33:53 2020 +0100 (2020-06-23) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/pm-utils/stuff/patches/grep-x.patch Tue Jun 23 15:33:53 2020 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +--- a/pm/functions.in 1.5 ++++ b/pm/functions.in 1.6 +@@ -215,8 +215,22 @@ 1.7 + for p in "$@"; do 1.8 + echo "$p" >> "$PARAMETERS.rm" 1.9 + done 1.10 +- # let grep do the dirty work. 1.11 +- grep -vxFf "$PARAMETERS.rm" "$PARAMETERS" > "$PARAMETERS.new" 1.12 ++ # let awk do the dirty work. 1.13 ++ cat "$PARAMETERS" | awk -v VAR="$(cat "$PARAMETERS.rm")" ' 1.14 ++ { 1.15 ++ del=0 1.16 ++ split(VAR,rm) 1.17 ++ for(i in rm) 1.18 ++ { 1.19 ++ if($1==rm[i]){ 1.20 ++ del++ 1.21 ++ } 1.22 ++ } 1.23 ++ if(del==0) 1.24 ++ { 1.25 ++ print $1 1.26 ++ } 1.27 ++ }' > "$PARAMETERS.new" 1.28 + fi 1.29 + cp -f "$PARAMETERS.new" "$PARAMETERS" 1.30 + }