Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1544134
| Path | csiph.com!1.us.feeder.erje.net!2.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Cheah Kok Cheong <thrust73@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] scripts: checkincludes: add exit message for no duplicates found |
| Date | Sun, 18 Dec 2016 13:40:02 +0100 |
| Message-ID | <sPIUW-7Lp-9@gated-at.bofh.it> (permalink) |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=c+46wOLiFqLkOEcDGGHKpqiLzZqogLl8EKNAs1fUOqE=; b=uw27JR4n62+FBE/tzHJLktiqFrq7C9Bv7+TlieNQ8bSfh37OJFM8P7WZCjMXrBOCpF vWdxOacPhDBZ97LligmqMdkA+HhiRmM8C+6IVlGC6aeFgjKLPKVe8jWrBOLjuh4aGmAY 26V5wPY5FAbWR2AhrFUNul24DBw98I0hyHIgfePc+zpDuXciPux5ijI5eTw3WXOPFnmQ 3VQL+aEmofL4FoCXKId9/pnbGW/V+OzIAIwY+xduyPd2dAZkJZDSCKOONRoA8o06IKb6 bye3z1Rfzx5Ae7JtrBPVR4frUF7rENBoowY7w8Vx6RLkb+GKFOdJ0GDbRHfN/onYG9z4 fNFg== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=c+46wOLiFqLkOEcDGGHKpqiLzZqogLl8EKNAs1fUOqE=; b=QwTpeKCvNQKPnLUHNNaPZSFslyKXNxWL87Jep9H02wN1UpJrcSulX/2SEFyiU/HDtw fEtAFguRISv0a8zxdmnIrv1eCsyuO9hl7DhbctC6J0rKYFsEjfM171xHPd3/2kwhRcm7 bRP/cE52dOPqUU3LakAg3TAZQn+NEa9PruMbhao0az2ptvK5FbQ6QIZhPVpJ0lmrlsV3 02Jcwk3xJaZSTbSC6pZ3SS7pkFWI/Bz5qFugrg/6FrYVVQvFzf16lZINcWnQpV3LYLB0 2ezKxf54QzKauTfNMzeSPdDN5ajHFZD1xCuT6NAAUXZbVP0kp8Qci8/mhZw1+YF02uAr sTzg== |
| X-Gm-Message-State | AKaTC0126uLDKF80suyt++XcACs9ZE7BdMIfXJS+mJEy9Qwo0v07yHeAv65sQq78bYoYxQ== |
| X-Received | by 10.99.134.72 with SMTP id x69mr20720724pgd.140.1482064574224; Sun, 18 Dec 2016 04:36:14 -0800 (PST) |
| X-Mailer | git-send-email 2.7.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 51 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | mmarek@suse.com, Cheah Kok Cheong <thrust73@gmail.com> |
| X-Original-Date | Sun, 18 Dec 2016 20:35:19 +0800 |
| X-Original-Message-ID | <1482064519-4352-1-git-send-email-thrust73@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1544134 |
Show key headers only | View raw
If no duplicates found, inform user.
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
---
scripts/checkincludes.pl | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl
index 97b2c61..2bf234c 100755
--- a/scripts/checkincludes.pl
+++ b/scripts/checkincludes.pl
@@ -37,6 +37,13 @@ if ($#ARGV >= 1) {
}
}
+my $dup_counter = 0;
+
+sub nodup_count {
+ ++$dup_counter;
+ return;
+}
+
foreach my $file (@ARGV) {
open(my $f, '<', $file)
or die "Cannot open $file: $!.\n";
@@ -57,6 +64,7 @@ foreach my $file (@ARGV) {
foreach my $filename (keys %includedfiles) {
if ($includedfiles{$filename} > 1) {
print "$file: $filename is included more than once.\n";
+ nodup_count();
}
}
next;
@@ -73,6 +81,7 @@ foreach my $file (@ARGV) {
if ($includedfiles{$filename} > 1) {
$includedfiles{$filename}--;
$dups++;
+ nodup_count();
} else {
print {$f} $_;
}
@@ -87,3 +96,7 @@ foreach my $file (@ARGV) {
}
close($f);
}
+
+if ($dup_counter == 0) {
+ print "No duplicate includes found.\n";
+}
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] scripts: checkincludes: add exit message for no duplicates found Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-18 13:40 +0100
Re: [PATCH] scripts: checkincludes: add exit message for no duplicates found Michal Marek <mmarek@suse.com> - 2016-12-19 11:50 +0100
Re: [PATCH] scripts: checkincludes: add exit message for no duplicates found Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-20 10:20 +0100
csiph-web