summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-01-02 16:27:11 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-01-02 16:27:11 +0000
commit685b65fd95dc93bb8e7efce5761199a2593164c4 (patch)
treeb2ec7de243e1997c246539771479ea3e68fc0a1a
parent9df5eaf5272a62fca84b5c990474d216e0178df9 (diff)
be more explicit in why we don't write DESC
return early instead of adding an extra level of test.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm27
1 files changed, 14 insertions, 13 deletions
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 <espie@openbsd.org>
#
@@ -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