update cowpatch.sh from upstream

upstream commit b3a885f71ce31dff0c60dab6f5b6cb5ded4c9fb4
This commit is contained in:
Rich Felker 2020-02-17 15:08:10 -05:00
parent b49456e19a
commit 6b7083fa6a
1 changed files with 12 additions and 1 deletions

View File

@ -70,9 +70,11 @@ echo "$l"
;; ;;
@@*) @@*)
echo "$l" echo "$l"
IFS=" ," read -r junk junk i junk j junk <<EOF IFS=" " read -r junk i j junk <<EOF
$l $l
EOF EOF
case "$i" in *,*) i=${i#*,} ;; *) i=1 ;; esac
case "$j" in *,*) j=${j#*,} ;; *) j=1 ;; esac
while test $i -gt 0 || test $j -gt 0 ; do while test $i -gt 0 || test $j -gt 0 ; do
IFS= read -r l IFS= read -r l
echo "$l" echo "$l"
@ -88,4 +90,13 @@ done
} }
gotcmd=0
while getopts ":p:i:RNEI:S:" opt ; do
case "$opt" in
I) find "$OPTARG" -path "$OPTARG/*" -prune -exec sh -c 'ln -sf "$@" .' sh {} + ; gotcmd=1 ;;
S) cowp "$OPTARG" ; gotcmd=1 ;;
esac
done
test "$gotcmd" -eq 0 || exit 0
cowpatch "$@" | patch "$@" cowpatch "$@" | patch "$@"