Changeset 537


Ignore:
Timestamp:
Sep 10, 2008, 11:47:49 AM (12 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.

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r529 r537  
    496496        pb_log(2,"def:".Dumper($defpkgdir)." ext: ".Dumper($extpkgdir)." \n");
    497497
    498         # Exporting from CMS
    499         pb_cms_export($uri,"$ENV{'PBDIR'}/$dir",$dest);
     498        # Exporting content from CMS
     499        my $preserve = pb_cms_export($uri,"$ENV{'PBDIR'}/$dir",$dest);
    500500
    501501        # Generated fake content for test versions to speed up stuff
     
    679679        # Archive dest dir
    680680        chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}";
    681         # Possibility to look at PBSRC to guess more the filename
    682         pb_system("tar cfz $pbpkg-$pbver.tar.gz --exclude=$pbpkg-$pbver/pbconf $pbpkg-$pbver","Creating $pbpkg tar files compressed");
     681        if (defined $preserve) {
     682            # In that case we want to preserve the original tar file for checksum purposes
     683            # The one created is btw equivalent in that case to this one
     684            # Maybe check basename of both to be sure they are the same ?
     685            pb_log(0,"Preserving original tar file ");
     686            move("$preserve","$pbpkg-$pbver.tar.gz");
     687        } else {
     688            # Possibility to look at PBSRC to guess more the filename
     689            pb_system("tar cfz $pbpkg-$pbver.tar.gz --exclude=$pbpkg-$pbver/pbconf $pbpkg-$pbver","Creating $pbpkg tar files compressed");
     690        }
    683691        pb_log(0,"Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n");
    684692        pb_system("tar cfz $pbpkg-$pbver.pbconf.tar.gz $pbpkg-$pbver/pbconf","Creating pbconf tar files compressed");
  • 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.