From: espie Date: Thu, 2 Jan 2014 16:27:10 +0000 (+0000) Subject: be more explicit in why we don't write DESC X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3ac12ec15fd2b887026d5cf1ef6a37bbdf407107;p=openbsd be more explicit in why we don't write DESC return early instead of adding an extra level of test. --- diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index ab66ba06b83..611d12149e1 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.77 2014/01/02 16:05:42 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.78 2014/01/02 16:27:10 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -1089,28 +1089,29 @@ sub add_description if (!defined $opt_d) { $state->usage("Description required"); } - if (defined $o->fullname) { - open(my $fh, '>', $o->fullname) or die "Can't write to DESC: $!"; - if (defined $comment) { - print $fh $subst->do($comment), "\n"; - } - if ($opt_d =~ /^\-(.*)$/o) { + return if $state->opt('q'); + + open(my $fh, '>', $o->fullname) or die "Can't write to DESC: $!"; + if (defined $comment) { + print $fh $subst->do($comment), "\n"; + } + if ($opt_d =~ /^\-(.*)$/o) { print $fh $1, "\n"; - } else { + } else { $subst->copy_fh($opt_d, $fh); - } - if (defined $comment) { + } + if (defined $comment) { if ($subst->empty('MAINTAINER')) { $state->errsay("no MAINTAINER"); } else { - print $fh "\n", $subst->do('Maintainer: ${MAINTAINER}'), "\n"; + print $fh "\n", + $subst->do('Maintainer: ${MAINTAINER}'), "\n"; } if (!$subst->empty('HOMEPAGE')) { print $fh "\n", $subst->do('WWW: ${HOMEPAGE}'), "\n"; } - } - close($fh); } + close($fh); } sub add_signature