Changeset 327 in ProjectBuilder
- Timestamp:
- Feb 22, 2008, 4:07:41 AM (17 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r322 r327 179 179 my ($scheme,$uri)=pb_cms_init($ENV{'PBPROJ'}); 180 180 181 # 182 # Check project cms compliance 183 # 184 pb_cms_compliant("pbdir",'PBDIR',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}",$uri,$pbinit); 185 181 186 my ($pkgv, $pkgt) = pb_conf_get_if("pkgver","pkgtag"); 182 187 … … 221 226 # If it isn't a flat CMS, then we have the choice to export subdir 222 227 #$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); 224 229 225 230 # Get project info on authors and log file -
devel/pb/contrib/newpb
r283 r327 6 6 use strict; 7 7 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 ..";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 ; sudo make install ; cd .. ; sudo halt -p ; sleep 120"; 9 9 -
devel/pb/contrib/newpbqemu
r283 r327 41 41 dtype=\`pbdistrocheck | cut -d, -f4\` 42 42 dsuf=\`pbdistrocheck | cut -d, -f5\` 43 pbver= 0.8.1143 pbver=devel 44 44 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" 46 46 else 47 wget ftp://ftp.project-builder.org/$ddir/$dver/ project-builder_".$pbver."_all.deb47 wget ftp://ftp.project-builder.org/$ddir/$dver/test/project-builder_".$pbver."_all.deb 48 48 dpkg -i project-builder_".$pbver."_all.deb" 49 49 fi … … 54 54 pb -m $m -a root -s /tmp/pbscript script2vm 55 55 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}'` 57 57 if [ _"$job" != _"" ]; then 58 58 echo "Really halting $m" -
devel/pb/lib/ProjectBuilder/Base.pm
r323 r327 32 32 33 33 our @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);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 pb_cms_compliant $debug $LOG); 35 35 36 36 $ENV{'PBETC'} = "$ENV{'HOME'}/.pbrc"; … … 188 188 189 189 # 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 # 192 pb_cms_compliant("pbconfdir",'PBCONF',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit); 234 193 235 194 # Check where is our PBROOT (release tag name can't be guessed the first time) … … 936 895 # No ref in home dir project conf file so use the CMS one. 937 896 $p2->{$ENV{'PBPROJ'}} = $p2->{'default'} if (not defined $p2->{$ENV{'PBPROJ'}}); 938 $p1 ->{$ENV{'PBPROJ'}} = $p2->{$ENV{'PBPROJ'}};897 $p1 = $p2; 939 898 } else { 940 899 # Both are defined - handling the overloading … … 952 911 } 953 912 } 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 } 954 918 } 955 919 } … … 986 950 while(<CONF>) { 987 951 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"); 989 953 $h{$1}{$2}=$3; 990 954 } … … 1055 1019 } 1056 1020 1057 #1058 #if (not defined $scheme) {1059 # We're an upstream guy1060 # Try to make it easy for us1061 #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 1066 1021 return($scheme,$uri->{$ENV{'PBPROJ'}}); 1067 1022 } … … 1088 1043 $tmp = $destdir; 1089 1044 } else { 1090 $tmp = $destdir."/".basename($source);1091 pb_mkdir_p($ destdir);1045 $tmp = "$destdir/".basename($source); 1046 pb_mkdir_p($tmp); 1092 1047 } 1093 1048 pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp"); … … 1539 1494 } 1540 1495 1496 sub pb_cms_compliant { 1497 1498 my $param = shift; 1499 my $envar = shift; 1500 my $defdir = shift; 1501 my $uri = shift; 1502 my $pbinit = shift; 1503 # 1504 # Check pbconf/project cms compliance 1505 # 1506 1507 my ($pdir) = pb_conf_get_if($param); 1508 my %pdir = %$pdir; 1509 1510 if ((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 1521 eval { $ENV{$envar} =~ s/(\$ENV.+\})/$1/eeg }; 1522 pb_log(2,"$envar: $ENV{$envar}\n"); 1523 1524 my ($scheme, $account, $host, $port, $path) = pb_get_uri($uri); 1525 1526 if ((! -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 1541 1546 1; -
pbconf/devel/pb.pb
r325 r327 9 9 # Which CMS system is used 10 10 # 11 pburl pb = svn+ssh://www.dploy.org/mondo/svn/pb11 pburl pb = svn+ssh://bruno@svn.mondorescue.org/mondo/svn/pb 12 12 13 13 #
Note:
See TracChangeset
for help on using the changeset viewer.