| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
PATCHES="$(ls /home/dsd/projects/gentoo/genpatches/2.6.$1/*.patch)"
|
| 4 |
for i in ${PATCHES} ; do
|
| 5 |
short="${i##*/}"
|
| 6 |
code="${short:0:4}"
|
| 7 |
|
| 8 |
if [[ $code -lt $2 ]] ; then
|
| 9 |
continue
|
| 10 |
fi
|
| 11 |
|
| 12 |
echo ">>> Dry run: ${short}"
|
| 13 |
if ! patch --dry-run -p1 -i ${i} >/dev/null 2>&1 ; then
|
| 14 |
echo ">>> Patch ${short} fails to dry run"
|
| 15 |
exit
|
| 16 |
fi
|
| 17 |
|
| 18 |
echo ">>> Apply: ${short}"
|
| 19 |
if ! patch -p1 -i ${i} ; then
|
| 20 |
echo ">>> Patch ${short} failed to apply"
|
| 21 |
exit
|
| 22 |
fi
|
| 23 |
done
|
| 24 |
echo ">>> Done"
|