diff options
author | Stef Walter <stef@memberwebs.com> | 2009-10-06 16:08:56 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-10-06 16:08:56 +0000 |
commit | d48758fd1a0b6777bcd0316df7e14578f776ec02 (patch) | |
tree | 3ad690ac489ae56bad2a656c1be34935f56612d5 | |
parent | 6ae53606a957ba2a7c16c2878fa2caa012c8241c (diff) |
Add option to not build patches
-rwxr-xr-x | update-kernel | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/update-kernel b/update-kernel index a57d04e..3067474 100755 --- a/update-kernel +++ b/update-kernel @@ -46,7 +46,7 @@ fail() usage() { - echo "usage: $script [-v] [-s server] [-B branch]" >&2 + echo "usage: $script [-vn] [-s server] [-B branch]" >&2 exit 2 } @@ -56,12 +56,16 @@ version=`uname -r | sed -En 's/^([.0-9]+).*/\1/p'` branch="RELENG_`echo $version | tr '.' '_'`" csup="csup -L0" patch="patch -s" +patches="YES" -while getopts "B:s:v" arg; do +while getopts "B:ns:v" arg; do case $arg in B) branch="$OPTARG" ;; + n) + patches="NO" + ;; s) server="$OPTARG" ;; @@ -110,11 +114,13 @@ EOF # Only allow up to 10 files to be deleted $csup -d 10 $supfile -# Allow globbing from here on out -set +f +if is_yes $patches; then + # Allow globbing from here on out + set +f -for file in $patchdir/*; do - if [ -f "$file" ]; then - $patch -d /usr/src -t -p0 < $file - fi -done + for file in $patchdir/*; do + if [ -f "$file" ]; then + $patch -d /usr/src -t -p0 < $file + fi + done +fi |