Changeset 361 in ProjectBuilder for devel/pb/bin
- Timestamp:
- Apr 7, 2008, 11:42:10 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r360 r361 1163 1163 1164 1164 my ($scheme,$uri)=pb_cms_init($pbinit); 1165 1166 # Checking CMS repositories status 1165 1167 my ($pburl) = pb_conf_get("pburl"); 1166 1168 my ($scheme2, $account, $host, $port, $path) = pb_get_uri($pburl->{$ENV{'PBPROJ'}}); … … 1170 1172 } 1171 1173 my $res = pb_cms_isdiff($scheme,$ENV{'PBROOTDIR'}); 1172 die " You need to have no differences in$ENV{'PBROOTDIR'} before creating a new version" if ($res != 0);1174 die "ERROR: No differences accepted in CMS for $ENV{'PBROOTDIR'} before creating a new version" if ($res != 0); 1173 1175 1174 1176 $res = pb_cms_isdiff($scheme2,$ENV{'PBDIR'}); 1175 die " You need to have no differences in$ENV{'PBDIR'} before creating a new version" if ($res != 0);1177 die "ERROR: No differences accepted in CMS for $ENV{'PBDIR'} before creating a new version" if ($res != 0); 1176 1178 1177 1179 # Tree identical between PBCONFDIR and PBROOTDIR. The delta is what … … 1182 1184 1183 1185 my $newurl = "$uri/".dirname($tmp)."/$newver"; 1184 pb_log(2,"Copying $uri to $newurl\n"); 1186 my $oldver= basename("$uri/$tmp"); 1187 1188 # Checking pbcl files 1189 foreach my $f (<$ENV{'PBCONFDIR'}/*/pbcl>) { 1190 open(PBCL,$f) || die "Unable to open $f"; 1191 my $foundnew = 0; 1192 while (<PBCL>) { 1193 $foundnew = 1 if (/^$newver (/); 1194 } 1195 close(PBCL); 1196 die "ERROR: version $newver not found in $f\n") if ($foundnew == 0); 1197 } 1198 1199 pb_log(2,"Copying $uri/$tmp to $newurl\n"); 1185 1200 #pb_cms_copy($scheme,$uri,$newurl); 1186 1201 pb_log(2,"Checkout $newurl to $ENV{'PBDIR'}/../$newver\n"); 1187 1202 #pb_cms_checkout($scheme,$newurl,"$ENV{'PBDIR'}/../$newver"); 1188 my $oldver=basename($uri); 1203 1204 # Update the .pb file 1205 # Should probably use projver in the old file 1189 1206 open(FILE,"$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb"; 1190 1207 open(OUT,"> $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new"; 1191 1208 while(<FILE>) { 1192 s/projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/projver $ENV{'PBPROJ'} = $newver/; 1209 s/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/projver $ENV{'PBPROJ'} = $newver/; 1210 pb_log(0,"Changing projver from $oldver to $newver in $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb\n") if (/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/); 1211 s/^testver/#testver/; 1212 pb_log(0,"Commenting testver in $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb\n") if (/^testver/); 1193 1213 print OUT $_; 1194 1214 } … … 1197 1217 rename("$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb"); 1198 1218 pb_log(2,"Checkin $ENV{'PBROOTDIR'}/../$newver\n"); 1219 1199 1220 #pb_cms_checkin($scheme,"$ENV{'PBROOTDIR'}/../$newver"); 1200 1221 }
Note:
See TracChangeset
for help on using the changeset viewer.