I use a separate build directory from the tree in which I expand the source
tree. Some files, such as Module.supported are generated automatically and
placed in the source tree.
This patch adds a --build-dir=PATH option and uses that directory for
generated files. If it doesn't exist, it will create it. If it does exist,
it will not clean it. Except to re-set the source and patches links it
will create.
Signed-off-by: Jeff Mahoney
---
scripts/sequence-patch.sh | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
--- a/scripts/sequence-patch.sh
+++ b/scripts/sequence-patch.sh
@@ -37,7 +37,7 @@ sles9* | sles10* | sle10* | 9.* | 10.* |
esac
usage() {
- echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]"
+ echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] [--build-dir=PATH]"
exit 1
}
@@ -49,7 +49,7 @@ if $have_arch_patches; then
else
arch_opt=""
fi
-options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz -- "$@"`
+options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir: -- "$@"`
if [ $? -ne 0 ]
then
@@ -64,6 +64,7 @@ QUILT=true
COMBINE=
FAST=
VANILLA=false
+SP_BUILD_DIR=
while true; do
case "$1" in
@@ -105,6 +106,10 @@ while true; do
fuzz="-F$2"
shift
;;
+ --build-dir)
+ SP_BUILD_DIR="$2"
+ shift
+ ;;
--)
shift
break ;;
@@ -214,6 +219,13 @@ EXT=${EXTRA_SYMBOLS// /-}
EXT=${EXT//\//}
PATCH_DIR=${PATCH_DIR}${EXT:+-}$EXT
+if [ -n "$SP_BUILD_DIR" ]; then
+ # This allows alias (~) and variable expansion
+ SP_BUILD_DIR=$(eval echo "$SP_BUILD_DIR")
+else
+ SP_BUILD_DIR="$PATCH_DIR"
+fi
+
echo "Creating tree in $PATCH_DIR"
# Clean up from previous run
@@ -431,9 +443,19 @@ fi
echo "[ Tree: $PATCH_DIR ]"
+append=
+if test "$SP_BUILD_DIR" != "$PATCH_DIR"; then
+ mkdir -p "$SP_BUILD_DIR"
+ echo "[ Build Dir: $SP_BUILD_DIR ]"
+ rm -f "$SP_BUILD_DIR/source"
+ rm -f "$SP_BUILD_DIR/patches"
+ ln -sf "$PATCH_DIR" "$SP_BUILD_DIR/source"
+ ln -sf "source/patches" "$SP_BUILD_DIR/patches"
+fi
+
if test -e supported.conf; then
echo "[ Generating Module.supported ]"
- scripts/guards base external < supported.conf > $PATCH_DIR/Module.supported
+ scripts/guards base external < supported.conf > "$SP_BUILD_DIR/Module.supported"
fi
[ $# -gt 0 ] && exit $status
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-kernel+help@opensuse.org