From kde-commits Sat Jun 06 18:34:23 2009 From: Michael Pyne Date: Sat, 06 Jun 2009 18:34:23 +0000 To: kde-commits Subject: branches/work/kdesvn-build-1.10 Message-Id: <1244313263.950781.22681.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124431327422767 SVN commit 978308 by mpyne: - Use the "repository" option consistently for Qt git repository location. - In addition make the user specify the full repository name (i.e. URL) or, if it is not specified, assume official Qt is used. - If an error is encountered with updating, actually display the exception raised. M +41 -25 kdesvn-build --- branches/work/kdesvn-build-1.10/kdesvn-build #978307:978308 @@ -1918,10 +1918,13 @@ git_update_module($module) or die "Can't update $module: $!"; } else { - my $git_repo = get_option($module, 'git-repository'); - $git_repo = 'qt/qt.git' unless $git_repo; + my $git_repo = get_option($module, 'repository'); - git_clone_module($module, "git://qt.gitorious.org/$git_repo") or die "Can't checkout $module: $!"; + if (not $git_repo) { + die "Unable to checkout Qt, you must specify a repository to use."; + } + + git_clone_module($module, "$git_repo") or die "Can't checkout $module: $!"; } return 0; @@ -2595,30 +2598,46 @@ # module options to be available. # # First parameter is the module to get options for. -# Return is a hash containing the default module options, suitable for assignment -# to %package_opts. +# +# Return is a hash reference containing the default module options, suitable +# for assignment to %package_opts. sub default_module_options { my $module = shift; my $branch = default_module_branch($module); + my %options = ( + 'set-env' => { }, + ); # Hack to support default "tags" instead of default branches for kdesupport. + my $tagname = 'branch'; - my @opts; if ($branch =~ /^tags\//) { $branch =~ s/^tags\///; # Strip tags/ - @opts = ('tag', $branch); + $tagname = 'tag'; } - else - { - @opts = ('branch', $branch); + + $options{$tagname} = $branch; + + if ($module eq 'qt-copy') { + # Setup default options for qt-copy + my %qtcopy_opts = ( + 'configure-flags' => '-qt-gif -no-phonon -qdbus -nomake demos -nomake examples -fast', + 'repository' => 'git://qt.gitorious.org/qt/qt.git', + ); + + # Merge (uses Perl hash slice) + @options{keys %qtcopy_opts} = values %qtcopy_opts; + delete @options{qw/branch tag/}; # These don't apply to qt-copy git } - return { - 'set-env' => { }, - @opts, - }; + if ($module eq 'kdesupport') { + # Phonon is built separately as its own submodule + $options{'cmake-options'} = '-DBUILD_phonon=OFF'; + } + + return \%options; } # Subroutine to add a variable to the environment, but ONLY if it @@ -2695,17 +2714,6 @@ } } } - - # Setup default options for qt-copy - $package_opts{'qt-copy'} = { - 'configure-flags' => '-qt-gif -no-phonon -qdbus -nomake demos -nomake examples -fast', - 'branch' => default_module_branch('qt-copy'), - 'repository' => 'qt/qt.git', - 'set-env' => { }, - }; - - # kdesupport needs to be told to avoid phonon. - set_option('kdesupport', 'cmake-options', '-DBUILD_phonon=OFF'); } # Reads in the options from the config file and adds them to the option store. @@ -4335,6 +4343,7 @@ if ($@) { error "Error updating r[$module], removing from list of packages to build."; + error " > y[$@]"; dont_build ($module, $ipc); # Sends IPC message. $hadError = 1; } @@ -5612,6 +5621,13 @@ EOF $package_opts{$module} = default_module_options($module); } + + # This can happen if there *is* a config specified but the user + # did not specify a repository option. We can't default it in + # global because once KDE switches the default would be wrong. + if ($module eq 'qt-copy' and not get_option($module, 'repository')) { + set_option($module, 'repository', 'git://qt.gitorious.org/qt/qt.git'); + } } # Subroutine to exit the script cleanly, including removing any