Ddwrt selective co.sh

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search

Jbrazio (Talk | contribs)
(New page: '''Description''' The following bash script will checkout from DD-WRT repository everything except kernel source code. '''Usage''' <pre>user@linux:~$ sh ddwrt_selective_co.sh dd-wrt</pr...)
Next diff →

Revision as of 11:59, 17 December 2008

Description

The following bash script will checkout from DD-WRT repository everything except kernel source code.


Usage

user@linux:~$ sh ddwrt_selective_co.sh dd-wrt


Source code

#!/bin/sh
TARGET=${1}

if [ -z "${TARGET}" ]; then
        echo ${0}: Please specify the target destination
        exit 1
fi

svn co svn://svn.dd-wrt.com/DD-WRT "${TARGET}" --depth immediates --quiet

for tmp1 in $( find "${TARGET}" -type d \( ! -iname  "${TARGET}" \) | grep --invert-match .svn ); do
        echo ${0}: Updating "${tmp1}" ..
        svn up "${tmp1}" --set-depth immediates --quiet

        for tmp2 in $( find "${tmp1}" -type d \( ! -iname $( basename "${tmp1}" ) \) | grep --invert-match .svn ); do
                if [ "${TARGET}/src/linux" != ${tmp2} ]; then
                        echo ${0}: -- Updating "${tmp2}" ..
                        svn up "${tmp2}" --set-depth infinity --quiet
                else
                        echo ${0}: == Updating "${tmp2}" ..
                        svn up "${tmp2}" --set-depth immediates --quiet
                fi
        done
done
<pre>