Changeset 751 for devel/pb/bin/pb


Ignore:
Timestamp:
Mar 30, 2009, 3:48:21 AM (11 years ago)
Author:
bruno
Message:
  • Adds snapshot support for VEs
  • Force usage of correct arch in pb_distro_init to avoid issues when cross building
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r749 r751  
    620620                chomp($arch);
    621621                my ($ddir, $dver, $dfam);
    622                 ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}) = pb_distro_init($name,$ver);
     622                ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}) = pb_distro_init($name,$ver,$arch);
    623623                pb_log(2,"DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'})."\n");
    624624                pb_log(2,"DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n");
     
    10801080            ($odir,$over,$oarch) = split(/-/,$v);
    10811081        }
    1082         ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($odir,$over);
     1082        ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($odir,$over,$oarch);
    10831083        pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n");
    10841084
     
    14011401            }
    14021402        }
     1403        if ((($cmt eq "ve") || ($cmt eq "VEScript")) && ($snapme != 0)) {
     1404            pb_system("tar cfj $tp/$odir-$over-$oarch.tar.bz2 $tpdir","Creating a snapshot of $tpdir");
     1405        }
    14031406        pb_system("$shcmd \"sudo /sbin/halt -p \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $v halt (pid $vmpid)");
    14041407    }
     
    14101413    my $pbforce=shift || 0; # Force stop of VM. Default not
    14111414    my $vm1=shift || undef; # Only that VM to treat
    1412     my $snapme=shift || 0;  # Do we have to crate a snapshot
     1415    my $snapme=shift || 0;  # Do we have to create a snapshot
    14131416    my $vm;
    14141417    my $all;
     
    15851588        my ($name,$ver,$darch) = split(/-/,$v);
    15861589        chomp($darch);
    1587         my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver);
     1590        my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver,$darch);
    15881591
    15891592        if (($vetype eq "chroot") || ($vetype eq "schroot")) {
     
    20112014            my ($name,$ver,$darch) = split(/-/,$v);
    20122015            chomp($darch);
    2013             my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init($name,$ver);
     2016            my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init($name,$ver,$darch);
    20142017   
    20152018            my $postparam = pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
Note: See TracChangeset for help on using the changeset viewer.