00-patches.sh: avoid useless use of cat

This commit is contained in:
maxice8 2019-04-13 17:37:30 -03:00 committed by maxice8
parent 53c60b31ae
commit 23216853d6

View file

@ -7,7 +7,7 @@ _process_patch() {
_patch=${i##*/} _patch=${i##*/}
if [ -f $PATCHESDIR/${_patch}.args ]; then if [ -f $PATCHESDIR/${_patch}.args ]; then
_args=$(cat $PATCHESDIR/${_patch}.args) _args=$(<$PATCHESDIR/${_patch}.args)
elif [ -n "$patch_args" ]; then elif [ -n "$patch_args" ]; then
_args=$patch_args _args=$patch_args
fi fi
@ -39,9 +39,9 @@ hook() {
return 0 return 0
fi fi
if [ -r $PATCHESDIR/series ]; then if [ -r $PATCHESDIR/series ]; then
cat $PATCHESDIR/series | while read f; do while read -r f; do
_process_patch "$PATCHESDIR/$f" _process_patch "$PATCHESDIR/$f"
done done < $PATCHESDIR/series
else else
for f in $PATCHESDIR/*; do for f in $PATCHESDIR/*; do
[ ! -f $f ] && continue [ ! -f $f ] && continue