bsdsfv-1.18-color.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --- bsdsfv.orig/bsdsfv.c 2003-10-05 03:07:45.000000000 +0200
  2. +++ bsdsfv/bsdsfv.c 2009-11-11 09:04:53.000000000 +0100
  3. @@ -40,6 +40,14 @@
  4. #define BSDSFV_VERSION "BSDSFV for UNiX, $Revision: 1.18 $"
  5. #define MISSINGTAG ".missing"
  6. #define BADTAG ".bad"
  7. +#define OPENBRACKET "\e[34;01m[\e[0m"
  8. +#define CLOSEBRACKET "\e[34;01m]\e[0m"
  9. +#define OKCOLOR "\e[32;01m"
  10. +#define OKMSG "OK"
  11. +#define BADCOLOR "\e[31;01m"
  12. +#define BADMSG "BAD"
  13. +#define MISSINGCOLOR "\e[33;01m"
  14. +#define MISSINGMSG "MISSING"
  15. typedef struct sfvtable {
  16. char filename[FNAMELEN];
  17. @@ -558,7 +566,7 @@
  18. printf("0x%08X - ", sfvTable[0].crc);
  19. if (sfvTable[0].crc == mycrc) {
  20. - printf("OK\n");
  21. + printf ("%s %s%s %s\n", OPENBRACKET, OKCOLOR, OKMSG, CLOSEBRACKET);
  22. if (glftpdmode) {
  23. sprintf(crap, "%s%s",
  24. sfvTable[0].filename,
  25. @@ -570,7 +578,7 @@
  26. unlink(crap);
  27. }
  28. } else {
  29. - printf("BAD\n");
  30. + printf ("%s %s%s %s\n", OPENBRACKET, BADCOLOR, BADMSG, CLOSEBRACKET);
  31. badfiles++;
  32. if (glftpdmode) {
  33. sprintf(crap, "%s%s",
  34. @@ -584,7 +592,7 @@
  35. }
  36. }
  37. } else {
  38. - printf("MISSING\n");
  39. + printf ("%s %s%s %s\n", OPENBRACKET, MISSINGCOLOR, MISSINGMSG, CLOSEBRACKET);
  40. missingfiles++;
  41. }
  42. numfiles++;
  43. @@ -592,10 +600,11 @@
  44. fclose(sfvfile);
  45. }
  46. - printf
  47. - ("\n%d file(s) tested - %d OK - %d bad - %d missing...\n",
  48. - numfiles, numfiles - badfiles - missingfiles, badfiles,
  49. - missingfiles);
  50. + printf ("\n%d file(s) tested - %s %s%d %s %s - %s %s%d %s %s - %s %s%d %s %s ...\n\n",
  51. + numfiles,
  52. + OPENBRACKET, OKCOLOR, numfiles - (badfiles + missingfiles), OKMSG, CLOSEBRACKET,
  53. + OPENBRACKET, BADCOLOR, badfiles, BADMSG, CLOSEBRACKET,
  54. + OPENBRACKET, MISSINGCOLOR, missingfiles, MISSINGMSG, CLOSEBRACKET);
  55. fflush(stdout);
  56. @@ -678,13 +687,13 @@
  57. printf("local = 0x%08lX ... ", mycrc);
  58. if (mycrc == sfvTable[cnt].crc) {
  59. - printf("OK\n");
  60. + printf ("%s %s%s %s\n", OPENBRACKET, OKCOLOR, OKMSG, CLOSEBRACKET);
  61. } else {
  62. if (mycrc == 0xffffffff) {
  63. - printf("MISSING\n");
  64. + printf ("%s %s%s %s\n", OPENBRACKET, MISSINGCOLOR, MISSINGMSG, CLOSEBRACKET);
  65. missingfiles++;
  66. } else {
  67. - printf("BAD\n");
  68. + printf ("%s %s%s %s\n", OPENBRACKET, BADCOLOR, BADMSG, CLOSEBRACKET);
  69. badfiles++;
  70. }
  71. }
  72. @@ -704,8 +713,9 @@
  73. }
  74. } else {
  75. printf
  76. - ("Testing %s ... listed = 0x%08X ... Local = MISSING\n",
  77. - sfvTable[cnt].filename, sfvTable[cnt].crc);
  78. + ("Testing %s ... listed = 0x%08X ... Local = ... %s %s%s %s\n",
  79. + sfvTable[cnt].filename, sfvTable[cnt].crc,
  80. + OPENBRACKET, MISSINGCOLOR, MISSINGMSG, CLOSEBRACKET);
  81. missingfiles++;
  82. if (glftpdmode) {
  83. sprintf(crap, "%s%s",
  84. @@ -751,9 +761,11 @@
  85. }
  86. printf
  87. - ("\n%d file(s) tested - %d OK - %d bad - %d missing ...\n\n",
  88. - numfiles, numfiles - (badfiles + missingfiles), badfiles,
  89. - missingfiles);
  90. + ("\n%d file(s) tested - %s %s%d %s %s - %s %s%d %s %s - %s %s%d %s %s ...\n\n",
  91. + numfiles,
  92. + OPENBRACKET, OKCOLOR, numfiles - (badfiles + missingfiles), OKMSG, CLOSEBRACKET,
  93. + OPENBRACKET, BADCOLOR, badfiles, BADMSG, CLOSEBRACKET,
  94. + OPENBRACKET, MISSINGCOLOR, missingfiles, MISSINGMSG, CLOSEBRACKET);
  95. if (missingfiles)
  96. return 2;