Changeset 537 in ProjectBuilder for devel/pb/lib/ProjectBuilder/CMS.pm


Ignore:
Timestamp:
Sep 10, 2008, 11:47:49 AM (16 years ago)
Author:
Bruno Cornec
Message:

Fix #31: pb now preserves by default original tar files got by http or ftp to allow for checksum consistency.

File:
1 edited

Legend:

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

    r527 r537  
    112112The second parameter is the directory in which it is locally exposed (result of a checkout). If undef, then use the original CMS content.
    113113The third parameter is the directory where we want to deliver it (result of export).
     114It returns the original tar file if we need to preserve it and undef if we use the produced one.
    114115
    115116=cut
     
    150151        die "Unable to download $uri.\nNo wget/curl available, please install one of those";
    151152    }
     153    # We want to preserve the original tar file
    152154    pb_cms_export("file://$ENV{'PBTMP'}/$f",$source,$destdir);
     155    return("$ENV{'PBTMP'}/$f");
    153156} elsif ($scheme eq "file") {
    154157    use File::MimeInfo;
    155158    my $mm = mimetype($path);
    156159    pb_log(2,"mimetype: $mm\n");
    157     pb_mkdir_p($destdir);
    158160
    159161    if (defined $source) {
    160162        # Check whether the file is well formed
    161163        # (containing already a directory with the project-version name)
     164        #
     165        # If it's not the case, we try to adapt, but distro needing
     166        # to verify the checksum will have issues (Fedora)
     167        # Then upstream should be notified that they need to change their rules
    162168        my ($pbwf) = pb_conf_get_if("pbwf");
    163169        if ((defined $pbwf) && (defined $pbwf->{$ENV{'PBPROJ'}})) {
     
    165171        }
    166172    }
     173    pb_mkdir_p($destdir);
    167174
    168175    if ($mm =~ /\/x-bzip-compressed-tar$/) {
     
    210217    die "cms $scheme unknown";
    211218}
     219return(undef);
    212220}
    213221
Note: See TracChangeset for help on using the changeset viewer.