Changeset 1489 in ProjectBuilder


Ignore:
Timestamp:
Apr 29, 2012, 3:58:30 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Fix syntac erros in previous verion of cb. Ready for first level of test
Location:
projects/casparbuster/devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • projects/casparbuster/devel/bin/cb

    r1487 r1489  
    1313   --help   |-h         brief help message
    1414   --man            full documentation
    15    --force   |-f            force copy of files, even if they exist
     15   --force  |-f         force copy of files, even if they exist
    1616   --source |-s <file/dir>  directory or files to copy from the CasparBuster tree (',' separated if many) to the target
    1717   --plugin |-p <plugin name>   plugin defining what to copy from the CasparBuster tree (',' separated if many) to the target
     
    156156# Get configuration parameters
    157157my %cb;
     158my $cbp = ();
    158159my $cb = \%cb;
    159160($cb->{'basedir'},$cb->{'usemachines'},$cb->{'cms'},$cb->{'database'}) = pb_conf_get("cbbasedir","cbusemachines","cbcms","cbdatabase");
     
    204205
    205206# Now distribute to the right machines
    206 if defined ($machine) {
     207if (defined $machine) {
    207208    cb_distribute($machine);
    208209} else {
     
    243244
    244245# Now handle plugins if any
    245 my $cbp = ();
    246 
    247 # Handle plugins
    248246if (defined $plugin) {
    249247    foreach my $p (split(/,/,$plugin)) {   
     
    284282    $cbp->{"cb.source"}->{$type}->{$source}->{'mode'} = $mode;
    285283    $cbp->{"cb.source"}->{$type}->{$source}->{'mtime'} = $mtime;
    286     }
    287284}
    288285
     
    295292    }
    296293}
    297 pb_log(2,"INFO: RAW cbp: ".Dumper($cbp)."\n");
     294pb_log(2,"INFO: RAW cbp: ".Dumper(%$cbp)."\n");
    298295
    299296# Clean up cbp structure by comparing with data stored in the DB
     
    311308                # If less recent than in the DB remove it
    312309                delete($cbp->{$k}->{$type}->{$o}) if (($file eq $o) && ($date > $cbp->{$k}->{$type}->{$o}->{'mtime'}));
    313                 }   
    314310            }
    315311        }
     
    320316# Now create a tar containing all the relevant content
    321317my $tar = Archive::Tar->new;
    322 $tar->add_files((keys %{$cbp->{$k}->{'files'}}),(keys %{$cbp->{$k}->{'dirs'}}));
    323 $tar->write("$ENV{'TMPDIR'}/content$$.tar");
    324 
     318foreach my $k (keys %{$cbp}) {
     319    $tar->add_files((keys %{$cbp->{$k}->{'files'}}),(keys %{$cbp->{$k}->{'dirs'}}));
     320    # Add an entryo to the DB
     321}
     322my $tarfile = "$ENV{'TMPDIR'}/content$$.tar";
     323$tar->write("$tarfile");
     324
     325my $cmd = "";
    325326# Copy the tar file and extract it + set up modes/uids/gids
    326327if (defined $machine) {
    327     $cmd = "scp -p -q $remote:$source $target";
     328    $cmd = "scp -p -q $tarfile $remote:/tmp";
    328329} else {
    329     $cmd = "cp -p $source $target";
     330    $cmd = "cp -p $source /tmp";
    330331}
    331332
     
    334335} else {
    335336    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");
    337338}
    338339pb_log(2,"Exiting cb_distribute\n");
  • projects/casparbuster/devel/lib/CasparBuster/Plugin.pm

    r1487 r1489  
    8888    foreach my $block (split(/;/,$dlist->{$plugin})) {
    8989        pb_log(3,"block : $block\n");
    90         ($name,$tmp) = split(/\|/,$block);
     90        my ($name,$tmp) = split(/\|/,$block);
    9191        ($cbp->{$plugin}->{'dirs'}->{$name}->{'uid'},$cbp->{$plugin}->{'dirs'}->{$name}->{'gid'},$cbp->{$plugin}->{'dirs'}->{$name}->{'mode'}) = split(/\,/,$tmp);
    9292    }
Note: See TracChangeset for help on using the changeset viewer.