Hi all -
There are a few things I do every time I expand the source tree with sequence-patch.sh.
Or, rather, things I should do and forget to do a lot.
The first I always remember to do: Copy the config I want to test with to my build directory.
The second I forget more often than not: Expand the kABI references into my build directory.
One of the things that bites me occasionally is when there are kABI changes that go un-noticed until the automated build checker flags them and sends me an email yelling at me for my carelessness.
This patch adds three options to scripts/sequence-patch.sh to take care of these automatically.
--build-dir=PATH allows you to specify the build directory you'll be using. It will create the directory if it doesn't exist. It defaults to $PATCH_DIR.
--config=ARCH-FLAVOR allows you to specify the config you'll use. It will copy the config to your build directory. It is not a fatal error if the config does not exist. It will just not copy one.
--kabi allows you to direct sequence-patch to expand the kABI references into your build directory. Since the references are arch/flavor specific, it depends on --config=ARCH-FLAVOR. It is not a fatal error if the kABI reference doesn't exist since this is always the case in the master branch.
The --build-dir PATH is subject to shell expansion. It is expanded late enough in the script that most variables should be available.
There are also three new variables available when --config is used: $CONFIG contains the --config contents. $CONFIG_ARCH contains the arch part of the config. $CONFIG_FLAVOR contains the flavor part.
For reference, I have this in my .bashrc: export SEQUENCE_PATCH_ARGS="--config=x86_64-desktop --build-dir=~/src/scratch/build/$CONFIG_ARCH/linux-$SRCVERSION-$TAG-$CONFIG_FLAVOR --kabi"
I've also added patches for --ctags and --cscope which will automatically generate the databases for either of those tools in the build directory after the source tree is expanded.
- Issues addressed in patchset #2: - Help text is now a here document for easy addition of more documentation - Explanation of which variables are allowed by --build-dir - Missing rpm/modversions script is not an error on older branches - Missing symvers files are not errors - Uses true/false for simple feature flags
-Jeff
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 jeffm@suse.com --- scripts/sequence-patch.sh | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -37,7 +37,19 @@ sles9* | sles10* | sle10* | 9.* | 10.* | esac
usage() { - echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]" + cat <<END +SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] + [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] + [--build-dir=PATH] + + The --build-dir option supports internal shell aliases, like ~, and variable + expansion when the variables are properly escaped. Environment variables + and the following list of internal variables are permitted: + $PATCH_DIR: The expanded source tree + $SRCVERSION: The current linux source tarball version + $TAG: The current tag or branch of this repo + $EXT: A string expanded from current $EXTRA_SYMBOLS +END exit 1 }
@@ -49,7 +61,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 +76,7 @@ QUILT=true COMBINE= FAST= VANILLA=false +SP_BUILD_DIR=
while true; do case "$1" in @@ -105,6 +118,10 @@ while true; do fuzz="-F$2" shift ;; + --build-dir) + SP_BUILD_DIR="$2" + shift + ;; --) shift break ;; @@ -217,6 +234,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 @@ -434,9 +458,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
On 19.01.11 at 19:40, Jeff Mahoney jeffm@suse.com wrote:
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.
I think it is actually correct to place this in the source tree - instead of putting it in the build tree, I have been carrying this
--- head-2011-01-10.orig/scripts/Makefile.modpost +++ head-2011-01-10/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \ - $(objtree)/Module.supported /dev/null))) + $(objtree)/Module.supported \ + $(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
(addressing in particular the case where you want to build multiple configs/arches from a single source tree) which obviously could be folded into patches.suse/supported-flag if so desired.
Jan
On 19.01.11 at 19:40, Jeff Mahoney jeffm@suse.com wrote:
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.
Which makes me assume you build only a single config. For obvious(?) reasons I usually build two or three (native, Xen, and on some branches EC2).
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.
Rather than putting generated files in the build tree, I'd recommend allowing to reference them in the source tree (Modules.supported really is a source file from an expanded-source-tree perspective, i.e. from the pov of the actual kernel build). At the risk of repeating myself, this is what I patch into each end every source snapshot I take (and I would love to see this integrated into patches.suse/supported-flag, but I never received an ack to do so on earlier posts):
--- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \ - $(objtree)/Module.supported /dev/null))) + $(objtree)/Module.supported \ + $(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
I'm sure something similar ought to be possible for the reference symsets (which, from a kernel build pov again are source files, and could be generated for all active flavors at once, just like the configs used to be).
That would eliminate the need for sequence-patch to have to know the build directory (which I don't want to be read as objection to the change you propose - for those building just a single config that's certainly fine, but if above suggestions are taken, then it'll likely end up just creating an empty directory).
Jan
Signed-off-by: Jeff Mahoney jeffm@suse.com
scripts/sequence-patch.sh | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -37,7 +37,19 @@ sles9* | sles10* | sle10* | 9.* | 10.* | esac
usage() {
- echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast]
[last-patch-name] [--vanilla] [--fuzz=NUM]"
- cat <<END
+SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...]
[--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]
[--build-dir=PATH]
- The --build-dir option supports internal shell aliases, like ~, and variable
- expansion when the variables are properly escaped. Environment variables
- and the following list of internal variables are permitted:
- $PATCH_DIR: The expanded source tree
- $SRCVERSION: The current linux source tarball version
- $TAG: The current tag or branch of this repo
- $EXT: A string expanded from current $EXTRA_SYMBOLS
+END exit 1 }
@@ -49,7 +61,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 +76,7 @@ QUILT=true COMBINE= FAST= VANILLA=false +SP_BUILD_DIR=
while true; do case "$1" in @@ -105,6 +118,10 @@ while true; do fuzz="-F$2" shift ;;
- --build-dir)
SP_BUILD_DIR="$2"
shift
--) shift break ;;;;
@@ -217,6 +234,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 @@ -434,9 +458,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
On 5.10.2011 09:09, Jan Beulich wrote:
On 19.01.11 at 19:40, Jeff Mahoney jeffm@suse.com wrote:
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.
Which makes me assume you build only a single config. For obvious(?) reasons I usually build two or three (native, Xen, and on some branches EC2).
Note that you are replying to an old patch that was wating in some mail spool and now got delivered :). The patch has been merged already.
--- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \
$(objtree)/Module.supported /dev/null)))
$(objtree)/Module.supported \
$(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
This patch makes sense, please commit it.
Acked-by: Michal Marek mmarek@suse.cz
Michal
On 05.10.11 at 11:24, Michal Marek mmarek@suse.cz wrote:
On 5.10.2011 09:09, Jan Beulich wrote:
On 19.01.11 at 19:40, Jeff Mahoney jeffm@suse.com wrote:
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.
Which makes me assume you build only a single config. For obvious(?) reasons I usually build two or three (native, Xen, and on some branches EC2).
Note that you are replying to an old patch that was wating in some mail spool and now got delivered :). The patch has been merged already.
Ooops...
--- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \
$(objtree)/Module.supported /dev/null)))
$(objtree)/Module.supported \
$(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
This patch makes sense, please commit it.
Acked-by: Michal Marek mmarek@suse.cz
Any objection to also do this for SLE11 SP2?
Jan
On 5.10.2011 12:13, Jan Beulich wrote:
On 05.10.11 at 11:24, Michal Marek mmarek@suse.cz wrote:
--- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \
$(objtree)/Module.supported /dev/null)))
$(objtree)/Module.supported \
$(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
This patch makes sense, please commit it.
Acked-by: Michal Marek mmarek@suse.cz
Any objection to also do this for SLE11 SP2?
Go ahead.
Michal
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/05/2011 05:24 AM, Michal Marek wrote:
On 5.10.2011 09:09, Jan Beulich wrote:
On 19.01.11 at 19:40, Jeff Mahoney jeffm@suse.com wrote:
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.
Which makes me assume you build only a single config. For obvious(?) reasons I usually build two or three (native, Xen, and on some branches EC2).
Note that you are replying to an old patch that was wating in some mail spool and now got delivered :). The patch has been merged already.
This was my fault. I was sending out my btrfs patch queue and used the wrong mbox file. *embarrassed*
- -Jeff
--- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \ - $(objtree)/Module.supported /dev/null))) + $(objtree)/Module.supported \ + $(srctree)/Module.supported /dev/null)))
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s
This patch makes sense, please commit it.
Acked-by: Michal Marek mmarek@suse.cz
Michal
- -- Jeff Mahoney SUSE Labs
One of the things I need to do every time I set up a new build directory or update the source tree is copy the config file over from the git repo.
This patchs adds a --config=ARCH-FLAVOR option that copies it automatically.
If the config does not exist, it is not considered a fatal error.
Signed-off-by: Jeff Mahoney jeffm@suse.com --- scripts/sequence-patch.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -40,7 +40,7 @@ usage() { cat <<END SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] - [--build-dir=PATH] + [--build-dir=PATH] [--config=ARCH-FLAVOR]
The --build-dir option supports internal shell aliases, like ~, and variable expansion when the variables are properly escaped. Environment variables @@ -49,6 +49,10 @@ SYNOPSIS: $0 [-qv] [--symbol=...] [--dir $SRCVERSION: The current linux source tarball version $TAG: The current tag or branch of this repo $EXT: A string expanded from current $EXTRA_SYMBOLS + With --config=ARCH-FLAVOR, these have values. Otherwise they are empty. + $CONFIG: The current ARCH-FLAVOR. + $CONFIG_ARCH: The current ARCH. + $CONFIG_FLAVOR: The current FLAVOR. END exit 1 } @@ -61,7 +65,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,build-dir: -- "$@"` +options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir:,config: -- "$@"`
if [ $? -ne 0 ] then @@ -77,6 +81,9 @@ COMBINE= FAST= VANILLA=false SP_BUILD_DIR= +CONFIG= +CONFIG_ARCH= +CONFIG_FLAVOR=
while true; do case "$1" in @@ -122,6 +129,10 @@ while true; do SP_BUILD_DIR="$2" shift ;; + --config) + CONFIG="$2" + shift + ;; --) shift break ;; @@ -137,6 +148,16 @@ if [ $# -ge 1 ]; then shift fi
+if test -n "$CONFIG"; then + CONFIG_ARCH=${CONFIG%%-*} + CONFIG_FLAVOR=${CONFIG##*-} + if [ "$CONFIG" = "$CONFIG_ARCH" -o "$CONFIG" = "$CONFIG_FLAVOR" -o \ + -z "$CONFIG_ARCH" -o -z "$CONFIG_FLAVOR" ]; then + echo "Invalid config spec: --config=ARCH-FLAVOR is expected." + usage + fi +fi + if [ $# -ne 0 ]; then usage fi @@ -473,6 +494,15 @@ if test -e supported.conf; then scripts/guards base external < supported.conf > "$SP_BUILD_DIR/Module.supported" fi
+if test -n "$CONFIG"; then + if test -e "config/$CONFIG_ARCH/$CONFIG_FLAVOR"; then + echo "[ Copying config/$CONFIG_ARCH/$CONFIG ]" + cp -a "config/$CONFIG_ARCH/$CONFIG_FLAVOR" "$SP_BUILD_DIR/.config" + else + echo "[ Config $CONFIG does not exist. ]" + fi +fi + [ $# -gt 0 ] && exit $status
if ! $have_defconfig_files || test ! -e config.conf; then
Now that we have arch and flavor information via the --config option, we can do things like automatically expand the kABI references.
This patch uses that information to expand the references into the build directory. Missing kABI references are not considered a fatal error.
Signed-off-by: Jeff Mahoney jeffm@suse.com --- scripts/sequence-patch.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -40,7 +40,7 @@ usage() { cat <<END SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] - [--build-dir=PATH] [--config=ARCH-FLAVOR] + [--build-dir=PATH] [--config=ARCH-FLAVOR [--kabi]]
The --build-dir option supports internal shell aliases, like ~, and variable expansion when the variables are properly escaped. Environment variables @@ -64,7 +64,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,build-dir:,config: -- "$@"` +options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir:,config:,kabi -- "$@"`
if [ $? -ne 0 ] then @@ -83,6 +83,7 @@ SP_BUILD_DIR= CONFIG= CONFIG_ARCH= CONFIG_FLAVOR= +KABI=false
while true; do case "$1" in @@ -132,6 +133,9 @@ while true; do CONFIG="$2" shift ;; + --kabi) + KABI=true + ;; --) shift break ;; @@ -500,6 +504,18 @@ if test -n "$CONFIG"; then else echo "[ Config $CONFIG does not exist. ]" fi + + if $KABI; then + if [ ! -x rpm/modversions ]; then + echo "[ This branch does not support the modversions kABI mechanism. Skipping. ]" + elif [ -e "kabi/$CONFIG_ARCH/symtypes-$CONFIG_FLAVOR" ]; then + echo "[ Expanding kABI references for $CONFIG ]" + rpm/modversions --unpack "$SP_BUILD_DIR" < \ + "kabi/$CONFIG_ARCH/symtypes-$CONFIG_FLAVOR" + else + echo "[ No kABI references for $CONFIG ]" + fi + fi fi
[ $# -gt 0 ] && exit $status
This patch adds a --ctags option which automatically invokes "make tags" in the build directory.
Signed-off-by: Jeff Mahoney jeffm@suse.com --- scripts/sequence-patch.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -40,7 +40,7 @@ usage() { cat <<END SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] - [--build-dir=PATH] [--config=ARCH-FLAVOR [--kabi]] + [--build-dir=PATH] [--config=ARCH-FLAVOR [--kabi]] [--ctags]
The --build-dir option supports internal shell aliases, like ~, and variable expansion when the variables are properly escaped. Environment variables @@ -64,7 +64,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,build-dir:,config:,kabi -- "$@"` +options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir:,config:,kabi,ctags -- "$@"`
if [ $? -ne 0 ] then @@ -84,6 +84,7 @@ CONFIG= CONFIG_ARCH= CONFIG_FLAVOR= KABI=false +CTAGS=false
while true; do case "$1" in @@ -136,6 +137,9 @@ while true; do --kabi) KABI=true ;; + --ctags) + CTAGS=true + ;; --) shift break ;; @@ -518,6 +522,15 @@ if test -n "$CONFIG"; then fi fi
+if $CTAGS; then + if ctags --version > /dev/null; then + echo "[ Generating ctags (this may take a while)]" + make -s --no-print-directory -C "$PATCH_DIR" O="$SP_BUILD_DIR" tags + else + echo "[ Could not generate ctags: ctags not found ]" + fi +fi + [ $# -gt 0 ] && exit $status
if ! $have_defconfig_files || test ! -e config.conf; then
This patch adds a --cscope option which automatically invokes "make cscope" in the build directory.
Signed-off-by: Jeff Mahoney jeffm@suse.com --- scripts/sequence-patch.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -41,6 +41,7 @@ usage() { SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] [--build-dir=PATH] [--config=ARCH-FLAVOR [--kabi]] [--ctags] + [--cscope]
The --build-dir option supports internal shell aliases, like ~, and variable expansion when the variables are properly escaped. Environment variables @@ -64,7 +65,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,build-dir:,config:,kabi,ctags -- "$@"` +options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir:,config:,kabi,ctags,cscope -- "$@"`
if [ $? -ne 0 ] then @@ -85,6 +86,7 @@ CONFIG_ARCH= CONFIG_FLAVOR= KABI=false CTAGS=false +CSCOPE=false
while true; do case "$1" in @@ -140,6 +142,9 @@ while true; do --ctags) CTAGS=true ;; + --cscope) + CSCOPE=true + ;; --) shift break ;; @@ -531,6 +536,15 @@ if $CTAGS; then fi fi
+if test -n "$CSCOPE"; then + if cscope -V 2> /dev/null; then + echo "[ Generating cscope db (this may take a while)]" + make -s --no-print-directory -C "$PATCH_DIR" O="$SP_BUILD_DIR" cscope + else + echo "[ Could not generate cscope db: cscope not found ]" + fi +fi + [ $# -gt 0 ] && exit $status
if ! $have_defconfig_files || test ! -e config.conf; then
On Wed, Jan 19, 2011 at 01:40:50PM -0500, Jeff Mahoney wrote:
- Issues addressed in patchset #2:
- Help text is now a here document for easy addition of more documentation
- Explanation of which variables are allowed by --build-dir
- Missing rpm/modversions script is not an error on older branches
- Missing symvers files are not errors
- Uses true/false for simple feature flags
Applied to the scripts branch and merged into master. If anyone needs the changes elsewhere, just run 'git merge origin/scripts'.
Michal
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01/22/2011 10:12 AM, Michal Marek wrote:
On Wed, Jan 19, 2011 at 01:40:50PM -0500, Jeff Mahoney wrote:
- Issues addressed in patchset #2:
- Help text is now a here document for easy addition of more documentation
- Explanation of which variables are allowed by --build-dir
- Missing rpm/modversions script is not an error on older branches
- Missing symvers files are not errors
- Uses true/false for simple feature flags
Applied to the scripts branch and merged into master. If anyone needs the changes elsewhere, just run 'git merge origin/scripts'.
Great. Thanks.
- -Jeff
- -- Jeff Mahoney SUSE Labs