diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-05 10:48:40 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-05 10:48:40 +0000 |
commit | afe5408636db5a0076bbdf48bbb0580076a02239 (patch) | |
tree | 372fcb2a2c09835b96826f00045a414a44b5113f /usr.sbin/pkg_add | |
parent | af232995df8ec1c789f1cd0a2bcf0d57ee1eeb38 (diff) |
use copy_subst_fh
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 52413df2b45..31a25ef6159 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.91 2007/05/05 10:47:06 espie Exp $ +# $OpenBSD: pkg_create,v 1.92 2007/05/05 10:48:39 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -438,20 +438,18 @@ sub add_description Usage "Description required"; } if (defined $infodir) { + open(my $fh, '>', $infodir.$name) or die "Can't write to DESC: $!"; if ($opt_c =~ /^\-/) { - open(my $fh, '>', $infodir.$name) or die "Can't write COMMENT to DESC file: $!"; - print $fh $'; - close($fh); + print $fh $', "\n"; } else { - copy_subst($opt_c, '>', $infodir.$name); + copy_subst_fh($opt_c, $fh); } if ($opt_d =~ /^\-/) { - open(my $fh, '>>', $infodir.$name) or die "Can't write to DESC: $!"; - print $fh $'; - close($fh); + print $fh $', "\n"; } else { - copy_subst($opt_d, '>>', $infodir.$name); + copy_subst_fh($opt_d, $fh); } + close($fh); } } |