Changeset 500 in ProjectBuilder for devel/pb/lib/ProjectBuilder/CMS.pm
- Timestamp:
- Aug 3, 2008, 1:20:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/CMS.pm
r452 r500 16 16 use English; 17 17 use File::Basename; 18 use File::Copy; 18 19 use POSIX qw(strftime); 19 20 use lib qw (lib); … … 109 110 This function exports a CMS content to a directory. 110 111 The first parameter is the URL of the CMS content. 111 The second parameter is the directory in which it is locally exposed (result of a checkout). 112 The second parameter is the directory in which it is locally exposed (result of a checkout). If undef, then use the original CMS content. 112 113 The third parameter is the directory where we want to deliver it (result of export). 113 114 … … 127 128 128 129 if ($scheme =~ /^svn/) { 129 if (-d $source) { 130 $tmp = $destdir; 131 } else { 132 $tmp = "$destdir/".basename($source); 133 } 134 pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp"); 130 if (defined $source) { 131 if (-d $source) { 132 $tmp = $destdir; 133 } else { 134 $tmp = "$destdir/".basename($source); 135 } 136 pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp"); 137 } else { 138 pb_system("svn export $uri $destdir","Exporting $uri from SVN to $destdir"); 139 } 135 140 } elsif ($scheme eq "dir") { 136 141 pb_system("cp -a $path $destdir","Copying $uri from DIR to $destdir"); … … 152 157 pb_mkdir_p($destdir); 153 158 154 # Check whether the file is well formed 155 # (containing already a directory with the project-version name) 156 my ($pbwf) = pb_conf_get_if("pbwf"); 157 if ((defined $pbwf) && (defined $pbwf->{$ENV{'PBPROJ'}})) { 158 $destdir = dirname($destdir); 159 if (defined $source) { 160 # Check whether the file is well formed 161 # (containing already a directory with the project-version name) 162 my ($pbwf) = pb_conf_get_if("pbwf"); 163 if ((defined $pbwf) && (defined $pbwf->{$ENV{'PBPROJ'}})) { 164 $destdir = dirname($destdir); 165 } 159 166 } 160 167 … … 174 181 # zip 175 182 pb_system("cd $destdir ; unzip $path","Extracting $path in $destdir"); 183 } else { 184 # simple file: copy it (patch e.g.) 185 copy($path,$destdir); 176 186 } 177 187 } elsif ($scheme =~ /^cvs/) { … … 179 189 my $dir=dirname($destdir); 180 190 my $base=basename($destdir); 181 # CVS also needs a modules name not a dir182 #if (-d $source) {191 if (defined $source) { 192 # CVS also needs a modules name not a dir 183 193 $tmp1 = basename($source); 184 #} else {185 # $tmp1 = dirname($source);186 #$tmp1 = basename($tmp1);187 #}194 } else { 195 # Probably not right, should be checked, but that way I'll notice it :-) 196 $tmp1 = $uri; 197 } 188 198 my $optcvs = ""; 189 199 … … 304 314 } elsif ($scheme =~ /^cvs/) { 305 315 pb_system("cvs co $url $destination","Checking out $url to $destination "); 316 } elsif ($scheme =~ /^file/) { 317 pb_cms_export($url,undef,$destination); 306 318 } else { 307 319 die "cms $scheme unknown"; … … 417 429 } 418 430 419 =item B<pb_cms_ isdiff>431 =item B<pb_cms_getpkg> 420 432 421 433 This function returns the list of packages we are working on in a CMS action.
Note:
See TracChangeset
for help on using the changeset viewer.