- Timestamp:
- Apr 29, 2012, 3:58:30 AM (13 years ago)
- Location:
- projects/casparbuster/devel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
projects/casparbuster/devel/bin/cb
r1487 r1489 13 13 --help |-h brief help message 14 14 --man full documentation 15 --force 15 --force |-f force copy of files, even if they exist 16 16 --source |-s <file/dir> directory or files to copy from the CasparBuster tree (',' separated if many) to the target 17 17 --plugin |-p <plugin name> plugin defining what to copy from the CasparBuster tree (',' separated if many) to the target … … 156 156 # Get configuration parameters 157 157 my %cb; 158 my $cbp = (); 158 159 my $cb = \%cb; 159 160 ($cb->{'basedir'},$cb->{'usemachines'},$cb->{'cms'},$cb->{'database'}) = pb_conf_get("cbbasedir","cbusemachines","cbcms","cbdatabase"); … … 204 205 205 206 # Now distribute to the right machines 206 if defined ($machine) {207 if (defined $machine) { 207 208 cb_distribute($machine); 208 209 } else { … … 243 244 244 245 # Now handle plugins if any 245 my $cbp = ();246 247 # Handle plugins248 246 if (defined $plugin) { 249 247 foreach my $p (split(/,/,$plugin)) { … … 284 282 $cbp->{"cb.source"}->{$type}->{$source}->{'mode'} = $mode; 285 283 $cbp->{"cb.source"}->{$type}->{$source}->{'mtime'} = $mtime; 286 }287 284 } 288 285 … … 295 292 } 296 293 } 297 pb_log(2,"INFO: RAW cbp: ".Dumper( $cbp)."\n");294 pb_log(2,"INFO: RAW cbp: ".Dumper(%$cbp)."\n"); 298 295 299 296 # Clean up cbp structure by comparing with data stored in the DB … … 311 308 # If less recent than in the DB remove it 312 309 delete($cbp->{$k}->{$type}->{$o}) if (($file eq $o) && ($date > $cbp->{$k}->{$type}->{$o}->{'mtime'})); 313 }314 310 } 315 311 } … … 320 316 # Now create a tar containing all the relevant content 321 317 my $tar = Archive::Tar->new; 322 $tar->add_files((keys %{$cbp->{$k}->{'files'}}),(keys %{$cbp->{$k}->{'dirs'}})); 323 $tar->write("$ENV{'TMPDIR'}/content$$.tar"); 324 318 foreach my $k (keys %{$cbp}) { 319 $tar->add_files((keys %{$cbp->{$k}->{'files'}}),(keys %{$cbp->{$k}->{'dirs'}})); 320 # Add an entryo to the DB 321 } 322 my $tarfile = "$ENV{'TMPDIR'}/content$$.tar"; 323 $tar->write("$tarfile"); 324 325 my $cmd = ""; 325 326 # Copy the tar file and extract it + set up modes/uids/gids 326 327 if (defined $machine) { 327 $cmd = "scp -p -q $ remote:$source $target";328 $cmd = "scp -p -q $tarfile $remote:/tmp"; 328 329 } else { 329 $cmd = "cp -p $source $target";330 $cmd = "cp -p $source /tmp"; 330 331 } 331 332 … … 334 335 } else { 335 336 pb_system($cmd); 336 pb_log(0,"INFO: Created $target/$srcfile and added it to your $scheme system\n");337 pb_log(0,"INFO: \n"); 337 338 } 338 339 pb_log(2,"Exiting cb_distribute\n"); -
projects/casparbuster/devel/lib/CasparBuster/Plugin.pm
r1487 r1489 88 88 foreach my $block (split(/;/,$dlist->{$plugin})) { 89 89 pb_log(3,"block : $block\n"); 90 ($name,$tmp) = split(/\|/,$block);90 my ($name,$tmp) = split(/\|/,$block); 91 91 ($cbp->{$plugin}->{'dirs'}->{$name}->{'uid'},$cbp->{$plugin}->{'dirs'}->{$name}->{'gid'},$cbp->{$plugin}->{'dirs'}->{$name}->{'mode'}) = split(/\,/,$tmp); 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.