commit: 9b543ebcf154918d3455d7628570e8c66f55612f Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> AuthorDate: Sat Mar 19 23:09:26 2016 +0000 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> CommitDate: Sat Mar 19 23:09:26 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=9b543ebc
echangelog: Add fallback text in case skel.ChangeLog is missing Bug: https://bugs.gentoo.org/577790 src/echangelog/echangelog | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog index c382fd6..98af377 100755 --- a/src/echangelog/echangelog +++ b/src/echangelog/echangelog @@ -264,10 +264,17 @@ if (-f 'ChangeLog') { die "Can't find PORTDIR\n" if (length $portdir == 0); - open($fh, '<', "$portdir/skel.ChangeLog") - or die "Can't open $portdir/skel.ChangeLog for input: $!\n"; - { local $/ = undef; $text = <$fh>; } - close($fh); + if (open($fh, '<', "$portdir/skel.ChangeLog")) { + local $/ = undef; $text = <$fh>; + close($fh); + } + else { + $text = <<EOT +# ChangeLog for <CATEGORY>/<PACKAGE> +# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2 +# \$Id\$ +EOT + } $text =~ s/^\*.*//ms; # don't need the fake entry } else {
