Support binutilscvs.
authorjkratoch <>
Sun, 12 Jul 2009 08:00:34 +0000 (08:00 +0000)
committerjkratoch <>
Sun, 12 Jul 2009 08:00:34 +0000 (08:00 +0000)
bin/hammock

index 66c50f6..be33ac0 100755 (executable)
@@ -9,6 +9,7 @@ use Carp qw(&carp);
 my $start=time();
 
 my $gdbcvsbare=$ENV{"HOME"}."/redhat/gdb-cvs-bare";
+my $binutilscvsbare=$ENV{"HOME"}."/redhat/binutils-cvs-bare";
 my $archermaster=$ENV{"HOME"}."/redhat/master";
 my $fedoracvsroot=q{:pserver:anonymous:@cvs.fedoraproject.org:/cvs/pkgs};
 my $rhelcvsroot=q{:pserver:anonymous:@192.168.67.2:3401/cvs/dist};
@@ -46,7 +47,7 @@ die if !GetOptions(
   "s|srcrpm=s"=>\$srcrpm,
     "file=s{,}"=>\@file,
 );
-$component and ($component=~m{^(?:(?:fedora|rhel)(?:gdb|binutils|glibc)|gdbcvs|archer-.*|/home/.*)$} or die "-c|--component required to be: fedoragdb|rhelgdb|fedorabinutils|rhelbinutils|fedoraglibc|rhelglibc|gdbcvs|archer-*|/home/*");
+$component and ($component=~m{^(?:(?:fedora|rhel)(?:gdb|binutils|glibc)|gdbcvs|binutilscvs|archer-.*|/home/.*)$} or die "-c|--component required to be: fedoragdb|rhelgdb|fedorabinutils|rhelbinutils|fedoraglibc|rhelglibc|gdbcvs|binutilscvs|archer-*|/home/*");
 $component and $component=~m{^/home/} and (-f "$component/gdb/gdbtypes.c" or die "$component/gdb/gdbtypes.c not found");
 $component and $srcrpm and die "-c|--component excludes -s|--srcrpm";
 $component or $srcrpm or die "-c|--component or -s|--srcrpm required";
@@ -257,11 +258,13 @@ for my $distro (@distrouse) {
 
   my $baretestsuite;
 
-  if ($component eq "gdbcvs") {
-    if (-d $gdbcvsbare) {
-      spawn "cp -a $gdbcvsbare $builddir/src; cd $builddir/src; cvs update -A";
+  if ($component=~/^(gdb|binutils)cvs$/) {
+    my $which=$1;
+    my $cvsbare=$which eq "gdb" ? $gdbcvsbare : $binutilscvsbare;
+    if (-d $cvsbare) {
+      spawn "cp -a $cvsbare $builddir/src; cd $builddir/src; cvs update -A";
     } else {
-      spawn "cd $builddir; cvs -q -z3 -d :pserver:anoncvs:\@sourceware.org:/cvs/src co gdb";
+      spawn "cd $builddir; cvs -q -z3 -d :pserver:anoncvs:\@sourceware.org:/cvs/src co $which";
     }
     spawn "cd $builddir/src".q{; test -z "$(cvs update -A)"};
     $baretestsuite="$builddir/src";
@@ -296,12 +299,23 @@ for my $distro (@distrouse) {
       }
     }
 
-    my @check=($distro=~/-x86_64/ ? qw(-m64 -m32) : -m32);
-    @check=map("check//unix/$_",@check);
-    # FSF GDB has no PIE support.
-    # @check=map({($_,"$_/-fPIE/-pie");} @check);
-    # 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;};
+    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);
+      # FSF GDB has no PIE support.
+      # @check=map({($_,"$_/-fPIE/-pie");} @check);
+      # 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;};
+    }
   }
 
   # Call gdbunpack only if no direct $out directory will be created.