1 # This hook applies patches from "patches" directory.
4 local _args
= _patch
= i
=$1
9 if [ -f "$PATCHESDIR/${_patch}.args" ]; then
10 _args
=$
(<"$PATCHESDIR/${_patch}.args")
11 elif [ -n "$patch_args" ]; then
16 # Try to guess if its a compressed patch.
17 if [[ $i =~ .gz$
]]; then
18 gunzip
"$wrksrc/${_patch}"
20 elif [[ $i =~ .bz2$
]]; then
21 bunzip2
"$wrksrc/${_patch}"
22 _patch
=${_patch%%.bz2}
23 elif [[ $i =~ .
diff$
]]; then
25 elif [[ $i =~ .
patch$
]]; then
28 msg_warn
"$pkgver: unknown patch type: $i.\n"
33 msg_normal
"$pkgver: patching: ${_patch}.\n"
34 patch -s ${_args} <"${_patch}" 2>/dev
/null
38 if [ ! -d "$wrksrc" ]; then
41 if [ -r $PATCHESDIR/series
]; then
43 _process_patch
"$PATCHESDIR/$f"
44 done < $PATCHESDIR/series
46 for f
in $PATCHESDIR/*; do
47 [ ! -f "$f" ] && continue
48 if [[ $f =~ ^.
*.args$
]]; then