Changeset 1765 in ProjectBuilder for projects/casparbuster/devel/bin/cb


Ignore:
Timestamp:
Jun 1, 2013, 9:38:07 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Adds support for Debian 7.0 to some projects
  • latest cb commits
  • mindi 2.1.5 announce
File:
1 edited

Legend:

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

    r1683 r1765  
    166166pb_log(2,"%cb: ",Dumper($cb));
    167167
    168 if (defined $plugin) {
    169     # Load plugins
    170     cb_plugin_load();
    171 }
    172 
    173168my $basedir = $cb->{'basedir'}->{$appname};
    174169eval { $basedir =~ s/(\$ENV.+\})/$1/eeg };
     
    184179my $precmd = "";
    185180if (! -f $db) {
    186     $precmd = "CREATE TABLE dates (id INTEGER PRIMARY KEY AUTOINCREMENT, date INTEGER, file VARCHAR[65535], machine VARCHAR[65535])";
     181    $precmd = "CREATE TABLE dates (id INTEGER PRIMARY KEY AUTOINCREMENT, date INTEGER, file VARCHAR[65535], machine VARCHAR[65535], mode VARCHAR[4], uid VARCHAR[5], gid VARCHAR[5])";
    187182}
    188183
     
    210205umask(0022);
    211206pb_vcs_export(pb_vcs_get_uri($scheme,$basedir),$basedir,$dest);
     207
     208# Load all plugins plus the additional manually defined
     209cb_plugin_load();
     210if (defined $plugin) {
     211    pb_conf_add("$basedir/plugins/$plugin") if (-f "$basedir/plugins/$plugin");
     212}
    212213
    213214# Now distribute to the right machines
     
    239240
    240241pb_log(2,"Entering into cb_distribute with machine $machine\n");
    241 confess "No machine fiven to cb_distribute" if (not defined $machine);
     242confess "No machine given to cb_distribute" if (not defined $machine);
    242243
    243244# Use potentially a remote account if defined
     
    274275    $fullsource = "$machine/$source";
    275276    pb_log(2,"fullsource is $fullsource\n");
    276     my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$dest/$fullsource") || die "Unable to stat $fullsource: $!";
    277277    my $type = 'files';
    278278    if (-d $fullsource) {
     
    281281    die "ERROR: Only able to handle files or dirs with option --source\n" if ((! -d $fullsource) && (! -f $fullsource));
    282282
    283     # We should get uid/gid from elsewhere as they're probably wrong locally
    284     $cbp->{"cb.source"}->{$type}->{$source}->{'uid'} = $uid;
    285     $cbp->{"cb.source"}->{$type}->{$source}->{'gid'} = $gid;
    286     $cbp->{"cb.source"}->{$type}->{$source}->{'mode'} = $mode;
    287     $cbp->{"cb.source"}->{$type}->{$source}->{'mtime'} = $mtime;
     283    cb_fill_cbp("cb.source","$dest/$fullsource",$type,$source)
    288284}
    289285
     
    427423if (not $debug) {
    428424    # Reminder: sudo should be configured for this account as Defaults !requiretty for this to work
    429     print $chan "sudo tar -C $path -x -f $tarfile $tbextract\n";
     425    print $chan "sudo tar -C $path --no-overwrite-dir -x -f $tarfile $tbextract\n";
    430426    pb_log(0,"WARNING: $_\n") while (<$chan>);
    431427} else {
     
    497493return if ($targetname eq "");
    498494
    499 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($File::Find::name);
    500 die "Unable to stat $File::Find::name" if (not defined $mode);
    501 # We should get uid/gid fro elsewhere as they're probably wrong locally
    502 $cbp->{"cb.full"}->{$type}->{$targetname}->{'uid'} = $uid;
    503 $cbp->{"cb.full"}->{$type}->{$targetname}->{'gid'} = $gid;
    504 $cbp->{"cb.full"}->{$type}->{$targetname}->{'mode'} = sprintf("%04o",$mode & 07777);
    505 $cbp->{"cb.full"}->{$type}->{$targetname}->{'mtime'} = $mtime;
    506 pb_log(2,"Adding $File::Find::name ($uid,$gid,$mode) to cbp\n");
    507 }
     495cb_fill_cbp("cb.full",$File::Find::name,$type,$targetname)
     496}
     497
     498sub cb_fill_cbp {
     499
     500my $k = shift;
     501my $f = shift;
     502my $type = shift;
     503my $targetname = shift;
     504
     505my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($f);
     506($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat($f) if (not defined $mode);
     507die "Unable to stat $f" if (not defined $mode);
     508# We should get uid/gid from elsewhere as they're probably wrong locally
     509$cbp->{$k}->{$type}->{$targetname}->{'uid'} = $uid;
     510$cbp->{$k}->{$type}->{$targetname}->{'gid'} = $gid;
     511$cbp->{$k}->{$type}->{$targetname}->{'mode'} = sprintf("%04o",$mode & 07777);
     512$cbp->{$k}->{$type}->{$targetname}->{'mtime'} = $mtime;
     513pb_log(2,"Adding $f ($uid,$gid,$mode) to cbp\n");
     514}
Note: See TracChangeset for help on using the changeset viewer.