From: Luis R. Rodriguez Date: Fri, 4 May 2012 22:27:35 +0000 (-0700) Subject: compat-wireles: add scripts to help standalone development trees X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=40e37d00789fe20e18186a674175b4511cb0cab0;p=openwrt%2Fstaging%2Fblogic.git compat-wireles: add scripts to help standalone development trees This adds a set of scripts to help you use compat-wireless to maintain standalone development trees that use compat-wireless and synch with it. An example standalone development git tree will be provided later. Signed-off-by: Luis R. Rodriguez --- diff --git a/scripts/refresh-compat b/scripts/refresh-compat new file mode 100755 index 000000000000..d4c44c873986 --- /dev/null +++ b/scripts/refresh-compat @@ -0,0 +1,98 @@ +#!/bin/bash +# +# Copyright 2012 Luis R. Rodriguez +# +# The purpose of this script is to enable developers use compat-wireless +# backport work without having to carry code on their tree. This lets +# developers synch to newer compat-wireless releases to gain more backport +# work. If you use this throw the files into your .gitignore: +# +# compat/ +# udev/ +# include/ +# scripts/ +# compat_base_tree +# compat_base_tree_version +# compat_version +# config.mk +# +# An example git tree for standalone development will be provided later. +# Once run you can then just run on your standalone development tree: +# +# ./refresh-compat +# +# This is a copy of refresh-compat-local that we maintain here +# You can keep that in your git tree as otherwise its hard for users to +# know what to run. + +# Pretty colors +GREEN="\033[01;32m" +YELLOW="\033[01;33m" +NORMAL="\033[00m" +BLUE="\033[34m" +RED="\033[31m" +PURPLE="\033[35m" +CYAN="\033[36m" +UNDERLINE="\033[02m" + +COMPAT_SRC="$HOME/devel/compat-wireless/" +EXTRA_COPY="" + +if [[ -f .compat_copy ]]; then + source .compat_copy +fi + +COPY="" +COPY="$COPY compat/" +COPY="$COPY include/" +COPY="$COPY udev/" +COPY="$COPY scripts/check_config.sh" +COPY="$COPY scripts/check_depmod" +COPY="$COPY scripts/compress_modules" +COPY="$COPY scripts/gen-compat-autoconf.sh" +COPY="$COPY scripts/modlib.sh" +COPY="$COPY scripts/update-initramfs" +COPY="$COPY compat_base_tree" +COPY="$COPY compat_base_tree_version" +COPY="$COPY compat_version" +COPY="$COPY config.mk" +COPY="$COPY $EXTRA_COPY" + +REFRESH_LOCAL="scripts/refresh-compat-local" +REFRESH_TARGET="refresh-compat" + +for i in $COPY ; do + if [[ -d ${COMPAT_SRC}${i} ]]; then + echo -e "Copying ${BLUE}${i}${NORMAL} ..." + cp -a ${COMPAT_SRC}/$i . + continue + fi + if [[ -f ${COMPAT_SRC}${i} ]]; then + DIR=$(dirname $i) + if [[ ! -d $DIR ]]; then + mkdir $DIR + fi + + if [[ -x ${COMPAT_SRC}${i} ]]; then + echo -e "Copying ${GREEN}${i}${NORMAL} ..." + else + echo -e "Copying ${i}${NORMAL} ..." + fi + + cp -f ${COMPAT_SRC}/${i} $i + continue + fi +done + +rm -f include/linux/compat_autoconfig.h +rm -f .config + +cp -f ${COMPAT_SRC}/${REFRESH_LOCAL} ${REFRESH_TARGET} + +if [[ ! -f compat_base_tree_version ]]; then + echo -e "Failed at copying files over..." + exit 1 +fi + +echo +echo -e "Synched with ${CYAN}$(cat compat_version)${NORMAL}" diff --git a/scripts/refresh-compat-local b/scripts/refresh-compat-local new file mode 100755 index 000000000000..3122995c735b --- /dev/null +++ b/scripts/refresh-compat-local @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2012 Luis R. Rodriguez +# +# You can keep this in synch with your git tree after running +# This script just update your local copy. + +source .compat_copy +UPDATE_SCRIPT="$COMPAT_SRC/scripts/refresh-compat" + +if [[ ! -d $COMPAT_SRC ]]; then + echo -e "You should have compat-wireless.git cloned and checked out under $COMPAT_SRC" + echo -e "The git tree: git://github.com/mcgrof/compat-wireless.git" + exit 1 +fi + +if [[ ! -f $UPDATE_SCRIPT ]]; then + echo -e "$UPDATE_SCRIPT must exist" + exit 1 +fi + +exec $UPDATE_SCRIPT