From samm@os2.kiev.ua  Tue Aug 29 22:39:17 2006
Return-Path: <samm@os2.kiev.ua>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BDD9C16A4DA
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Aug 2006 22:39:17 +0000 (UTC)
	(envelope-from samm@os2.kiev.ua)
Received: from el.volia.net (el.volia.net [82.144.192.38])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5170143D64
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Aug 2006 22:39:14 +0000 (GMT)
	(envelope-from samm@os2.kiev.ua)
Received: from ip.85.202.201.160.dyn.sub-4.broadband.voliacable.com ([85.202.201.160] helo=samm.local)
	by el.volia.net with esmtp (Exim 4.43 (FreeBSD))
	id 1GICEj-0002zL-2B
	for FreeBSD-gnats-submit@freebsd.org; Wed, 30 Aug 2006 01:39:13 +0300
Message-Id: <1156891153.9204@samm.local>
Date: Wed, 30 Aug 2006 01:39:13 +0300
From: "Alex Samorukov" <samm@os2.kiev.ua>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: www/sarg progress indicator broken
X-Send-Pr-Version: gtk-send-pr 0.4.7 
X-GNATS-Notify:

>Number:         102665
>Category:       ports
>Synopsis:       www/sarg progress indicator broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    garga
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 29 22:40:14 GMT 2006
>Closed-Date:    Wed Aug 30 21:29:52 GMT 2006
>Last-Modified:  Wed Aug 30 21:29:52 GMT 2006
>Originator:     Alex Samorukov
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
Shevchenko Didkovskiy and Partners 
>Environment:


System: FreeBSD 6.1-RELEASE #2: Wed May 17 22:22:18 EEST 2006
    root@samm.local:/usr/obj/usr/src/sys/SAMMKRNL



>Description:


When running sarg 2.2.2 i get garbage instead off progress indicator:
SARG: Records in file: 645549, reading: -272893874588218345799594564781958471725SARG: Records in file: 645549, reading: -272893874588218345799594564781958471725

The problem is caused by the incorrect modifier for the off_t variable. log.c use %d (int), when freebsd use "long long" type, so next value is corrupted. I created separate bugreport at the http://sourceforge.net/tracker/index.php?func=detail&aid=1548911&group_id=68910&atid=522791, which fix this problem.


>How-To-Repeat:


Install, configure and run sarg. Progress indicator will be broken. After proposed patch progress indicator will work as designed.


>Fix:


diff --new-file -u -r sarg/files/patch-log.c sarg.new/files/patch-log.c
--- sarg/files/patch-log.c	Thu Jan  1 03:00:00 1970
+++ sarg.new/files/patch-log.c	Wed Aug 30 01:36:08 2006
@@ -0,0 +1,30 @@
+diff -u -r sarg/work/sarg-2.2.2/log.c sarg.new/work/sarg-2.2.2/log.c
+--- log.c	Tue Aug 29 14:09:32 2006
++++ log.c	Wed Aug 30 01:34:18 2006
+@@ -772,7 +772,7 @@
+       while( fgets(bufz,sizeof(bufz),fp_in) != NULL ) recs1++;
+       rewind(fp_in);
+ 
+-      printf("SARG: Records in file: %d, reading: %3.2f%%\r",recs1,(float) 0);
++      printf("SARG: Records in file: %lli, reading: %3.2f%%\r",recs1,(float) 0);
+       fflush( stdout ) ;
+    }
+    
+@@ -781,7 +781,7 @@
+ 	if( bool_ShowReadStatistics && ! --OutputNonZero) {
+            perc = recs2 * 100 ;
+            perc = perc / recs1 ;
+-   	   printf("SARG: Records in file: %d, reading: %3.2f%%\r",recs1,perc);
++   	   printf("SARG: Records in file: %lli, reading: %3.2f%%\r",recs1,perc);
+            fflush (stdout);
+            OutputNonZero = REPORT_EVERY_X_LINES ;
+         }
+@@ -1267,7 +1267,7 @@
+         }
+       }
+       if( bool_ShowReadStatistics )
+-        printf("SARG: Records in file: %d, reading: %3.2f%%\n",recs1, (float) 100 );
++        printf("SARG: Records in file: %lli, reading: %3.2f%%\n",recs1, (float) 100 );
+    }
+ 
+    if ( fp_Download_Unsort ) 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->garga 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Aug 29 22:40:32 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102665 

From: Alex Samorukov <samm@os2.kiev.ua>
To: bug-followup@FreeBSD.org,  samm@os2.kiev.ua
Cc:  
Subject: Re: ports/102665: www/sarg progress indicator broken
Date: Wed, 30 Aug 2006 21:44:11 +0300

 Author accepted my patch:
 -------- Original Message --------
 Subject: 	Re: Fwd: sarg and freebsd
 Date: 	Wed, 30 Aug 2006 14:09:10 -0300
 From: 	orso [at] interponta.com.br
 To: 	Alex Samorukov <samm@os2.kiev.ua>
 
 
 
 Hi Alex,
 
 good to receive your email.
 Surelly your fix will be in the next release and for now I'll put
 a link in sargs page to the patch.
 
 Thans and please keep helping sarg.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: garga 
State-Changed-When: Wed Aug 30 21:29:51 UTC 2006 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102665 
>Unformatted:
