Changeset 2464


Ignore:
Timestamp:
Jan 18, 2020, 7:37:02 PM (6 months ago)
Author:
Bruno Cornec
Message:

Works up to install2pkg which needs to be fixed itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r2463 r2464  
    26262626    my $cidfile;
    26272627    my $homedir = "";
     2628    my $origimage = undef;
     2629    my $cmdverb = "verbose";
     2630    if (($cmt eq "Announce") || ($cmt eq "CPAN")) {
     2631        $cmdverb = undef;
     2632    } elsif (defined ($v)) {
     2633        $cmdverb = "verbose_\[$v\] ";
     2634    }
    26282635    if ($cmt =~ /^VE/) {
    26292636        $tp = pb_path_expand($vepath->{$ENV{'PBPROJ'}});
     
    26732680            # TODO: we don't do anything with found !!
    26742681            my $found = pb_ve_docker_get_image($tag{$pbstep});
    2675             my $origimage = undef;
    2676             if (($pbstep > 3) && (not defined $found)) {
    2677                     # initiate these images from the last n-v-a-pb-pbproj below
    2678                     $found = 0;
    2679                     $origimage = "$tag{3}";
     2682            if ($pbstep > 3) {
     2683                # initiate these images from the last n-v-a-pb-pbproj below, removing existing ones
     2684                if (defined $found) {
     2685                    pb_system("$cmd1 rmi $tag{$pbstep}","Removing Docker image $tag{$pbstep} first",$cmdverb);
     2686                }
     2687                $origimage = "$tag{3}";
     2688                $found = 0;
    26802689            } else {
    2681                     $origimage = "$tag{$pbstep}";
     2690                $origimage = "$tag{$pbstep}";
    26822691            }
    26832692            cluck "No image $tag{$pbstep} available in Docker, please create one first\n" if (not defined $found);
     
    27042713                #$shcmd = "$cmd1 build $dockeropt->{$ENV{'PBPROJ'}} -t $tag{$pbstep+1} $context";
    27052714            } elsif ($pbstep > 3) {
    2706                 # We force the destruciton of the image before recreating it for install or test
    2707                 $shcmd = "$cmd1 rmi $tag{$pbstep} ; ";
    2708                 $shcmd .= "$cmd1 build -t $tag{$pbstep} $context ; ";
    2709                 $shcmd .= "$cmd1 run $rmatend --cidfile=\"$cidfile\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt ";
     2715                $shcmd = "$cmd1 build -t $tag{$pbstep} $context ; ";
     2716                $shcmd .= "$cmd1 run $rmatend --cidfile=\"$cidfile\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$ENV{'PBPROJ'}";
    27102717            } else {
    27112718                # pbstep 3
     
    27282735            if ($pbstep >= 2) {
    27292736                # We need to get the home dir of the target account to deliver in the right place
    2730                 $homedir = `$cmd1 run --rm --cidfile="$cidfile" $tag{$pbstep} grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
     2737                $homedir = `$cmd1 run --rm --cidfile="$cidfile" $origimage grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
    27312738                chomp($homedir);
    27322739                open(CID,"$cidfile") || cluck "Unable to open $cidfile";
     
    28862893            $shcmd .= " \"echo \'cd $tdir ; if [ -x $s ]; then ./$s; fi ;  if [ $pbkeep == 0 ]; then rm -f $s; fi\' | bash\"";
    28872894        }
    2888     }
    2889     my $cmdverb = "verbose";
    2890     if (($cmt eq "Announce") || ($cmt eq "CPAN")) {
    2891         $cmdverb = undef;
    2892     } elsif (defined ($v)) {
    2893         $cmdverb = "verbose_\[$v\] ";
    28942895    }
    28952896    # this is where we launch the execution
Note: See TracChangeset for help on using the changeset viewer.