lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1482320885-4025-1-git-send-email-thrust73@gmail.com>
Date:   Wed, 21 Dec 2016 19:48:05 +0800
From:   Cheah Kok Cheong <thrust73@...il.com>
To:     mmarek@...e.com, linux-kernel@...r.kernel.org
Cc:     Cheah Kok Cheong <thrust73@...il.com>
Subject: [PATCH v2] scripts: checkincludes: add exit message for no duplicates found

If no duplicates found, inform user.

Signed-off-by: Cheah Kok Cheong <thrust73@...il.com>
---

Notes:
    V2: Remove unnecessary subroutine - Michal

 scripts/checkincludes.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl
index 97b2c61..381c018 100755
--- a/scripts/checkincludes.pl
+++ b/scripts/checkincludes.pl
@@ -37,6 +37,8 @@ if ($#ARGV >= 1) {
 	}
 }
 
+my $dup_counter = 0;
+
 foreach my $file (@ARGV) {
 	open(my $f, '<', $file)
 	    or die "Cannot open $file: $!.\n";
@@ -57,6 +59,7 @@ foreach my $file (@ARGV) {
 		foreach my $filename (keys %includedfiles) {
 			if ($includedfiles{$filename} > 1) {
 				print "$file: $filename is included more than once.\n";
+				++$dup_counter;
 			}
 		}
 		next;
@@ -73,6 +76,7 @@ foreach my $file (@ARGV) {
 					if ($includedfiles{$filename} > 1) {
 						$includedfiles{$filename}--;
 						$dups++;
+						++$dup_counter;
 					} else {
 						print {$f} $_;
 					}
@@ -87,3 +91,7 @@ foreach my $file (@ARGV) {
 	}
 	close($f);
 }
+
+if ($dup_counter == 0) {
+	print "No duplicate includes found.\n";
+}
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ