From: jkratoch <> Date: Sun, 25 Oct 2009 15:21:59 +0000 (+0000) Subject: Support --cd force suffix "!" for CVS distros not present in local mock. X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=ce12196ae9687a586a4516deafeb4bae7e15d9f9 Support --cd force suffix "!" for CVS distros not present in local mock. Fix testsuite output paths normalization even for other componenets (as gdbcvs). --- diff --git a/bin/hammock b/bin/hammock index 19ba50b..fdf25c8 100755 --- a/bin/hammock +++ b/bin/hammock @@ -76,9 +76,10 @@ error "Excessive arguments: @ARGV" if @ARGV; my $path=join(":",@path) if @path; @componentdistro and @componentdistro!=@distro and die "--cd|--componentdistro must have the same elements count as -d|--distro"; -sub distro_normalize($) +sub distro_normalize($;$) { - local $_=$_[0]; + my($name,$force)=@_; + local $_=$name; s{^/var/lib/mock/+}{}; s{/+$}{}; @@ -92,7 +93,7 @@ sub distro_normalize($) for my $arch (@archuse?@archuse:@arch) { my $dir="/var/lib/mock/$_-$arch"; - -d $dir or error "No distro: $dir"; + $force or -d $dir or error "No distro: $dir"; } return ($_,@archuse); @@ -105,7 +106,8 @@ for my $distroi (0..$#distro) { my $componentdistro=$componentdistro[$distroi]; my @archuse; if ($componentdistro) { - ($componentdistro,@archuse)=distro_normalize $componentdistro; + my $force=($componentdistro=~s/!$//); + ($componentdistro,@archuse)=distro_normalize $componentdistro,$force; @archuse and die "--cd|--componentdistro must have no arch: ".join(" ",@archuse); } ($distro,@archuse)=distro_normalize $distro; @@ -349,13 +351,6 @@ while (@distrouse || keys(%child)) { if ($component eq "binutilscvs") { mockrun "cd $baretestsuite; $errs1; errs2; ulimit -c unlimited; orphanripper make -k check || :; mkdir $out; ".q{for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log};do ln $file}." $out/binutils-$distro-".q{$(basename $file) || :; done;}; - - # gdbunpack does: - # perl -i -pe 's{\Q'"$HOME"'\E/.*?/build/[^/]*/}{}g' "$base"/* - my $HOME=$ENV{"HOME"}; - for my $file (<$out/*>) { - subst sub { s{\Q$HOME\E/.*?/build/[^/]*/}{}g; },$file; - } } else { my @check=($distro=~/-x86_64/ ? qw(-m64 -m32) : -m32); @check=map("check//unix/$_",@check); @@ -364,6 +359,12 @@ while (@distrouse || keys(%child)) { # for i in ".join(" ",@check).";do orphanripper make -k \$i || :;done mockrun "cd $baretestsuite; $errs1; errs2; cd gdb; ulimit -c unlimited; orphanripper make -k ".join(" ",@check)." || :; mkdir $out; ".q{for t in sum log;do for file in testsuite*/gdb.$t;do suffix="${file#testsuite.unix.}"; suffix="${suffix%/gdb.$t}"; ln $file}." $out/gdb-$distro".q{$suffix.$t || :; done; done;}; } + # gdbunpack does: + # perl -i -pe 's{\Q'"$HOME"'\E/.*?/build/[^/]*/}{}g' "$base"/* + my $HOME=$ENV{"HOME"}; + for my $file (<$out/*>) { + subst sub { s{\Q$HOME\E/.*?/build/[^/]*/}{}g; },$file; + } } else { die "internal error" if @target; }