File: fix-statistic.diff

package info (click to toggle)
tardiff 0.1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 144 kB
  • ctags: 42
  • sloc: perl: 1,109; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 873 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Fix calculation of statistics (option -s)
 Using normal instead of unique diff is far easier to parse
 unambiguously.
Author: Axel Beckert <abe@debian.org>
Bug-Debian: https://bugs.debian.org/802098

Index: tardiff/tardiff
===================================================================
--- tardiff.orig/tardiff	2015-10-17 16:37:09.675959837 +0200
+++ tardiff/tardiff	2015-10-17 16:40:07.739438492 +0200
@@ -116,15 +116,15 @@
 	if(-d $file1 and -d $file2){
 		return 0;
 	}elsif(-f $file1 and -f $file2){
-		my $diff = `diff -u $file1 $file2`;
+		my $diff = `diff $file1 $file2`;
 		if($diff){
 			if($opt_stats){
 				my $plus = 0;
 				my $minus = 0;
 				foreach my $line(split(/\n/, $diff)){
-					if($line =~ /^+\ /){
+					if($line =~ /^>/){
 						$plus++;
-					}elsif($line =~ /^-\ /){
+					}elsif($line =~ /^</){
 						$minus++;
 					}
 				}