diff options
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/build.pl | 20 | ||||
-rwxr-xr-x | solenv/bin/checkdll.sh | 2 | ||||
-rw-r--r-- | solenv/bin/cws.pl | 476 | ||||
-rwxr-xr-x | solenv/bin/deliver.pl | 6 | ||||
-rw-r--r-- | solenv/bin/mhids.pl | 35 | ||||
-rwxr-xr-x | solenv/bin/modules/Cws.pm | 3 | ||||
-rw-r--r-- | solenv/bin/modules/CwsConfig.pm | 92 | ||||
-rw-r--r-- | solenv/bin/modules/SourceConfig.pm | 2 | ||||
-rwxr-xr-x | solenv/bin/rpm-wrapper | 6 |
9 files changed, 609 insertions, 33 deletions
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl index 4c7f47e33cc3..40c310929eaa 100644 --- a/solenv/bin/build.pl +++ b/solenv/bin/build.pl @@ -59,6 +59,10 @@ require GenInfoParser; import GenInfoParser; require IO::Handle; import IO::Handle; }; + my $verbose_mode = 0; + if (defined $ENV{verbose} || defined $ENV{VERBOSE}) { + $verbose_mode = ($ENV{verbose} =~ /^t\S*$/i); + } my $enable_multiprocessing = 1; my $cygwin = 0; $cygwin++ if ($^O eq 'cygwin'); @@ -856,7 +860,8 @@ sub dmake_dir { print "$dmake\n"; print $check_error_string; } else { - print "$BuildDir\n"; + print "\n" if ( ! $show ); + print "Entering $BuildDir\n"; }; RemoveFromDependencies($BuildDir, \%LocalDepsHash) if (!$child); return if ($cmd_file || $show); @@ -1686,6 +1691,9 @@ sub get_options { # Default build modes(for OpenOffice.org) $ENV{BUILD_TYPE} = 'OOo EXT' if (!defined $ENV{BUILD_TYPE}); @ARGV = @dmake_args; + foreach $arg (@dmake_args) { + $arg =~ /^verbose=(\S+)$/i and $verbose_mode = ($1 =~ /^t\S*$/i); + } }; sub get_module_and_buildlist_paths { @@ -1867,7 +1875,7 @@ sub clear_from_child { html_store_job_info($folders_hashes{$child_nick}, $child_nick, $error_code); $running_children{$folders_hashes{$child_nick}}--; delete $processes_hash{$pid}; - print 'Running processes: ' . children_number() . "\n"; + $verbose_mode && print 'Running processes: ' . children_number() . "\n"; }; # @@ -1890,7 +1898,7 @@ sub BuildDependent { start_child($child_nick, $dependencies_hash) if ($child_nick); return 1 if ($BuildAllParents); $child_nick = pick_prj_to_build($dependencies_hash); - } while (scalar keys %$dependencies_hash); + } while (scalar keys %$dependencies_hash || $child_nick); while (children_number()) { # print "#### 1902: Starting waiting for dead child\n"; handle_dead_children(1); @@ -1935,7 +1943,7 @@ sub start_child { select $oldfh; $processes_hash{$pid} = $job_dir; $children_running = children_number(); - print 'Running processes: ', $children_running, "\n"; + $verbose_mode && print 'Running processes: ', $children_running, "\n"; $maximal_processes = $children_running if ($children_running > $maximal_processes); $folders_hashes{$job_dir} = $dependencies_hash; store_pid($dependencies_hash, $pid); @@ -3458,7 +3466,7 @@ sub run_server { delete $clients_times{$pid}; clear_from_child($pid); delete $clients_jobs{$pid}; - print 'Running processes: ', children_number(), "\n"; + $verbose_mode && print 'Running processes: ', children_number(), "\n"; # Actually, next 3 strings are only for even distribution # of clients if there are more than one build server running print $new_socket_obj 'No job'; @@ -3483,7 +3491,7 @@ sub run_server { $clients_jobs{$pid} = $job_string; $clients_times{$pid} = time; $children_running = children_number(); - print 'Running processes: ', $children_running, "\n"; + $verbose_mode && print 'Running processes: ', $children_running, "\n"; $maximal_processes = $children_running if ($children_running > $maximal_processes); } else { print $new_socket_obj 'No job'; diff --git a/solenv/bin/checkdll.sh b/solenv/bin/checkdll.sh index 878ad2606788..0400f461666e 100755 --- a/solenv/bin/checkdll.sh +++ b/solenv/bin/checkdll.sh @@ -77,7 +77,7 @@ if [ -x $checkdll ]; then export LD_LIBRARY_PATH;; esac - $checkdll "$*" + $checkdll "$@" if [ $? -ne 0 ]; then exit 1 ; fi for parameter in $*; do diff --git a/solenv/bin/cws.pl b/solenv/bin/cws.pl index ce6eaa015a91..96ea6610fa67 100644 --- a/solenv/bin/cws.pl +++ b/solenv/bin/cws.pl @@ -39,6 +39,7 @@ use Getopt::Long; use File::Basename; use File::Path; use Cwd; +use Benchmark; #### module lookup my @lib_dirs; @@ -58,6 +59,10 @@ use Cws; #### globals #### +# TODO: replace dummy vales with actual SVN->hg migration milestones +my $dev300_migration_milestone = 'm64'; +my $ooo320_migration_milestone = 'm999'; + # valid command with possible abbreviations my @valid_commands = ( 'help', 'h', '?', @@ -360,7 +365,13 @@ sub get_cws_by_name # Update masterws part of Cws object. my $masterws = $cws->get_mws(); - $cws->master($masterws); + if ( $cws->master() ne $masterws ) { + # can this still happen? + if ( $debug ) { + print STDERR "CWS-DEBUG: get_cws_by_name(): fixup of masterws in cws object detected\n"; + } + $cws->master($masterws); + } return ($cws); } @@ -426,6 +437,208 @@ sub register_child_workspace return 0; } +sub print_time_elapsed +{ + my $t_start = shift; + my $t_stop = shift; + + my $time_diff = timediff($t_stop, $t_start); + print_message("... finished in " . timestr($time_diff)); +} + +sub hgrc_append_push_path_and_hooks +{ + my $target = shift; + my $cws_source = shift; + + $cws_source =~ s/http:\/\//ssh:\/\/hg@/; + if ( $debug ) { + print STDERR "CWS-DEBUG: hgrc_append_push_path_and_hooks(): default-push path: '$cws_source'\n"; + } + if ( !open(HGRC, ">>$target/.hg/hgrc") ) { + print_error("Can't append to hgrc file of repository '$target'.\n", 88); + } + print HGRC "default-push = " . "$cws_source\n"; + print HGRC "[extensions]\n"; + print HGRC "hgext.win32text=\n"; + print HGRC "[hooks]\n"; + print HGRC "# Reject commits which would introduce windows-style CR/LF files\n"; + print HGRC "pretxncommit.crlf = python:hgext.win32text.forbidcrlf\n"; + close(HGRC); +} + +sub is_hg_strip_available +{ + my $profile = hg_show(); + + foreach (@{$profile}) { + if ( $_ =~ /hgext.mq=/ ) { + return 1; + } + } + return 0; +} + +sub hg_clone_repository +{ + my $rep_type = shift; + my $cws = shift; + my $target = shift; + my $clone_milestone_only = shift; + + my ($hg_local_source, $hg_lan_source, $hg_remote_source); + my $config = CwsConfig->new(); + if ( $rep_type eq 'ooo') { + $hg_local_source = $config->get_ooo_hg_local_source(); + $hg_lan_source = $config->get_ooo_hg_lan_source(); + $hg_remote_source = $config->get_ooo_hg_remote_source(); + } + else { + $hg_local_source = $config->get_so_hg_local_source(); + $hg_lan_source = $config->get_so_hg_lan_source(); + $hg_remote_source = $config->get_so_hg_remote_source(); + } + + my $masterws = $cws->master(); + my $master_local_source = "$hg_local_source/" . $masterws; + my $master_lan_source = "$hg_lan_source/" . $masterws; + + my $milestone_tag; + if ( $clone_milestone_only ) { + $milestone_tag = uc($masterws) . '_' . $clone_milestone_only; + } + else { + my @tags = $cws->get_tags(); + $milestone_tag = $tags[3]; + } + + if ( $debug ) { + print STDERR "CWS-DEBUG: master_local_source: '$master_local_source'\n"; + print STDERR "CWS-DEBUG: master_lan_source: '$master_lan_source'\n"; + if ( !-d $master_local_source ) { + print STDERR "CWS-DEBUG: not a directory '$master_local_source'\n"; + } + } + + # clone from local source if possible, otherwise from LAN source + if ( -d $master_local_source && can_use_hardlinks($master_local_source, dirname($target)) ) { + hg_local_clone_repository($master_local_source, $target, $milestone_tag); + } + else { + hg_lan_clone_repository($master_lan_source, $target, $milestone_tag); + } + + # now pull from the remote cws outgoing repository if it already contains something + if ( !$clone_milestone_only ) { + my $cws_remote_source = "$hg_remote_source/cws/" . $cws->child(); + + # The outgoing repository might not yet be available. Which is not + # an error. Since pulling from the cws outgoing URL results in an ugly + # and hardly understandable error message, we check for the availaility + # first. TODO: incorporate configured proxy instead of env_proxy. Use + # a dedicated request and content-type to find out if the repo is there + # instead of parsing the content of the page + require LWP::Simple; + my $content = LWP::Simple::get($cws_remote_source); + my $pattern = "<title>cws/". $cws->child(); + if ( $content =~ /$pattern/ ) { + hg_remote_pull_repository($cws_remote_source, $target); + } + else { + print_message("The 'outgoing' repository '$cws_remote_source' is not accessible/available"); + } + hgrc_append_push_path_and_hooks($target, $cws_remote_source); + } + + # update the result + hg_update_repository($target); + +} + +sub hg_local_clone_repository +{ + my $local_source = shift; + my $dest = shift; + my $milestone_tag = shift; + + # fastest way to clone a repository up to a certain milestone + # 1) clone w/o -r options (hard links!) + # 2) find (local) revision which corresponds to milestone + # 3) strip revision+1 + + my $t1 = Benchmark->new(); + print_message("... clone LOCAL repository '$local_source' to '$dest'"); + hg_clone($local_source, $dest, '-U'); + my $id_option = "-n -r $milestone_tag"; + my $revision = hg_ident($dest, $milestone_tag); + if ( defined($revision) ) { + my $strip_revision = $revision+1; + hg_strip($dest, $revision); + } + my $t2 = Benchmark->new(); + print_time_elapsed($t1, $t2); +} + +sub hg_lan_clone_repository +{ + my $lan_source = shift; + my $dest = shift; + my $milestone_tag = shift; + + my $t1 = Benchmark->new(); + print_message("... clone LAN repository '$lan_source' to '$dest'"); + hg_clone($lan_source, $dest, "-U -r $milestone_tag"); + my $t2 = Benchmark->new(); + print_time_elapsed($t1, $t2); +} + +sub hg_remote_pull_repository +{ + my $remote_source = shift; + my $dest = shift; + + my $t1 = Benchmark->new(); + print_message("... pull from REMOTE repository '$remote_source' to '$dest'"); + hg_pull($dest, $remote_source); + my $t2 = Benchmark->new(); + print_time_elapsed($t1, $t2); +} + +sub hg_update_repository +{ + my $dest = shift; + + my $t1 = Benchmark->new(); + print_message("... update repository '$dest'"); + hg_update($dest); + my $t2 = Benchmark->new(); + print_time_elapsed($t1, $t2); +} + +# Check if clone source and destination are on the same filesystem, +# in that case hg clone can employ hard links. +sub can_use_hardlinks +{ + my $source = shift; + my $dest = shift; + + if ( $^O eq 'cygwin' ) { + # no hard links on windows + return 0; + } + # st_dev is the first field return by stat() + my @stat_source = stat($source); + my @stat_dest = stat($dest); + + if ( $debug ) { + print STDERR "can_use_hardlinks(): source device: '$stat_source[0]', destination device: '$stat_dest[0]'\n"; + } + if ( $stat_source[0] == $stat_dest[0] ) { + return 1; + } + return 0; +} + sub query_cws { my $query_mode = shift; @@ -530,7 +743,6 @@ sub query_scm print_message("Child workspace uses '$scm'."); } } - return; } @@ -1217,6 +1429,49 @@ sub diff_print_files } } +# TODO: special provisions for SVN->HG migrations, remove this +# some time after migration +sub get_scm_for_milestone +{ + my $masterws = shift; + my $milestone = shift; + + my $milestone_sequence_number = extract_milestone_sequence_number($milestone); + my $dev300_migration_sequence_number = extract_milestone_sequence_number($dev300_migration_milestone); + my $ooo320_migration_sequence_number = extract_milestone_sequence_number($ooo320_migration_milestone); + + my $scm = 'SVN'; + + if ( $masterws eq 'DEV300' ) { + if ( $milestone_sequence_number >= $dev300_migration_sequence_number ) { + $scm = 'HG'; + } + } + elsif ( $masterws eq 'OOO320' ) { + if ( $milestone_sequence_number >= $ooo320_migration_sequence_number ) { + $scm = 'HG'; + } + } + else { + $scm = 'SVN' + } + return $scm; +} + +sub extract_milestone_sequence_number +{ + my $milestone = shift; + + my $milestone_sequence_number; + if ( $milestone =~ /m(\d+)/ ) { + $milestone_sequence_number = $1; + } + else { + print_error("can't extract milestone sequence number from milestone '$milestone'", 99); + } + return $milestone_sequence_number; +} + # Executes the help command. sub do_help { @@ -1458,6 +1713,14 @@ sub do_create return; } + # Refuse to create Subversion hosted cildworkspaces after + # migration milestone + my $milestone_scm = get_scm_for_milestone($cws->master(), $cws->milestone()); + if ( $milestone_scm eq 'HG' ) { + print_error("This code line has been migrated to Mercurial.", 0); + print_error("Please use the '--hg' option to create a Mercurial hosted CWS.", 8); + } + my $config = CwsConfig->new(); my $ooo_svn_server = $config->get_ooo_svn_server(); my $so_svn_server = $config->get_so_svn_server(); @@ -1590,6 +1853,7 @@ sub do_rebase } my $cws = get_cws_from_environment(); + my $old_masterws = $cws->master(); my $new_masterws; my $new_milestone; @@ -1623,6 +1887,17 @@ sub do_rebase do_help(['rebase']); } + if ( $cws->get_scm() eq 'HG' ) { + my $child = $cws->child(); + print_error("cws rebase is not supported for mercurial based childworkspaces", 0); + print_error("re-synchronize your CWS with:", 0); + print_error("hg pull <master>", 0); + print_error("hg merge", 0); + print_error("hg commit -m\"$child: merge with $new_masterws $new_milestone\"", 0); + print_error("and update EIS with:", 0); + print_error("cws setcurrent -m $new_milestone", 99); + } + my $so_setup = 0; my $ooo_path; my $so_path; @@ -1772,6 +2047,7 @@ sub do_fetch my $args_ref = shift; my $options_ref = shift; + my $time_fetch_start = Benchmark->new(); if ( exists $options_ref->{'help'} || @{$args_ref} != 1) { do_help(['fetch']); } @@ -1794,7 +2070,7 @@ sub do_fetch } if ( defined($platforms) && $switch ) { - print_error("Option '-p' is not yet usuable with Option '-s'. Will be fixed RSN.", 0); + print_error("Option '-p' is not usuable with Option '-s'.", 0); do_help(['fetch']); } @@ -1810,6 +2086,7 @@ sub do_fetch } $cws->master($masterws); my $milestone; + my $scm; if( defined($milestone_opt) ) { if ( $milestone_opt eq 'latest' ) { $cws->master($masterws); @@ -1823,16 +2100,36 @@ sub do_fetch else { ($masterws, $milestone) = verify_milestone($cws, $milestone_opt); } + $scm = get_scm_for_milestone($masterws, $milestone); } elsif ( defined($child) ) { $cws = get_cws_by_name($child); $masterws = $cws->master(); # CWS can have another master than specified in ENV $milestone = $cws->milestone(); + $scm = $cws->get_scm(); } else { do_help(['fetch']); } + if ( $switch && $scm eq 'HG' ) { + print_error("Option '-s' is not supported with a hg based CWS.", 0); + do_help(['fetch']); + } + + if ( $debug ) { + print STDERR "CWS-DEBUG: SCM: $scm\n"; + } + + if ( $scm eq 'HG' ) { + if ( !is_hg_strip_available() ) { + print_error("The 'cws fetch' command requires that 'hg strip' is enabled", 0); + print_error("Please add the following lines to your hg profile (\$HOME/.hgrc)", 0); + print_error("[extensions]", 0); + print_error("hgext.mq=", 33); + } + } + my $config = CwsConfig->new(); my $ooo_svn_server = $config->get_ooo_svn_server(); my $so_svn_server = $config->get_so_svn_server(); @@ -1886,11 +2183,12 @@ sub do_fetch } my $cwsname = $cws->child(); - my $url_suffix = $milestone_opt ? ("/tags/$masterws" . "_$milestone") : ('/cws/' . $cwsname); my $linkdir = $milestone_opt ? "src.$milestone" : "src." . $cws->milestone; my $workspace = $args_ref->[0]; + if ( !$onlysolver ) { + my $url_suffix = $milestone_opt ? ("/tags/$masterws" . "_$milestone") : ('/cws/' . $cwsname); if ( $switch ) { # check if to be switched working copy exist or bail out if ( ! -d $workspace ) { @@ -1942,8 +2240,11 @@ sub do_fetch print_error("File or directory '$workspace' already exists.", 8); } - # Check if working directory already exists + if ( !(($scm eq 'SVN') || ($scm eq 'HG')) ) { + print_error("Unsupported SCM '$scm'.", 8); + } + my $clone_milestone_only = $milestone_opt ? $milestone : 0; if ( defined($so_svn_server) ) { if ( !mkdir($workspace) ) { print_error("Can't create directory '$workspace': $!.", 8); @@ -1952,11 +2253,17 @@ sub do_fetch if ( !mkdir($work_master) ) { print_error("Can't create directory '$work_master': $!.", 8); } - print_message("... checkout '$ooo_url' to '$work_master/ooo'"); - svn_checkout($ooo_url, "$work_master/ooo", $quiet); - my $so_url = $so_svn_server . $url_suffix; - print_message("... checkout '$so_url' to '$work_master/sun'"); - svn_checkout($so_url, "$work_master/sun", $quiet); + if ( $scm eq 'SVN' ) { + print_message("... checkout '$ooo_url' to '$work_master/ooo'"); + svn_checkout($ooo_url, "$work_master/ooo", $quiet); + my $so_url = $so_svn_server . $url_suffix; + print_message("... checkout '$so_url' to '$work_master/sun'"); + svn_checkout($so_url, "$work_master/sun", $quiet); + } + else{ + hg_clone_repository('ooo', $cws, "$work_master/ooo", $clone_milestone_only); + hg_clone_repository('so', $cws, "$work_master/sun", $clone_milestone_only); + } my $linkdir = "$work_master/src.$milestone"; if ( !mkdir($linkdir) ) { print_error("Can't create directory '$linkdir': $!.", 8); @@ -1964,8 +2271,13 @@ sub do_fetch relink_workspace($linkdir); } else { - print_message("... checkout '$ooo_url' to '$workspace'"); - svn_checkout($ooo_url, $workspace, $quiet); + if ( $scm eq 'SVN' ) { + print_message("... checkout '$ooo_url' to '$workspace'"); + svn_checkout($ooo_url, $workspace, $quiet); + } + else { + hg_clone_repository('ooo', $cws, $workspace, $clone_milestone_only); + } } } } @@ -1983,10 +2295,16 @@ sub do_fetch } } foreach(@platforms) { + my $time_solver_start = Benchmark->new(); print_message("... copying platform solver '$_'."); update_solver($_, $prebuild_dir, $solver, $milestone); + my $time_solver_stop = Benchmark->new(); + print_time_elapsed($time_solver_start, $time_solver_stop); } } + my $time_fetch_stop = Benchmark->new(); + my $time_fetch = timediff($time_fetch_stop, $time_fetch_start); + print_message("cws fetch: total time required " . timestr($time_fetch)); } sub do_query @@ -2608,4 +2926,138 @@ sub execute_svnversion_command return $result; } + +### HG glue ### + +sub hg_clone +{ + my $source = shift; + my $dest = shift; + my $options = shift; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg clone: '$source -> $dest', options: '$options'\n"; + } + + # The to be cloned revision might not yet be avaliable. In this case clone + # the available tip. + my @result = execute_hg_command(0, 'clone', $options, $source, $dest); + if ( defined($result[0]) && $result[0] =~ /abort: unknown revision/ ) { + $options =~ s/-r \w+//; + @result = execute_hg_command(1, 'clone', $options, $source, $dest); + } + return @result; +} + +sub hg_ident +{ + my $repository = shift; + my $rev_id = shift; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg ident: 'repository', revision: '$rev_id'\n"; + } + + my @result = execute_hg_command(0, 'ident', "--cwd $repository", "-n -r $rev_id"); + my $line = $result[0]; + if ($line =~ /abort: unknown revision/) { + return undef; + } + else { + chomp($line); + return $line; + } +} + +sub hg_strip +{ + my $repository = shift; + my $rev_id = shift; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg strip: 'repository', revision: '$rev_id'\n"; + } + + my @result = execute_hg_command(1, 'strip', "--cwd $repository", '-n', $rev_id); + my $line = $result[0]; + if ($line =~ /abort: unknown revision/) { + return undef; + } + else { + chomp($line); + return $line; + } +} + +sub hg_pull +{ + my $repository = shift; + my $remote = shift; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg pull: 'repository', remote: '$remote'\n"; + } + + my @result = execute_hg_command(0, 'pull', "--cwd $repository", $remote); + my $line = $result[0]; + if ($line =~ /abort: /) { + return undef; + } +} + +sub hg_update +{ + my $repository = shift; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg update: 'repository'\n"; + } + + my @result = execute_hg_command(1, 'update', "--cwd $repository"); + return @result; +} + +sub hg_show +{ + if ( $debug ) { + print STDERR "CWS-DEBUG: ... hg show\n"; + } + my $result = execute_hg_command(0, 'show', ''); + return $result; +} + +sub execute_hg_command +{ + my $terminate_on_rc = shift; + my $command = shift; + my $options = shift; + my @args = @_; + + my $args_str = join(" ", @args); + + # we can only parse english strings, hopefully a C locale is available everywhere + $ENV{LC_ALL}='C'; + $command = "hg $command $options $args_str"; + + if ( $debug ) { + print STDERR "CWS-DEBUG: ... execute command line: '$command'\n"; + } + + my @result; + open(OUTPUT, "$command 2>&1 |") or print_error("Can't execute mercurial command line client", 98); + while (<OUTPUT>) { + push(@result, $_); + } + close(OUTPUT); + + my $rc = $? >> 8; + + if ( $rc > 0 && $terminate_on_rc) { + print STDERR @result; + print_error("The mercurial command line client failed with exit status '$rc'", 99); + } + return wantarray ? @result : \@result; +} + + # vim: set ts=4 shiftwidth=4 expandtab syntax=perl: diff --git a/solenv/bin/deliver.pl b/solenv/bin/deliver.pl index 23fe16f2e5e6..611a08a47f62 100755 --- a/solenv/bin/deliver.pl +++ b/solenv/bin/deliver.pl @@ -400,8 +400,6 @@ sub parse_options { my $arg; my $dontdeletecommon = 0; - $opt_silent = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'FALSE'); - $opt_verbose = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'TRUE'); while ( $arg = shift @ARGV ) { $arg =~ /^-force$/ and $opt_force = 1 and next; $arg =~ /^-minor$/ and $opt_minor = 1 and next; @@ -422,13 +420,15 @@ sub parse_options } $dest = $arg; } + $opt_silent = 1 if ( !defined $ENV{VERBOSE} || (defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'FALSE')) && ( ! $opt_verbose ); + $opt_verbose = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'TRUE') && ( ! $opt_silent ); # $dest and $opt_zip or $opt_delete are mutually exclusive if ( $dest and ($opt_zip || $opt_delete) ) { usage(1); } # $opt_silent and $opt_check or $opt_verbose are mutually exclusive if ( ($opt_check or $opt_verbose) and $opt_silent ) { - print STDERR "Error on command line: options '-check' and '-quiet' are mutually exclusive.\n"; + print STDERR "Error on command line: options '-check'/'-verbose' and '-quiet' are mutually exclusive.\n"; usage(1); } if ($dontdeletecommon) { diff --git a/solenv/bin/mhids.pl b/solenv/bin/mhids.pl index f7e5193a3ec4..c6fc230cabd4 100644 --- a/solenv/bin/mhids.pl +++ b/solenv/bin/mhids.pl @@ -37,6 +37,7 @@ my $srs; my $prjname; my $defs; my $solarincludes; +my $verbose = 0; my $debug = 0; my $filebase; @@ -82,7 +83,7 @@ sub setcompiler $preprocess_flag = "-E"; # preprocess to stdout } elsif ( "$whichcom" eq "MSC" ) { $appext = ".exe"; # windows for now - $compiler = "cl"; + $compiler = "cl -nologo"; $outbin_flag = "-Fe"; $outobj_flag = "-Fo"; $objext = ".obj"; @@ -109,9 +110,24 @@ sub setcompiler } #--------------------------------------------------- -$filename = shift @ARGV; -$srs = shift @ARGV; -$prjname = shift @ARGV; +$filename = undef; +$srs = undef; +$prjname = undef; + +my @expectedArgs = ( \$filename, \$srs, \$prjname ); +my $expectedArgsIndex = 0; +while ( ( $#ARGV >= 0 ) && ( $expectedArgsIndex < 3 ) ) +{ + $_ = shift @ARGV; + if ( /^-verbose$/ ) + { + $verbose = 1; + next; + } + ${$expectedArgs[ $expectedArgsIndex ]} = $_; + ++$expectedArgsIndex; +} + $defs = join " ",@ARGV if ($#ARGV); if ( !defined $prjname ) { die "ERROR - check usage\n"; } @@ -144,7 +160,7 @@ $workfile = "$tmpdir/${filebase}_".$$; # now get $workfile ready for shell usage... $shell_workfile = $workfile; -print "workfile: $workfile\n"; +print "workfile: $workfile\n" if $verbose; #remove old objects which remained in place by a former bug unlink "$workfile.obj"; @@ -175,15 +191,16 @@ if ( defined $ENV{"NO_HID_FILES"} ) { #echo "perl5 -p -e "s/=[ \t]*\".*\"/=\"\"/go; s/\".*\"[ \t]*;/\"\" ;/go ; s/(\".*)\/\/(.*\")/$1\/\\\/$2/go ;" < %filename% > %srs%\%workfile%.c0" #call perl5 -p -e "s/=[ \t]*\".*\"/=\"\"/go; s/\".*\"[ \t]*;/\"\" ;/go ; s/(\".*)\/\/(.*\")/$1\/\\\/$2/go ;" < %filename% > %srs%\%workfile%.c0 -print "$ENV{SOLARBINDIR}/hidc $filename ${shell_workfile}.c1 $prjname \n"; -$ret = system "$ENV{SOLARBINDIR}/hidc $filename ${shell_workfile}.c1 $prjname"; +my $verboseSwitch = $verbose ? "-verbose" : ""; +print "$ENV{SOLARBINDIR}/hidc $verboseSwitch $filename ${shell_workfile}.c1 $prjname\n" if $verbose; +$ret = system "$ENV{SOLARBINDIR}/hidc $verboseSwitch $filename ${shell_workfile}.c1 $prjname"; if ( $ret ) { push @cleanuplist, ".c1"; cleandie("ERROR - calling \"hidc\" failed"); } push @cleanuplist, ".c1"; -print "$compiler $solarincludes $defs $preprocess_flag ${shell_workfile}.c1 > ${shell_workfile}.c2\n"; +print "$compiler $solarincludes $defs $preprocess_flag ${shell_workfile}.c1 > ${shell_workfile}.c2\n" if $verbose; $ret = system "$compiler $solarincludes $defs $preprocess_flag ${shell_workfile}.c1 > ${shell_workfile}.c2"; if ( $ret ) { push @cleanuplist, ".c2"; @@ -226,7 +243,7 @@ if ( $outobj_flag ne "" ) { $outobj_param = "$outobj_flag${shell_workfile}$objext"; } -print "$compiler $solarincludes $defs ${shell_workfile}.c $outobj_param $outbin_flag${shell_workfile}$appext \n"; +print "$compiler $solarincludes $defs ${shell_workfile}.c $outobj_param $outbin_flag${shell_workfile}$appext \n" if $verbose; $ret = system "$compiler $solarincludes $defs ${shell_workfile}.c $outobj_param $outbin_flag${shell_workfile}$appext"; if ( $ret ) { push @cleanuplist, "$appext"; diff --git a/solenv/bin/modules/Cws.pm b/solenv/bin/modules/Cws.pm index d5516bd79e66..2ec5d13ff88c 100755 --- a/solenv/bin/modules/Cws.pm +++ b/solenv/bin/modules/Cws.pm @@ -1219,7 +1219,7 @@ sub register_child_with_eis }; if ( $@ ) { - carp("ERROR: create_child_wortkspace(): EIS database transaction failed. Reason:\n$@\n"); + carp("ERROR: create_child_workspace(): EIS database transaction failed. Reason:\n$@\n"); return undef; } # set EIS_ID directly, since $self->eis_id() is not @@ -1828,6 +1828,7 @@ sub set_scm_in_eis my $self = shift; my $scm_name = shift; + $scm_name = Eis::to_string($scm_name); # check if child workspace is valid my $id = $self->eis_id(); if ( !$id ) { diff --git a/solenv/bin/modules/CwsConfig.pm b/solenv/bin/modules/CwsConfig.pm index a346ba7d4d50..3574bc89e7a8 100644 --- a/solenv/bin/modules/CwsConfig.pm +++ b/solenv/bin/modules/CwsConfig.pm @@ -345,6 +345,98 @@ sub get_so_svn_server return $self->{SO_SVN_SERVER} ? $self->{SO_SVN_SERVER} : undef; } +#### HG methods #### + +sub get_ooo_hg_local_source +{ + my $self = shift; + + if ( !defined($self->{HG_LOCAL_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'HG_LOCAL_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{HG_LOCAL_SOURCE} = $source; + } + return $self->{HG_LOCAL_SOURCE} ? $self->{HG_LOCAL_SOURCE} : undef; +} + +sub get_ooo_hg_lan_source +{ + my $self = shift; + + if ( !defined($self->{HG_LAN_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'HG_LAN_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{HG_LAN_SOURCE} = $source; + } + return $self->{HG_LAN_SOURCE} ? $self->{HG_LAN_SOURCE} : undef; +} + +sub get_ooo_hg_remote_source +{ + my $self = shift; + + if ( !defined($self->{HG_REMOTE_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'HG_REMOTE_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{HG_REMOTE_SOURCE} = $source; + } + return $self->{HG_REMOTE_SOURCE} ? $self->{HG_REMOTE_SOURCE} : undef; +} + +sub get_so_hg_local_source +{ + my $self = shift; + + if ( !defined($self->{SO_HG_LOCAL_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LOCAL_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{SO_HG_LOCAL_SOURCE} = $source; + } + return $self->{SO_HG_LOCAL_SOURCE} ? $self->{SO_HG_LOCAL_SOURCE} : undef; +} + +sub get_so_hg_lan_source +{ + my $self = shift; + + if ( !defined($self->{SO_HG_LAN_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LAN_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{SO_HG_LAN_SOURCE} = $source; + } + return $self->{SO_HG_LAN_SOURCE} ? $self->{SO_HG_LAN_SOURCE} : undef; +} + +sub get_so_hg_remote_source +{ + my $self = shift; + + if ( !defined($self->{SO_HG_REMOTE_SOURCE}) ) { + my $config_file = $self->get_config_file(); + my $source = $config_file->{CWS_CONFIG}->{'SO_HG_REMOTE_SOURCE'}; + if ( !defined($source) ) { + $source = ""; + } + $self->{SO_HG_REMOTE_SOURCE} = $source; + } + return $self->{SO_HG_REMOTE_SOURCE} ? $self->{SO_HG_REMOTE_SOURCE} : undef; +} + #### Prebuild binaries configuration #### sub get_prebuild_binaries_location diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm index b1005b26d6c7..23d89d882bb8 100644 --- a/solenv/bin/modules/SourceConfig.pm +++ b/solenv/bin/modules/SourceConfig.pm @@ -322,7 +322,7 @@ SourceConfig::get_config_file_default_path() =head1 AUTHOR -Vladimir Glazunov, vg@openoffice.com +Vladimir Glazunov, vg@openoffice.org =head1 SEE ALSO diff --git a/solenv/bin/rpm-wrapper b/solenv/bin/rpm-wrapper index 1b523bb9b130..1c94bc0a9f10 100755 --- a/solenv/bin/rpm-wrapper +++ b/solenv/bin/rpm-wrapper @@ -40,6 +40,12 @@ then LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${LIBRARY_PATH?} \ ${BUILD_TOOLS?}/rpmbuild "$@" else +if [ "$OUTPATH" = "unxlngx6" ] +then +LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${LIBRARY_PATH?} \ + ${BUILD_TOOLS?}/rpmbuild "$@" +else LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${COMPATH?}/lib \ ${BUILD_TOOLS?}/rpm "$@" fi +fi |