From: espie Date: Sat, 18 Jan 2014 01:09:30 +0000 (+0000) Subject: ...and sort SHA256 properly X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2ee5b6274b8e9dc7edfd101d735a4af676d033e;p=openbsd ...and sort SHA256 properly --- diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 3d240d219f6..828b086944d 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCreate.pm,v 1.94 2014/01/17 10:54:14 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.95 2014/01/18 01:09:30 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1192,7 +1192,14 @@ sub create_archive { my ($self, $state, $filename, $dir) = @_; require IO::Compress::Gzip; - my $fh = IO::Compress::Gzip->new($filename); + require Compress::Raw::Zlib; + my $level = $state->{subst}->value('COMPRESSION_LEVEL'); + if (defined $state->{signer}) { + $level //= 6; + } else { + $level //= 1; + } + my $fh = IO::Compress::Gzip->new($filename, -Level => $level); return OpenBSD::Ustar->new($fh, $state, $dir); } @@ -1282,7 +1289,10 @@ sub sign_list } $state->system(sub { chdir($state->{output_dir}) if $state->{output_dir}; + open(STDOUT, '>', 'SHA256.new'); }, 'sort', 'SHA256'); + rename($state->{output_dir}.'/SHA256.new', + $state->{output_dir}.'/SHA256'); } sub sign_existing_repository