aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2016-03-19 19:09:26 -0400
committerMike Gilbert <floppym@gentoo.org>2016-03-19 19:09:26 -0400
commit9b543ebcf154918d3455d7628570e8c66f55612f (patch)
tree9f56e895b795a15d4acb4dc5a4eb166c52fff8bf
parentekeyword: fix "all" keyword handling w/-keywords (diff)
downloadgentoolkit-9b543ebcf154918d3455d7628570e8c66f55612f.tar.gz
gentoolkit-9b543ebcf154918d3455d7628570e8c66f55612f.tar.bz2
gentoolkit-9b543ebcf154918d3455d7628570e8c66f55612f.zip
echangelog: Add fallback text in case skel.ChangeLog is missing
Bug: https://bugs.gentoo.org/577790
-rwxr-xr-xsrc/echangelog/echangelog15
1 files 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 {