[1466] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | =head1 NAME
|
---|
| 4 |
|
---|
| 5 | cbusterize - Creates the correct CasparBuster structure in your CMS environment
|
---|
| 6 |
|
---|
| 7 | =head1 SYNOPSIS
|
---|
| 8 |
|
---|
[1547] | 9 | cbusterize [options] [--source /path/to/file/to/CasparBusterize | --plugin PluginName]
|
---|
[1466] | 10 |
|
---|
| 11 | Options:
|
---|
| 12 | --debug |-d debug mode
|
---|
| 13 | --help |-h brief help message
|
---|
| 14 | --man full documentation
|
---|
[1485] | 15 | --force |-f force copy of files, even if they exist
|
---|
| 16 | --source |-s <file/dir> directory or files to copy in the CasparBuster tree (',' separated if many)
|
---|
| 17 | --plugin |-p <plugin name> plugin defining what to copy in the CasparBuster tree (',' separated if many)
|
---|
[1466] | 18 | --machine|-m <machine> machine to consider in the subtree
|
---|
| 19 |
|
---|
| 20 | =head1 OPTIONS
|
---|
| 21 |
|
---|
| 22 | =over 4
|
---|
| 23 |
|
---|
| 24 | =item B<--debug>
|
---|
| 25 |
|
---|
| 26 | Enter debug mode. This will print what would be done. No commands are executed,
|
---|
| 27 | so this is safe to use when testing.
|
---|
| 28 |
|
---|
| 29 | =item B<--help>
|
---|
| 30 |
|
---|
| 31 | Print a brief help message and exits.
|
---|
| 32 |
|
---|
| 33 | =item B<--man>
|
---|
| 34 |
|
---|
| 35 | Prints the manual page and exits.
|
---|
| 36 |
|
---|
| 37 | =item B<--machine> I<machine name>
|
---|
| 38 |
|
---|
| 39 | Specify the machine to consider when dealing with the CasparBuster structure.
|
---|
| 40 | The file will be taken from this machine, and a subdirectory named after the machine
|
---|
| 41 | will be used under the basedir to host the directory structure to manage
|
---|
| 42 |
|
---|
| 43 | =item B<--source> I<path>
|
---|
| 44 |
|
---|
[1485] | 45 | Specify the path to the source file or directory to manage with CasparBuster. Multiple paths can be specified separated by ','.
|
---|
[1466] | 46 |
|
---|
[1485] | 47 | =item B<--plugin> I<name>
|
---|
| 48 |
|
---|
| 49 | Specify the name of the plugin to manage with CasparBuster. Multiple plugins can be specified separated by ','.
|
---|
| 50 | A plugin defines a set of files (with their mode and owner), a set of directories (with their mode and owner) and a set of scripts to launch once the files are copied remotely.
|
---|
| 51 |
|
---|
[1466] | 52 | =back
|
---|
| 53 |
|
---|
| 54 | =head1 DESCRIPTION
|
---|
| 55 |
|
---|
| 56 | Creates a directory under the machine dir passed as parameter in working
|
---|
| 57 | directory or directory passed as parameter named like the last path
|
---|
| 58 | element of the parameter, and creates the standard CasparBuster setup
|
---|
| 59 | that refers to the parameter path in the new directory, and configuration
|
---|
| 60 | files when possible. It also copies the original config file into the new dir.
|
---|
| 61 | Is reasonably picky about path names, tries to avoid common errors.
|
---|
| 62 |
|
---|
| 63 | Schema looks like:
|
---|
| 64 |
|
---|
| 65 | Base dir
|
---|
| 66 | |
|
---|
| 67 | |- machine1 (optional)
|
---|
| 68 | | |
|
---|
| 69 | | |-- conf dir1
|
---|
| 70 | | | |
|
---|
| 71 | | | |- conf file 1
|
---|
| 72 | | [...] [...]
|
---|
| 73 | |
|
---|
| 74 | |- machine2 (optional)
|
---|
| 75 | | |
|
---|
| 76 | | |-- conf dir2
|
---|
| 77 | | | |
|
---|
| 78 | | | |- conf file 2
|
---|
| 79 | | [...] [...]
|
---|
| 80 |
|
---|
[1665] | 81 | Use of machines require use of option -m
|
---|
[1466] | 82 |
|
---|
| 83 | =head1 EXAMPLES
|
---|
| 84 |
|
---|
| 85 | # this will create the appropriate CasparBuster environment
|
---|
| 86 | # under the base ~/prj/musique-ancienne.org directory (Cf cbbasedir in cb.conf)
|
---|
| 87 | # containing the directory victoria2 for this machine
|
---|
| 88 | # under which it will copy the required structure if needed (/etc/ssh)
|
---|
| 89 | # to finaly put a copy of the file sshd_conf in it from the victoria2 machine
|
---|
| 90 |
|
---|
| 91 | cbusterize -m victoria2 -s /etc/ssh/sshd_config
|
---|
| 92 |
|
---|
| 93 | =head1 AUTHOR
|
---|
| 94 |
|
---|
| 95 | =over 4
|
---|
| 96 |
|
---|
| 97 | Bruno Cornec, http://brunocornec.wordpress.com
|
---|
| 98 |
|
---|
| 99 | =back
|
---|
| 100 |
|
---|
| 101 | =head1 LICENSE
|
---|
| 102 |
|
---|
| 103 | Copyright (C) 2012 Bruno Cornec <bruno@project-builder.org>
|
---|
| 104 | Released under the GPLv2 or the Artistic license at your will.
|
---|
| 105 |
|
---|
| 106 | =cut
|
---|
| 107 | use strict;
|
---|
[1468] | 108 | use CasparBuster::Version;
|
---|
| 109 | use CasparBuster::Env;
|
---|
[1485] | 110 | use CasparBuster::Plugin;
|
---|
[1668] | 111 | use CasparBuster::SSH;
|
---|
[1466] | 112 | use File::Basename;
|
---|
| 113 | use File::Path;
|
---|
| 114 | use Getopt::Long;
|
---|
| 115 | use Pod::Usage;
|
---|
[1468] | 116 | use Data::Dumper;
|
---|
[1494] | 117 | use Net::SSH2;
|
---|
[1547] | 118 | use Cwd;
|
---|
| 119 | use Archive::Tar;
|
---|
| 120 | use Carp;
|
---|
[1466] | 121 | use ProjectBuilder::Base;
|
---|
| 122 | use ProjectBuilder::Conf;
|
---|
[1470] | 123 | use ProjectBuilder::VCS;
|
---|
[1466] | 124 |
|
---|
| 125 | # settings
|
---|
| 126 | my $debug = 0;
|
---|
[1468] | 127 | my $help = undef;
|
---|
| 128 | my $man = undef;
|
---|
[1466] | 129 | my $source = undef;
|
---|
| 130 | my $machine = undef;
|
---|
[1468] | 131 | my $plugin = undef;
|
---|
[1466] | 132 | my $quiet = undef;
|
---|
[1485] | 133 | my $force = undef;
|
---|
[1466] | 134 | my $log = undef;
|
---|
| 135 | my $LOG = undef;
|
---|
[1547] | 136 | my $ssh2 = undef;
|
---|
| 137 | my $chan = undef;
|
---|
[1466] | 138 |
|
---|
[1468] | 139 | my ($cbver,$cbrev) = cb_version_init();
|
---|
[1466] | 140 | my $appname = "cb";
|
---|
| 141 | $ENV{'PBPROJ'} = $appname;
|
---|
| 142 |
|
---|
| 143 | # Initialize the syntax string
|
---|
| 144 | pb_syntax_init("$appname (aka CasparBuster) Version $cbver-$cbrev\n");
|
---|
| 145 |
|
---|
| 146 | # parse command-line options
|
---|
| 147 | GetOptions(
|
---|
| 148 | 'machine|m=s' => \$machine,
|
---|
| 149 | 'debug|d+' => \$debug,
|
---|
| 150 | 'help|h' => \$help,
|
---|
| 151 | 'quiet|q' => \$quiet,
|
---|
[1485] | 152 | 'force|f' => \$force,
|
---|
[1466] | 153 | 'man' => \$man,
|
---|
[1485] | 154 | 'logfile|l=s' => \$log,
|
---|
[1466] | 155 | 'source|s=s' => \$source,
|
---|
[1468] | 156 | 'plugin|p=s' => \$plugin,
|
---|
[1466] | 157 | ) || pb_syntax(-1,0);
|
---|
| 158 |
|
---|
| 159 | if (defined $help) {
|
---|
| 160 | pb_syntax(0,1);
|
---|
| 161 | }
|
---|
| 162 | if (defined $man) {
|
---|
| 163 | pb_syntax(0,2);
|
---|
| 164 | }
|
---|
| 165 | if (defined $quiet) {
|
---|
| 166 | $debug=-1;
|
---|
| 167 | }
|
---|
| 168 | if (defined $log) {
|
---|
| 169 | open(LOG,"> $log") || die "Unable to log to $log: $!";
|
---|
| 170 | $LOG = \*LOG;
|
---|
| 171 | $debug = 0 if ($debug == -1);
|
---|
| 172 | }
|
---|
[1468] | 173 |
|
---|
| 174 | $pbdebug = $debug;
|
---|
[1466] | 175 | pb_log_init($debug, $LOG);
|
---|
[1668] | 176 | pb_temp_init();
|
---|
| 177 | pb_log(1,"Starting cbusterize\n");
|
---|
[1466] | 178 |
|
---|
| 179 | # Get conf file in context
|
---|
| 180 | pb_conf_init($appname);
|
---|
[1468] | 181 | # The personal one if there is such
|
---|
| 182 | pb_conf_add("$ENV{'HOME'}/.cbrc") if (-f "$ENV{'HOME'}/.cbrc");
|
---|
[1466] | 183 | # The system one
|
---|
| 184 | pb_conf_add(cb_env_conffile());
|
---|
| 185 |
|
---|
| 186 | # Get configuration parameters
|
---|
[1468] | 187 | my %cb;
|
---|
| 188 | my $cb = \%cb;
|
---|
[1665] | 189 | ($cb->{'basedir'},$cb->{'cms'}) = pb_conf_get("cbbasedir","cbcms");
|
---|
[1470] | 190 | pb_log(2,"%cb: ",Dumper($cb));
|
---|
[1466] | 191 |
|
---|
| 192 | # Check for mandatory params
|
---|
[1468] | 193 | pod2usage("Error: --source or --plugin is a mandatory argument\n") if ((not defined $source) && (not defined $plugin));
|
---|
[1665] | 194 | pod2usage("Error: --machine is a mandatory argument\n") if (not defined $machine);
|
---|
[1466] | 195 |
|
---|
[1468] | 196 | if (defined $plugin) {
|
---|
[1485] | 197 | # Load plugins
|
---|
| 198 | cb_plugin_load();
|
---|
[1468] | 199 | }
|
---|
[1466] | 200 |
|
---|
[1468] | 201 | my $basedir = $cb->{'basedir'}->{$appname};
|
---|
| 202 | eval { $basedir =~ s/(\$ENV.+\})/$1/eeg };
|
---|
| 203 |
|
---|
[1485] | 204 | pb_log(1, "DEBUG MODE, not doing anything, just printing\nDEBUG: basedir = $basedir\n");
|
---|
| 205 | pb_log(1, "DEBUG: source = $source\n") if (defined $source);
|
---|
[1668] | 206 | pb_log(1, "DEBUG: machine = $machine\n");
|
---|
[1466] | 207 |
|
---|
[1485] | 208 | # Use potentially a remote account if defined
|
---|
| 209 | my $account = undef;
|
---|
[1494] | 210 | my $remote = undef;
|
---|
[1668] | 211 | ($account) = pb_conf_get_if("cbaccount");
|
---|
| 212 | $remote = $account->{$machine} if ((defined $account) && (defined $account->{$machine}));
|
---|
[1494] | 213 | pb_log(1, "DEBUG: remote account1 = $remote\n") if (defined $remote);
|
---|
| 214 | $remote = getpwuid($<) if (not defined $remote);
|
---|
| 215 | pb_log(1, "DEBUG: remote account2 = $remote\n");
|
---|
[1485] | 216 |
|
---|
[1679] | 217 | $ssh2 = cb_ssh_init($remote,$machine,$debug) if (not defined $ssh2);
|
---|
| 218 |
|
---|
[1466] | 219 | # Create basedir if it doesn't exist
|
---|
| 220 | if (not -d $basedir) {
|
---|
| 221 | if ($debug) {
|
---|
[1470] | 222 | pb_log(1, "DEBUG: Creating recursively directory $basedir\n");
|
---|
[1466] | 223 | } else {
|
---|
[1485] | 224 | pb_mkdir_p($basedir) || die "Unable to recursively create $basedir: $!";
|
---|
[1466] | 225 | }
|
---|
| 226 | }
|
---|
| 227 |
|
---|
[1485] | 228 | if (defined $source) {
|
---|
| 229 | foreach my $f (split(/,/,$source)) {
|
---|
[1494] | 230 | cb_busterize($f,"true");
|
---|
[1485] | 231 | }
|
---|
| 232 | }
|
---|
| 233 |
|
---|
| 234 | # Now handle plugins if any
|
---|
| 235 | my $cbp = ();
|
---|
| 236 |
|
---|
| 237 | if (defined $plugin) {
|
---|
| 238 | foreach my $p (split(/,/,$plugin)) {
|
---|
| 239 | pb_log(1,"Getting context for plugin $p\n");
|
---|
[1679] | 240 | $cbp = cb_plugin_get($p,$cbp,$remote,$machine,$debug,$ssh2);
|
---|
[1485] | 241 | pb_log(2,"cbp: ".Dumper($cbp)."\n");
|
---|
[1494] | 242 | foreach my $k (keys %{$cbp->{$plugin}->{'dirsandfiles'}}) {
|
---|
| 243 | cb_busterize($k,"true");
|
---|
[1485] | 244 | }
|
---|
[1494] | 245 | foreach my $k ((keys %{$cbp->{$plugin}->{'dirs'}}),(keys %{$cbp->{$plugin}->{'files'}})) {
|
---|
| 246 | cb_busterize($k,"false");
|
---|
| 247 | }
|
---|
[1485] | 248 | }
|
---|
| 249 | }
|
---|
| 250 |
|
---|
[1668] | 251 | cb_ssh_close($ssh2);
|
---|
[1547] | 252 |
|
---|
[1485] | 253 | sub cb_busterize {
|
---|
| 254 |
|
---|
| 255 | my $source = shift;
|
---|
[1494] | 256 | my $recur = shift;
|
---|
[1485] | 257 |
|
---|
| 258 | pb_log(2,"Entering cb_busterize source: $source\n");
|
---|
[1466] | 259 | # Is the source a file or a dir ? Split the source parameter in 2
|
---|
| 260 | my $srcdir = undef;
|
---|
| 261 | my $srcfile = undef;
|
---|
[1668] | 262 | my $realsrc = "";
|
---|
| 263 | my $type = "";
|
---|
[1485] | 264 |
|
---|
[1668] | 265 | $chan = $ssh2->channel();
|
---|
| 266 | pb_log(3,"DEBUG: SSH2 chan called\n");
|
---|
| 267 | confess "Unable to create channel for $remote\@$machine: $!" if (not defined $chan);
|
---|
| 268 | if ($debug) {
|
---|
| 269 | pb_log(1,"DEBUG: launching a shell via Net:SSH2 ($remote\@$machine)\n");
|
---|
| 270 | }
|
---|
| 271 | confess "Unable to launch remote shell through Net:SSH2 ($remote\@$machine)" if (not $chan->shell());
|
---|
| 272 | pb_log(3,"DEBUG: SSH2 shell called\n");
|
---|
| 273 |
|
---|
| 274 | pb_log(2,"DEBUG: Calling readlink -f $source\n");
|
---|
| 275 | print $chan "readlink -f $source\n";
|
---|
| 276 | while (<$chan>) {
|
---|
| 277 | $realsrc = $_;
|
---|
| 278 | chomp($realsrc);
|
---|
| 279 | pb_log(3,"DEBUG: Found $realsrc");
|
---|
| 280 | }
|
---|
| 281 | pb_log(2,"DEBUG: Found realsrc = $realsrc\n");
|
---|
| 282 | print $chan "LANGUAGE=C stat -c '%F' $realsrc\n";
|
---|
| 283 | pb_log(2,"DEBUG: Calling LANGUAGE=C stat -c '%F' $realsrc\n");
|
---|
| 284 | while (<$chan>) {
|
---|
| 285 | $type = $_;
|
---|
| 286 | chomp($type);
|
---|
| 287 | pb_log(3,"DEBUG: Found $type");
|
---|
| 288 | }
|
---|
| 289 | pb_log(2,"DEBUG: Found type = $type\n");
|
---|
| 290 | if ($type =~ /directory/) {
|
---|
| 291 | $srcdir = $source;
|
---|
| 292 | pb_log(1,"DEBUG: Found remote dir = $source\n");
|
---|
[1466] | 293 | } else {
|
---|
[1668] | 294 | # File or something else potentially
|
---|
| 295 | $srcdir = dirname($source);
|
---|
| 296 | $srcfile = basename($source);
|
---|
| 297 | pb_log(1,"DEBUG: Found remote file = $source\n");
|
---|
[1485] | 298 | }
|
---|
[1466] | 299 |
|
---|
[1470] | 300 | pb_log(1,"DEBUG: Found srcdir = $srcdir\n");
|
---|
| 301 | if (defined $srcfile) {
|
---|
| 302 | pb_log(1,"DEBUG: Found srcfile = $srcfile\n");
|
---|
| 303 | } else {
|
---|
| 304 | pb_log(1,"DEBUG: Found no srcfile\n");
|
---|
[1466] | 305 | }
|
---|
| 306 |
|
---|
[1668] | 307 | my $scheme = $cb->{'cms'}->{$appname};
|
---|
| 308 |
|
---|
[1468] | 309 | # Deduce the target directory from the local structure and the source
|
---|
[1668] | 310 | my $target = "$basedir/$machine/$srcdir";
|
---|
[1466] | 311 |
|
---|
| 312 | # If both source and target are dirs, then copy into the parent of the target
|
---|
[1668] | 313 | #$target = basename($target) if ((not defined $srcfile) && (-d $target));
|
---|
[1466] | 314 |
|
---|
[1494] | 315 | # Create target if it doesn't exist
|
---|
| 316 | if (not -d $target) {
|
---|
[1468] | 317 | if ($debug) {
|
---|
[1470] | 318 | pb_log(1,"DEBUG: Creating recursively directory $target\n");
|
---|
[1466] | 319 | } else {
|
---|
[1547] | 320 | pb_mkdir_p($target) || confess "Unable to recursively create $target: $!";
|
---|
[1466] | 321 | }
|
---|
[1668] | 322 | # Add all the dirs in it to VCS (in reverse order) if not already in it
|
---|
[1494] | 323 | my $tdir = $target;
|
---|
| 324 | my @tab = ();
|
---|
| 325 | while ($tdir ne $basedir) {
|
---|
| 326 | push(@tab,$tdir);
|
---|
| 327 | $tdir = dirname($tdir);
|
---|
| 328 | pb_log(3,"tdir is now $tdir\n");
|
---|
| 329 | }
|
---|
[1668] | 330 | if (not $debug) {
|
---|
| 331 | pb_vcs_add_if_not_in($scheme,reverse(@tab));
|
---|
[1494] | 332 | }
|
---|
[1668] | 333 | pb_log(0,"INFO: Added to your $scheme system the dirs: ".join(' ',reverse(@tab))."\n");
|
---|
[1466] | 334 | }
|
---|
| 335 |
|
---|
[1470] | 336 | if (defined $srcfile) {
|
---|
| 337 | # File case
|
---|
[1494] | 338 | if ((! -f "$target/$srcfile") || (defined $force)) {
|
---|
[1668] | 339 | $ssh2->scp_put($source,"$target/$srcfile");
|
---|
| 340 | #cb_ssh_do($remote,$machine,$source,"$basedir/$machine",$debug,$ssh2,$chan);
|
---|
| 341 |
|
---|
| 342 | if (not $debug) {
|
---|
| 343 | pb_vcs_add_if_not_in($scheme,"$target/$srcfile");
|
---|
[1547] | 344 | }
|
---|
[1668] | 345 | pb_log(0,"INFO: Created $target/$srcfile and added it to your $scheme system if needed\n");
|
---|
[1470] | 346 | } else {
|
---|
[1668] | 347 | pb_log(0,"INFO: File $target/$srcfile already there. Will not add without forcing with -f\n");
|
---|
[1470] | 348 | }
|
---|
| 349 | } else {
|
---|
| 350 | # Directory case
|
---|
[1547] | 351 | if ($recur eq "true") {
|
---|
| 352 | # with files in it
|
---|
[1668] | 353 | # TODO: if sudo asks a passwd it won't work.
|
---|
| 354 | my $cmd = "sudo tar cvhf /tmp/cb.$$.tar $source\n";
|
---|
| 355 | if ($debug) {
|
---|
| 356 | pb_log(1,"DEBUG: launching through Net:SSH2 ($remote\@$machine) $cmd");
|
---|
| 357 | }
|
---|
| 358 | print $chan "$cmd";
|
---|
| 359 | pb_log(1,"DEBUG: LINE : $_") while <$chan>;
|
---|
| 360 | $cmd = "sudo chmod 600 /tmp/cb.$$.tar\n";
|
---|
| 361 | if ($debug) {
|
---|
| 362 | pb_log(1,"DEBUG: launching through Net:SSH2 ($remote\@$machine) $cmd");
|
---|
| 363 | }
|
---|
| 364 | print $chan "$cmd";
|
---|
| 365 | pb_log(1,"DEBUG: LINE : $_") while <$chan>;
|
---|
| 366 | $cmd = "sudo chown $remote /tmp/cb.$$.tar\n";
|
---|
| 367 | if ($debug) {
|
---|
| 368 | pb_log(1,"DEBUG: launching through Net:SSH2 ($remote\@$machine) $cmd");
|
---|
| 369 | }
|
---|
| 370 | print $chan "$cmd";
|
---|
| 371 | pb_log(1,"DEBUG: LINE : $_") while <$chan>;
|
---|
| 372 |
|
---|
| 373 | if ($debug) {
|
---|
| 374 | pb_log(1,"DEBUG: gettting through Net:SSH2 ($remote\@$machine) /tmp/cb.$$.tar\n");
|
---|
| 375 | }
|
---|
| 376 |
|
---|
| 377 | $ssh2->scp_get("/tmp/cb.$$.tar","/tmp/cb.$$.tar");
|
---|
| 378 |
|
---|
| 379 | if ($debug) {
|
---|
| 380 | pb_log(1,"DEBUG: erasing through Net:SSH2 ($remote\@$machine) /tmp/cb.$$.tar\n");
|
---|
| 381 | } else {
|
---|
| 382 | print $chan "sudo rm -f /tmp/cb.$$.tar\n";
|
---|
| 383 | }
|
---|
| 384 | my $tar = Archive::Tar->new("/tmp/cb.$$.tar");
|
---|
| 385 | $tar->setcwd("$basedir/$machine");
|
---|
| 386 | if ($debug) {
|
---|
| 387 | pb_log(1,"DEBUG: Extracting /tmp/cb.$$.tar\n");
|
---|
| 388 | foreach my $f ($tar->list_files()) {
|
---|
| 389 | pb_log(1,"DEBUG: $f\n");
|
---|
| 390 | }
|
---|
| 391 | } else {
|
---|
| 392 | foreach my $f ($tar->get_files) {
|
---|
| 393 | my $sname = $f->name;
|
---|
| 394 | $sname =~ s|/$||;
|
---|
| 395 | next if ($srcdir =~ /$sname/);
|
---|
| 396 | if ($f->is_file) {
|
---|
| 397 | #pb_log(0,"Extracting and Adding ".$f->name." to your $scheme system\n");
|
---|
| 398 | $tar->extract($f);
|
---|
| 399 | pb_vcs_add_if_not_in($scheme,"$basedir/$machine/".$f->name);
|
---|
| 400 | } elsif ($f->is_dir) {
|
---|
| 401 | pb_log(0,"Calling recursively cbusterize on ".$f->name."\n");
|
---|
| 402 | cb_busterize("/".$f->name,$recur);
|
---|
[1547] | 403 | } else {
|
---|
[1668] | 404 | pb_log(0,"File type $f->type for $f->name is not handled yet\n");
|
---|
[1547] | 405 | }
|
---|
| 406 | }
|
---|
[1668] | 407 | }
|
---|
| 408 | if ($debug) {
|
---|
| 409 | pb_log(1,"DEBUG: please cleanup manually /tmp/cb.$$.tar\n");
|
---|
[1494] | 410 | } else {
|
---|
[1668] | 411 | $tar->clear;
|
---|
| 412 | unlink("/tmp/cb.$$.tar");
|
---|
[1547] | 413 | }
|
---|
| 414 | } else {
|
---|
| 415 | # Only deal with that dir, nothing below, so just created locally
|
---|
| 416 | if ($debug) {
|
---|
[1668] | 417 | pb_log(1,"DEBUG: Creatng and Adding $target to your $scheme system\n");
|
---|
[1547] | 418 | } else {
|
---|
| 419 | pb_mkdir_p("$target");
|
---|
[1668] | 420 | pb_vcs_add_if_not_in($scheme,"$target");
|
---|
[1494] | 421 | }
|
---|
[1547] | 422 | }
|
---|
[1466] | 423 | }
|
---|
[1668] | 424 | $chan->close();
|
---|
[1547] | 425 |
|
---|
[1485] | 426 | pb_log(2,"Exiting cb_busterize\n");
|
---|
| 427 | }
|
---|
[1547] | 428 |
|
---|
| 429 |
|
---|