Changeset 327


Ignore:
Timestamp:
Feb 22, 2008, 4:07:41 AM (11 years ago)
Author:
bruno
Message:

Improvements in cms2build for SVN but still not finished.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r322 r327  
    179179    my ($scheme,$uri)=pb_cms_init($ENV{'PBPROJ'});
    180180
     181    #
     182    # Check project cms compliance
     183    #
     184    pb_cms_compliant("pbdir",'PBDIR',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}",$uri,$pbinit);
     185
    181186    my ($pkgv, $pkgt) = pb_conf_get_if("pkgver","pkgtag");
    182187
     
    221226        # If it isn't a flat CMS, then we have the choice to export subdir
    222227        #$dir = "$uri/$dir" if ($ENV{'PBREVISION'} ne "flat");
    223         pb_cms_export($uri,"$dir",$dest);
     228        pb_cms_export($uri,"$ENV{'PBDIR'}/$pbprojver/$dir",$dest);
    224229
    225230        # Get project info on authors and log file
  • devel/pb/contrib/newpb

    r283 r327  
    66use strict;
    77
    8 system "ntpdate ntp.home.musique-ancienne.org ; 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 ..";
     8system "ntpdate ntp.home.musique-ancienne.org ; 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 ; sudo make install ; cd .. ; sudo halt -p ; sleep 120";
    99
  • devel/pb/contrib/newpbqemu

    r283 r327  
    4141    dtype=\`pbdistrocheck | cut -d, -f4\`
    4242    dsuf=\`pbdistrocheck | cut -d, -f5\`
    43     pbver=0.8.11
     43    pbver=devel
    4444    if [ "$dtype" = "rpm" ]; then
    45         rpm -Uvh --force --nodeps ftp://ftp.project-builder.org/$ddir/$dver/project-builder-$pbver-1$dsuf.noarch.rpm"
     45        rpm -Uvh --force --nodeps ftp://ftp.project-builder.org/$ddir/$dver/test/project-builder-$pbver-1$dsuf.noarch.rpm"
    4646    else
    47         wget ftp://ftp.project-builder.org/$ddir/$dver/project-builder_".$pbver."_all.deb
     47        wget ftp://ftp.project-builder.org/$ddir/$dver/test/project-builder_".$pbver."_all.deb
    4848        dpkg -i project-builder_".$pbver."_all.deb"
    4949    fi
     
    5454    pb -m $m -a root -s /tmp/pbscript script2vm
    5555    sleep 120
    56     job=`ps auhxww | grep qemu | grep $m | grep -Ev 'grep|updateqemu' | awk '{print $2}'`
     56    job=`ps auhxww | grep qemu | grep $m | grep -Ev 'grep|newpbqemu' | awk '{print $2}'`
    5757    if [ _"$job" != _"" ]; then
    5858        echo "Really halting $m"
  • devel/pb/lib/ProjectBuilder/Base.pm

    r323 r327  
    3232
    3333our @ISA = qw(Exporter);
    34 our @EXPORT = qw(pb_env_init pb_conf_read pb_conf_read_if pb_conf_get pb_conf_get_if pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_filter_file_inplace pb_cms_export pb_cms_log pb_cms_isdiff pb_cms_copy pb_cms_checkout pb_get_date pb_log pb_log_init pb_get_pkg $debug $LOG);
     34our @EXPORT = qw(pb_env_init pb_conf_read pb_conf_read_if pb_conf_get pb_conf_get_if pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_filter_file_inplace pb_cms_export pb_cms_log pb_cms_isdiff pb_cms_copy pb_cms_checkout pb_get_date pb_log pb_log_init pb_get_pkg pb_cms_compliant $debug $LOG);
    3535
    3636$ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc";
     
    188188
    189189#
    190 # Check pbconf compliance
    191 #
    192 
    193 my ($pbconfdir) = pb_conf_get_if("pbconfdir");
    194 my %pbconfdir = %$pbconfdir;
    195 
    196 if ((defined $pbconfdir) && (defined $pbconfdir{$ENV{'PBPROJ'}})) {
    197     # That's always the environment variable that will be used
    198     $ENV{'PBCONF'} = $pbconfdir{$ENV{'PBPROJ'}};
    199 } else {
    200     pb_log(0,"WARNING: no pbconfdir defined, using $ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf\n");
    201     pb_log(0,"         Please create a pbconfdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
    202     pb_log(0,"         if you want to use another directory\n");
    203     $ENV{'PBCONF'} = "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf";
    204 }
    205 
    206 # Expand potential env variable in it
    207 eval { $ENV{'PBCONF'} =~ s/(\$ENV.+\})/$1/eeg };
    208 pb_log(2,"PBCONF: $ENV{'PBCONF'}\n");
    209 
    210 my ($scheme, $account, $host, $port, $path) = pb_get_uri($pbconf{$ENV{'PBPROJ'}});
    211 
    212 if ((! -d "$ENV{'PBCONF'}") || (defined $pbinit)) {
    213     pb_log(1,"Checking out pbconf\n");
    214     pb_cms_checkout($scheme,$pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONF'});
    215 } else {
    216     pb_log(1,"pbconf found, checking content\n");
    217     my $cmsurl = pb_cms_getinfo($scheme,$ENV{'PBCONF'},"URL:");
    218     my ($scheme2, $account2, $host2, $port2, $path2) = pb_get_uri($cmsurl);
    219     if ($scheme2 ne $scheme) {
    220         pb_log(1,"WARNING: Content of $ENV{'PBCONF'} irrelevant, cleaning up and checking it out\n");
    221         pb_rm_rf("$ENV{'PBCONF'}");
    222         pb_cms_checkout($scheme,$pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONF'});
    223     } elsif ($cmsurl ne $pbconf{$ENV{'PBPROJ'}}) {
    224         # The local content doesn't correpond to the repository
    225         pb_log(0,"ERROR: Inconsistency detected:\n");
    226         pb_log(0,"       * $ENV{'PBCONF'} refers to $cmsurl but\n");
    227         pb_log(0,"       * $ENV{'PBETC'} refers to $pbconf{$ENV{'PBPROJ'}}\n");
    228         die "Project $ENV{'PBPROJ'} is not Project-Builder compliant.";
    229     } else {
    230         pb_log(1,"Content correct - doing nothing - you may want to update your repository however\n");
    231         # they match - do nothing - there may be local changes
    232     }
    233 }
     190# Check pbconf cms compliance
     191#
     192pb_cms_compliant("pbconfdir",'PBCONF',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit);
    234193
    235194# Check where is our PBROOT (release tag name can't be guessed the first time)
     
    936895            # No ref in home dir project conf file so use the CMS one.
    937896            $p2->{$ENV{'PBPROJ'}} = $p2->{'default'} if (not defined $p2->{$ENV{'PBPROJ'}});
    938             $p1->{$ENV{'PBPROJ'}} = $p2->{$ENV{'PBPROJ'}};
     897            $p1 = $p2;
    939898        } else {
    940899            # Both are defined - handling the overloading
     
    952911                }
    953912            }
     913            # Now copy back into p1 all p2 content which doesn't exist in p1
     914            # p1 content (local) always has priority over p2 (project)
     915            foreach my $k (keys %$p2) {
     916                $p1->{$k} = $p2->{$k} if (not defined $p1->{$k});
     917            }
    954918        }
    955919    }
     
    986950while(<CONF>) {
    987951    if (/^\s*([A-z0-9-_]+)\s+([[A-z0-9-_]+)\s*=\s*(.+)$/) {
    988         pb_log(2,"DEBUG: 1:$1 2:$2 3:$3\n");
     952        pb_log(3,"DEBUG: 1:$1 2:$2 3:$3\n");
    989953        $h{$1}{$2}=$3;
    990954    }
     
    10551019}
    10561020
    1057 #
    1058 #if (not defined $scheme) {
    1059     # We're an upstream guy
    1060     # Try to make it easy for us
    1061     #pb_log(2,"WARNING: Assuming a local project under $ENV{'PBDIR'}/$ENV{'PBPROJ'}:\n");
    1062     #pb_log(2,"         If not, pleaase setup a pbproj entry in $ENV{'PBROOT'}/$ENV{'PBPROJ'}.pb\n");
    1063     #return("");
    1064 #}
    1065 
    10661021return($scheme,$uri->{$ENV{'PBPROJ'}});
    10671022}
     
    10881043        $tmp = $destdir;
    10891044    } else {
    1090         $tmp = $destdir."/".basename($source);
    1091         pb_mkdir_p($destdir);
     1045        $tmp = "$destdir/".basename($source);
     1046        pb_mkdir_p($tmp);
    10921047    }
    10931048    pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp");
     
    15391494}
    15401495
     1496sub pb_cms_compliant {
     1497
     1498my $param = shift;
     1499my $envar = shift;
     1500my $defdir = shift;
     1501my $uri = shift;
     1502my $pbinit = shift;
     1503#
     1504# Check pbconf/project cms compliance
     1505#
     1506
     1507my ($pdir) = pb_conf_get_if($param);
     1508my %pdir = %$pdir;
     1509
     1510if ((defined $pdir) && (defined $pdir{$ENV{'PBPROJ'}})) {
     1511    # That's always the environment variable that will be used
     1512    $ENV{$envar} = $pdir{$ENV{'PBPROJ'}};
     1513} else {
     1514    pb_log(0,"WARNING: no $param defined, using $defdir\n");
     1515    pb_log(0,"         Please create a $param reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     1516    pb_log(0,"         if you want to use another directory\n");
     1517    $ENV{$envar} = "$defdir";
     1518}
     1519
     1520# Expand potential env variable in it
     1521eval { $ENV{$envar} =~ s/(\$ENV.+\})/$1/eeg };
     1522pb_log(2,"$envar: $ENV{$envar}\n");
     1523
     1524my ($scheme, $account, $host, $port, $path) = pb_get_uri($uri);
     1525
     1526if ((! -d "$ENV{$envar}") || (defined $pbinit)) {
     1527    pb_log(1,"Checking out $uri\n");
     1528    pb_cms_checkout($scheme,$uri,$ENV{$envar});
     1529} else {
     1530    pb_log(1,"$uri found locally, checking content\n");
     1531    my $cmsurl = pb_cms_getinfo($scheme,$ENV{$envar},"URL:");
     1532    my ($scheme2, $account2, $host2, $port2, $path2) = pb_get_uri($cmsurl);
     1533    if ($cmsurl ne $uri) {
     1534        # The local content doesn't correpond to the repository
     1535        pb_log(0,"ERROR: Inconsistency detected:\n");
     1536        pb_log(0,"       * $ENV{$envar} refers to $cmsurl but\n");
     1537        pb_log(0,"       * $ENV{'PBETC'} refers to $uri\n");
     1538        die "Project $ENV{'PBPROJ'} is not Project-Builder compliant.";
     1539    } else {
     1540        pb_log(1,"Content correct - doing nothing - you may want to update your repository however\n");
     1541        # they match - do nothing - there may be local changes
     1542    }
     1543}
     1544}
     1545
    154115461;
  • pbconf/devel/pb.pb

    r325 r327  
    99# Which CMS system is used
    1010#
    11 pburl pb =  svn+ssh://www.dploy.org/mondo/svn/pb
     11pburl pb = svn+ssh://bruno@svn.mondorescue.org/mondo/svn/pb
    1212
    1313#
Note: See TracChangeset for help on using the changeset viewer.