Changeset 358


Ignore:
Timestamp:
Apr 7, 2008, 11:07:33 PM (11 years ago)
Author:
bruno
Message:

Preliminary tests for the new newvm action (test only)

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r357 r358  
    11631163
    11641164    my ($scheme,$uri)=pb_cms_init($pbinit);
     1165    my ($pburl) = pb_conf_get("pburl");
     1166    my ($scheme2, $account, $host, $port, $path) = pb_get_uri($pburl->{$ENV{'PBPROJ'}});
    11651167
    11661168    if ($scheme !~ /^svn/) {
    11671169        die "Only SVN is supported at the moment";
    11681170    }
    1169     my $res = pb_cms_isdiff($scheme);
    1170     die "You need to have no differences before creating a new version" if ($res != 0);
    1171     my $cmsurl = pb_cms_getinfo($scheme,$ENV{'PBROOTDIR'},"URL:");
    1172     my $newurl = dirname($cmsurl)."/$newver";
    1173     pb_cms_copy($scheme,$cmsurl,$newurl);
    1174     pb_cms_checkout($scheme,$newurl,"$ENV{'PBROOTDIR'}/../$newver");
    1175     my $oldver=basename($cmsurl);
    1176     open(FILE,"$ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb";
    1177     open(OUT,"> $ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new";
     1171    my $res = pb_cms_isdiff($scheme,$ENV{'PBROOTDIR'});
     1172    die "You need to have no differences in $uri before creating a new version" if ($res != 0);
     1173
     1174    $res = pb_cms_isdiff($scheme2,$ENV{'PBDIR'});
     1175    die "You need to have no differences in $pburl->{$ENV{'PBPROJ'}} before creating a new version" if ($res != 0);
     1176
     1177    # Tree identical between PBCONFDIR and PBROOTDIR. The delta is what
     1178    # we want to get for the root of the new URL
     1179
     1180    my $tmp = $ENV{'PBROOTDIR'};
     1181    $tmp =~ s|^$ENV{'PBCONFDIR'}||;
     1182
     1183    my $newurl = "$uri/".dirname($tmp)."/$newver";
     1184    pb_log(2,"Copying $uri to $newurl\n");
     1185    #pb_cms_copy($scheme,$uri,$newurl);
     1186    pb_log(2,"Checkout $newurl to $ENV{'PBDIR'}/../$newver\n");
     1187    #pb_cms_checkout($scheme,$newurl,"$ENV{'PBDIR'}/../$newver");
     1188    my $oldver=basename($uri);
     1189    open(FILE,"$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb";
     1190    open(OUT,"> $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new";
    11781191    while(<FILE>) {
    11791192        s/projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/projver $ENV{'PBPROJ'} = $newver/;
     
    11821195    close(FILE);
    11831196    close(OUT);
    1184     rename("$ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOTDIR'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb");
    1185     pb_cms_checkin($scheme,"$ENV{'PBROOTDIR'}/../$newver");
     1197    rename("$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb");
     1198    pb_log(2,"Checkin $ENV{'PBROOTDIR'}/../$newver\n");
     1199    #pb_cms_checkin($scheme,"$ENV{'PBROOTDIR'}/../$newver");
    11861200}
    11871201
     
    13911405
    13921406system "rm -rf project-builder-* ; wget --passive-ftp ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz ; tar xvfz project-builder-latest.tar.gz ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf project-builder-*";
     1407system "pb 2>&1 | head -5";
    13931408EOF
    13941409    if ((! $vmexist) && ($vtype eq "vm")) {
     
    14561471    }
    14571472} elsif (( $dfam eq "rh" ) || ($ddir eq "sles") || (($ddir eq "suse") && (($dver eq "10.1") || ($dver eq "10.0"))) || ($ddir eq "slackware")) {
    1458     # Suppose pkg are installed already
     1473    # Suppose pkg are installed already as no online mirror available
    14591474    system "rpm -e lsb 2>&1 > /dev/null";
    14601475    system "$insdm";
    1461     if ($ddir eq "slackware") {
    1462         system "$insmb";
    1463         system "$insfm";
    1464         system "$insfb";
    1465     }
     1476    system "$insmb";
     1477    system "$insfm";
     1478    system "$insfb";
    14661479} elsif ($ddir eq "suse") {
    14671480    # New OpenSuSE
     1481    system "$insmb";
     1482    system "$insfm";
     1483    system "$insfb";
    14681484    system "export TERM=linux ; liste=\"\" ; for i in make wget patch sudo perl-DateManip perl-File-HomeDir xntp; do rpm -q \$i 1> /dev/null 2> /dev/null ; if [ \$\? != 0 ]; then liste=\"\$liste \$i\"; fi; done; echo \"Liste: \$liste\" ; if [ \"\$liste\" != \"\" ]; then yast2 -i \$liste ; fi";
    14691485} elsif ( $dfam eq "md" ) {
     
    14771493    if (( $dver eq "3.1" ) && ($ddir eq "debian")) {
    14781494        #system "apt-get update";
    1479         system "apt-get -y install wget patch ssh sudo debian-builder dh-make fakeroot ntpdate libfile-mimeinfo-perl libdate-manip-perl";
     1495        system "$insfb";
     1496        system "$insfm";
     1497        system "apt-get -y install wget patch ssh sudo debian-builder dh-make fakeroot ntpdate libmodule-build-perl libdate-manip-perl";
    14801498    } else  {
    1481         system "apt-get update; apt-get -y install wget patch openssh-server dpkg-dev sudo debian-builder dh-make fakeroot ntpdate rses5-dev libfile-mimeinfo-perl libdate-manip-perl";
     1499        system "apt-get update; apt-get -y install wget patch openssh-server dpkg-dev sudo debian-builder dh-make fakeroot ntpdate libfile-mimeinfo-perl libmodule-build-perl libdate-manip-perl";
    14821500    }
    14831501} elsif ( $dfam eq "gen" ) {
    1484         system "emerge -u system ; emerge wget sudo ntp DateManip";
     1502        #system "emerge -u system ; emerge wget sudo ntp DateManip File-MimeInfo";
     1503        system "emerge wget sudo ntp DateManip File-MimeInfo";
    14851504} else {
    14861505    print "No pkg to install\n";
  • devel/pb/lib/ProjectBuilder/Base.pm

    r355 r358  
    181181
    182182#
    183 # The following part is only useful when in cms2build
     183# The following part is only useful when in cms2something of newver
    184184# In VMs/VEs we want to skip that by providing good env vars.
    185185# return values in that case are useless
    186186#
    187 if ($action =~ /^cms2/) {
     187if (($action =~ /^cms2/) || ($action =~ /^newver$/)) {
    188188
    189189    #
     
    228228        die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'});
    229229    }
     230
     231    return  if ($action =~ /^newver$/);
    230232
    231233    my %version = ();
     
    13411343sub pb_cms_isdiff {
    13421344my $scheme = shift;
     1345my $dir =shift;
    13431346
    13441347if ($scheme =~ /^svn/) {
    1345     open(PIPE,"svn diff $ENV{'PBROOTDIR'} |") || die "Unable to get svn diff from $ENV{'PBROOTDIR'}";
     1348    open(PIPE,"svn diff $dir |") || die "Unable to get svn diff from $dir";
    13461349    my $l = 0;
    13471350    while (<PIPE>) {
     
    13511354} elsif ($scheme eq "flat") {
    13521355} elsif ($scheme =~ /^cvs/) {
     1356    open(PIPE,"cvs diff $dir |") || die "Unable to get svn diff from $dir";
     1357    my $l = 0;
     1358    while (<PIPE>) {
     1359        # Skipping normal messages
     1360        next if (/^cvs diff:/);
     1361        $l++;
     1362    }
     1363    return($l);
    13531364} else {
    13541365    die "cms $scheme unknown";
Note: See TracChangeset for help on using the changeset viewer.