Changeset 2305 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/VCS.pm


Ignore:
Timestamp:
Sep 6, 2017, 7:36:28 PM (7 years ago)
Author:
Bruno Cornec
Message:

Fix newproj for git

handle the case now in the vcs_compliant function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/VCS.pm

    r2284 r2305  
    694694    pb_log(1,"pb_vcs_compliant useless\n");
    695695    return;
    696 } elsif (defined $pbinit) {
    697     pb_mkdir_p("$ENV{$envar}");
    698 } elsif (! -d "$ENV{$envar}") {
     696} elsif ((defined $pbinit) || (! -d "$ENV{$envar}")) {
     697    my $exportdir = $ENV{$envar};
    699698    # Either we have a version in the uri, and it should be the same
    700699    # as the one in the envar. Or we should add the version to the uri
    701700    # But not if it's git as it manages version branches internally
    702     if ((basename($uri) ne basename($ENV{$envar})) && ($scheme !~ /^git/)) {
    703         $uri .= "/".basename($ENV{$envar})
     701    if ((basename($uri) ne basename($exportdir)) && ($scheme !~ /git/)) {
     702        $uri .= "/".basename($exportdir);
     703    }
     704    if ((defined $pbinit) && ($scheme =~ /git/)) {
     705        # If initializing remove the potential pbconf part if we treat pbconfdir
     706        $exportdir =~ s|pbconf[/]*||;
    704707    }
    705708    pb_log(1,"Checking out $uri\n");
    706709    # Create structure and remove end dir before exporting
    707     pb_mkdir_p("$ENV{$envar}");
    708     pb_rm_rf($ENV{$envar});
    709     pb_vcs_checkout($scheme,$uri,$ENV{$envar});
     710    pb_mkdir_p("$exportdir");
     711    pb_rm_rf($exportdir);
     712    pb_vcs_checkout($scheme,$uri,$exportdir);
     713    if ((defined $pbinit) && ($scheme =~ /git/)) {
     714        # And now created the potentially missin gpbconf dir
     715        pb_mkdir_p("$exportdir/pbconf");
     716    }
    710717} else {
    711718    pb_log(1,"$uri found locally, checking content\n");
Note: See TracChangeset for help on using the changeset viewer.