pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/port2pkg Don't die if pkg-comment does not ex...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c63a8d899575
branches:  trunk
changeset: 466035:c63a8d899575
user:      cjep <cjep%pkgsrc.org@localhost>
date:      Sat Jan 10 16:27:06 2004 +0000

description:
Don't die if pkg-comment does not exist. Some ports have a COMMENT= in
their Makefile already.

diffstat:

 pkgtools/port2pkg/Makefile          |   4 ++--
 pkgtools/port2pkg/files/port2pkg.pl |  18 ++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diffs (49 lines):

diff -r 6eb3633ca086 -r c63a8d899575 pkgtools/port2pkg/Makefile
--- a/pkgtools/port2pkg/Makefile        Sat Jan 10 16:10:35 2004 +0000
+++ b/pkgtools/port2pkg/Makefile        Sat Jan 10 16:27:06 2004 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.19 2004/01/10 16:10:35 cjep Exp $
+# $NetBSD: Makefile,v 1.20 2004/01/10 16:27:06 cjep Exp $
 #
 
 DISTNAME=      port2pkg-1.11
-PKGREVISION=   1
+PKGREVISION=   2
 WRKSRC=                ${WRKDIR}
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
diff -r 6eb3633ca086 -r c63a8d899575 pkgtools/port2pkg/files/port2pkg.pl
--- a/pkgtools/port2pkg/files/port2pkg.pl       Sat Jan 10 16:10:35 2004 +0000
+++ b/pkgtools/port2pkg/files/port2pkg.pl       Sat Jan 10 16:27:06 2004 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 #
-# $NetBSD: port2pkg.pl,v 1.12 2004/01/10 16:10:35 cjep Exp $
+# $NetBSD: port2pkg.pl,v 1.13 2004/01/10 16:27:06 cjep Exp $
 #
 
 require 'getopts.pl';
@@ -234,14 +234,16 @@
                                }
                        }
                        close(DESCR);
-                       open(COMMENT, "$pkgdir/COMMENT")
-                               || die "$pkgdir/COMMENT: $!\n";
-                       while (<COMMENT>) {
-                               chomp;
-                               print PKG "COMMENT=\t$_\n";
+                       if ( -f "$pkgdir/COMMENT") {
+                               open(COMMENT, "$pkgdir/COMMENT")
+                                       || die "$pkgdir/COMMENT: $!\n";
+                               while (<COMMENT>) {
+                                       chomp;
+                                       print PKG "COMMENT=\t$_\n";
+                               }
+                               close(COMMENT);
+                               unlink("$pkgdir/COMMENT");
                        }
-                       close(COMMENT);
-                       unlink("$pkgdir/COMMENT");
                } elsif ($noportdocs || /^\.if.*NOPORTDOCS/) {
                        if (/^\.if/) {
                                $noportdocs++;



Home | Main Index | Thread Index | Old Index