From 5909604d55bb9161ecafc9f1ba601f2e15564ac3 Mon Sep 17 00:00:00 2001 From: Andreas Pakulat Date: Thu, 13 May 2010 16:00:33 +0000 Subject: [PATCH] Support specifying a builddir that deviates from the module-name/dest-dir. I'm doing this to support building multiple branches with git repositories from the same clone. With this change its possible to have this in the config: module kdevplatform branch master prefix /home/andreas/kdevelop repository git@gitorious.org:kdevelop/kdevplatform.git end module module kdevplatform-stable branch 1.0 manual-build true dest-build-dir kdevplatform-stable dest-dir kdevplatform prefix /home/andreas/kdevelop-stable repository git@gitorious.org:kdevelop/kdevplatform.git end module To build the stable and development branches of kdevplatform easily with kdesvn-build and without build-files interfering with one another. CCMAIL: mpyne@kde.org svn path=/trunk/KDE/kdesdk/scripts/kdesvn-build; revision=1126303 --- kdesvn-build | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/kdesvn-build b/kdesvn-build index f98096d..ae7c565 100755 --- a/kdesvn-build +++ b/kdesvn-build @@ -669,6 +669,30 @@ sub get_subdir_path return $dir; } + +# Subroutine to return the name of the destination directory for the +# build routines. Based on the dest-build-dir option. The return value will be +# relative to the build dir. The user may use the '$MODULE' or '${MODULE}' +# sequences, which will be replaced by the name of the module in question. +# +# The first parameter should be the module name. +sub get_dest_build_dir +{ + my $module = shift; + my $dest_dir = get_option($module, 'dest-build-dir'); + + if ($dest_dir eq '') + { + return get_dest_dir($module); + } + else + { + $dest_dir =~ s/(\${MODULE})|(\$MODULE\b)/$module/g; + + return $dest_dir; + } +} + # Subroutine to return the name of the destination directory for the checkout # and build routines. Based on the dest-dir option. The return value will be # relative to the src/build dir. The user may use the '$MODULE' or '${MODULE}' @@ -1228,6 +1252,7 @@ sub get_module_path_dir my $destdir = get_dest_dir($module); my $srcbase = get_source_dir($module); $srcbase = get_build_dir($module) if $type eq 'build'; + $destdir = get_dest_build_dir($module) if $type eq 'build'; my $combined = "$srcbase/$destdir";