Changeset 125


Ignore:
Timestamp:
Sep 9, 2007, 12:22:56 AM (10 years ago)
Author:
bruno
Message:

Fix lots of small issues for 2ssh functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 0.7.3/pb/bin/pb

    r124 r125  
    353353    }
    354354    # Keep track of what is generated so that we can get them back from VMs
    355     open(KEEP,"> $ENV{'PBDESTDIR'}/pbgen") || die "Unable to create $ENV{'PBBUILDDIR'}/pbgen";
     355    open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag") || die "Unable to create $ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag";
    356356    print KEEP "$made\n";
    357357    close(KEEP);
     
    394394
    395395    my $src = "";
    396     my $vertag;
    397396    chdir "$ENV{'PBBUILDDIR'}";
    398397    foreach my $pbpkg (@pkgs) {
    399         $vertag = $pkg->{$pbpkg};
     398        my $vertag = $pkg->{$pbpkg};
    400399        # get the version of the current package - maybe different
    401400        ($pbver,$pbtag) = split(/-/,$vertag);
     
    409408    } elsif ($cmt eq "Packages") {
    410409        # Get package list from file made during build2pkg
    411         open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$vertag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen";
    412         my $src = <KEEP>;
     410        open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag";
     411        $src = <KEEP>;
    413412        chomp($src);
    414413        close(KEEP);
     
    421420        }
    422421    }
     422    my $basesrc = map { basename($_) } split(/ /,$src);
    423423
    424424    print $LOG "$cmt: $src\n" if ($debug >= 0);
     
    436436    }
    437437    $port = $sshport->{$ENV{'PBPROJ'}};
    438     pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; rm -f $src\"","Preparing $tdir on $mac");
     438    pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; rm -f $basesrc\"","Preparing $tdir on $mac");
    439439    pb_system("scp -p -P $port $src $mac:$tdir","$cmt delivery in $tdir on $mac");
    440     pb_system("ssh -q -p $port $mac \"cd $tdir ; if [ -f pbscript ]; then ./pbscript; fi\"","Executing pbscript on $mac");
     440    pb_system("ssh -q -p $port $mac \"echo \'cd $tdir ; if [ -f pbscript ]; then ./pbscript; rm -f ./pbscript; fi\' | bash\"","Executing pbscript on $mac  if needed");
    441441    if ($cmt eq "VMs") {
    442442            # Get back info on pkg produced, compute their name and get them from the VM
    443         pb_system("scp -p -P $port $mac:$tdir/pbgen-$vertag $ENV{'PBBUILDDIR'}","Get package names in $tdir on $mac");
    444         open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$vertag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$vertag";
     443        pb_system("scp -p -P $port $mac:$tdir/pbgen-$pbprojver$pbprojtag $ENV{'PBBUILDDIR'}","Get package names in $tdir on $mac");
     444        open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver$pbprojtag";
    445445        my $src = <KEEP>;
    446446        chomp($src);
     
    459459    open(SCRIPT,"> $ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript";
    460460    print SCRIPT "#!/bin/bash\n";
     461    print SCRIPT "echo ... Execution needed\n";
    461462    print SCRIPT "# Move the copied .pbrc to the home dir on the build account\n";
    462463    print SCRIPT "mv .pbrc \$ENV{'HOME'}\n";
Note: See TracChangeset for help on using the changeset viewer.