From aafc785597bc4331c39c35da652a3d7c1fc22710 Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 13 Jan 2014 10:07:32 +0000 Subject: [PATCH] say something if we sign an empty repository tweak mode on tmp signed file --- usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index b8add161e63..f5fdd2a76bf 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.92 2014/01/09 20:20:01 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.93 2014/01/13 10:07:32 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1199,6 +1199,7 @@ sub sign_existing_package $wrarc->close; $pkg->wipe_info; unlink($plist->pkgname.".tgz") if $state->{output}; + chmod((0666 & ~umask), $tmp); rename($tmp, $output.'/'.$plist->pkgname.".tgz") or $state->fatal("Can't create final signed package: #1", $!); } @@ -1269,6 +1270,9 @@ sub sign_existing_repository require OpenBSD::PackageRepository; my $repo = OpenBSD::PackageRepository->new($source, $state); my @list = sort @{$repo->list}; + if (@list == 0) { + $state->errsay('Source repository "#1" is empty', $source); + } $self->sign_list(\@list, $repo, $state->opt('j'), $state); } -- 2.20.1