# HG changeset patch # User Michael Schloh von Bennewitz # Date 1349374135 -7200 # Node ID e5faec28ec631bfd8002a3a87d5da2d5f790c413 # Parent 1e46ce84435aceae011d9ce23928401f1cc97ba2 Back out changes in 2.17.3:rateup.c disabling unit abbreviation. Even when properly specifying 'kMG', the weekly, monthly, and yearly graphs would not include abbreviated (with kMG postfix) values but instead a very long figure such as '12000000.0 k' in the short legend. The daily graphs don't suffer this problem, more research is needed. diff -r 1e46ce84435a -r e5faec28ec63 mrtg/mrtg.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mrtg/mrtg.patch Thu Oct 04 20:08:55 2012 +0200 @@ -0,0 +1,75 @@ +--- src/rateup.c.orig 2011-12-01 17:06:48.000000000 +0100 ++++ src/rateup.c 2011-02-20 23:33:38.000000000 +0100 +@@ -115,6 +115,7 @@ + char *longup = NULL; + char *shortup = NULL; + char *pngtitle = NULL; ++char *pngdate = NULL; + char *rtimezone = NULL; + char weekformat = 'V'; /* strftime() fmt char for week # */ + +@@ -487,21 +488,13 @@ + { + short_si_out = kMG; + kMGnumber = 0; ++ short_si[0] = kMG; + while ((short_si_out = strchr (short_si_out, ',')) != NULL) + { ++ short_si_out[0] = '\0'; + short_si_out++; +- kMGnumber++; ++ short_si[++kMGnumber] = short_si_out; + } +- short_si = calloc(kMGnumber + 1, sizeof(*short_si)); +- short_si_out = kMG; +- for (kMGnumber = 0; ; kMGnumber++) +- { +- short_si[kMGnumber] = short_si_out; +- short_si_out = strchr(short_si_out, ','); +- if (short_si_out == NULL) break; +- short_si_out[0] = '\0'; +- short_si_out++; +- } + } + } + +@@ -1115,9 +1108,9 @@ + currdatetimepos_x, currdatetimepos_y, + (unsigned char *)currdatetimestr, i_grid); + } +- +- snprintf(file_tmp,1000,"%s.tmp_%lu",file,(unsigned long)getpid()); +- ++ file_tmp[0]=0; ++ strncat(file_tmp,file,1000); ++ strncat(file_tmp,".tmp",1000); + if ((fo = fopen (file_tmp, "wb")) == NULL) + { + perror (program); +@@ -1132,9 +1125,6 @@ + gdImageDestroy (brush_outp); + free (lhist); + free (graph_label); +- if (kMG) +- free(short_si); +- + + #ifdef WIN32 + /* got to remove the target under win32 +@@ -1402,7 +1392,7 @@ + (unsigned long) now); + return; + } +- sprintf (buf, "%s.tmp_%lu", router,(unsigned long)getpid()); ++ sprintf (buf, "%s.tmp", router); + sprintf (buf1, "%s.log", router); + sprintf (buf2, "%s.old", router); + if ((lhist = calloc (1, sizeof (struct HISTORY) * (MAX_HISTORY + 1))) == +@@ -1802,7 +1792,6 @@ + if (!(cbuf = fread (buff, 1, LENGTH_OF_BUFF, fp))) + { + fprintf (stderr, "%s, %s ERROR: Parameters file empty\n", bufftime, program); +- fclose(fp); + return (1); + } + fclose (fp); diff -r 1e46ce84435a -r e5faec28ec63 mrtg/mrtg.spec --- a/mrtg/mrtg.spec Thu Oct 04 20:04:22 2012 +0200 +++ b/mrtg/mrtg.spec Thu Oct 04 20:08:55 2012 +0200 @@ -40,6 +40,7 @@ Source2: rc.mrtg Source3: uptime.pl Source4: webstat.pl +Patch0: mrtg.patch # build information BuildPreReq: OpenPKG, openpkg >= 20100101, perl, zlib, gd, png @@ -59,6 +60,7 @@ %prep %setup -q + %patch -p0 %{l_shtool} subst \ -e 's;mrtg2";mrtg";g' \ -e "s;/usr\(/bin/perl\);%{l_prefix}\1;" \