[Reproducible-commits] [debhelper] 47/61: dh_installchangelogs: Consistent suffix search order
Mattia Rizzolo
mattia at mapreri.org
Sat Apr 4 18:37:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository debhelper.
commit b4d401a719de734d564dc579ba66d086d3421497
Author: Axel Beckert <abe at deuxchevaux.org>
Date: Sun Mar 1 10:11:16 2015 +0100
dh_installchangelogs: Consistent suffix search order
Now iterates over common suffixes and common base names separately.
Makes the code easier readable and easier to extent.
Looks for "history.md" now, too. (Was a so far ignored suffix/base
name combination.)
---
debian/changelog | 7 +++++++
dh_installchangelogs | 18 ++++++++++--------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index daa09ba..7d2f75e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -89,6 +89,13 @@ debhelper (9.20150101.1) UNRELEASED; urgency=medium
* dh_installchangelogs: Add CHANGES.md to the list of common changelog
filenames
+ [ Axel Beckert ]
+ * dh_installchangelogs: Consistent suffix search order (none, ".txt",
+ ".md") for all upstream changelog file names ("changelog", "changes",
+ "history").
+ + Looks for "history.md" now, too.
+ + Makes it easier to add base names or suffixes in the future.
+
-- Niels Thykier <niels at thykier.net> Thu, 01 Jan 2015 17:24:38 +0100
debhelper (9.20150101) unstable; urgency=medium
diff --git a/dh_installchangelogs b/dh_installchangelogs
index 6c0c3eb..c32ad93 100755
--- a/dh_installchangelogs
+++ b/dh_installchangelogs
@@ -142,14 +142,16 @@ if (! defined $upstream) {
if (! isnative($dh{MAINPACKAGE}) && !compat(6)) {
foreach my $dir (qw{. doc docs}) {
my @files=sort glob("$dir/*");
- foreach my $name (qw{changelog changes changelog.txt changes.txt history history.txt changelog.md changes.md}) {
- my @matches=grep {
- lc basename($_) eq $name && -s $_ && ! excludefile($_)
- } @files;
- if (@matches) {
- $upstream=shift @matches;
- $upstream_text=$upstream;
- last;
+ foreach my $suffix ('', qw(.txt .md)) {
+ foreach my $name (qw{changelog changes history}) {
+ my @matches=grep {
+ lc basename($_) eq "$name$suffix" && -s $_ && ! excludefile($_)
+ } @files;
+ if (@matches) {
+ $upstream=shift @matches;
+ $upstream_text=$upstream;
+ last;
+ }
}
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debhelper.git
More information about the Reproducible-commits
mailing list