Changeset 781 in ProjectBuilder


Ignore:
Timestamp:
May 18, 2009, 8:02:23 AM (15 years ago)
Author:
Bruno Cornec
Message:

r3085@localhost: bruno | 2009-05-17 20:47:58 +0200

  • Fix export function for SVK zhen dealing with files instead of dirs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r780 r781  
    164164    }
    165165} elsif ($scheme eq "svk") {
     166    my $src = $source;
    166167    if (defined $source) {
    167168        if (-d $source) {
     
    169170        } else {
    170171            $tmp = "$destdir/".basename($source);
     172            $src = dirname($source);
    171173        }
    172174        $source = pb_cms_mod_http($source,"svk");
     
    174176        # pb_system("$vcscmd export $path $tmp","Exporting $path from $scheme to $tmp ");
    175177        pb_log(4,"$uri,$source,$destdir,$scheme, $account, $host, $port, $path,$tmp");
    176         pb_system("mkdir -p $tmp ; cd $tmp; tar -cf - -C $source . | tar xf -","Exporting $path from $scheme to $tmp ");
     178        if (-d $source) {
     179            pb_system("mkdir -p $tmp ; cd $tmp; tar -cf - -C $source . | tar xf -","Exporting $source from $scheme to $tmp ");
     180        # If source is file do not use -C with source
     181        } else {
     182            pb_system("mkdir -p ".dirname($tmp)." ; cd ".dirname($tmp)."; tar -cf - -C $src ".basename($source)." | tar xf -","Exporting $src/".basename($source)." from $scheme to $tmp ");
     183        }
    177184    } else {
    178185        die "Unable to export from svk without a source defined";
Note: See TracChangeset for help on using the changeset viewer.