gnunet-bugreport 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. #!/bin/sh
  2. progname=${0##*/}
  3. statusmsg()
  4. {
  5. echo " $@"
  6. }
  7. infomsg()
  8. {
  9. statusmsg "INFO: $@"
  10. }
  11. warningmsg()
  12. {
  13. statusmsg "WARNING: $@"
  14. }
  15. errormsg()
  16. {
  17. statusmsg "ERROR: $@"
  18. }
  19. linemsg()
  20. {
  21. statusmsg "========================================="
  22. }
  23. # It is okay to assume which(1) here because we provide
  24. # more than 1 fallback.
  25. TEST=`type type|grep not`
  26. if test -n "$TEST"; then
  27. WHICH=which
  28. else
  29. WHICH=type
  30. fi
  31. os_check()
  32. {
  33. OS=`uname -s 2>/dev/null`
  34. infomsg "OS : $OS"
  35. REL=`uname -r 2>/dev/null`
  36. infomsg "OS RELEASE : $REL"
  37. HW=`uname -m 2>/dev/null`
  38. infomsg "HARDWARE : $HW"
  39. }
  40. # We shouldn't use awk to test for awk... but if
  41. # awk isn't there it can't be found.
  42. awk_check()
  43. {
  44. if test -n "`awk 2>&1 | tail -1 | awk '{print $1}'`"; then
  45. infomsg "awk : Found"
  46. else
  47. warningmsg "awk : Not found!"
  48. fi
  49. }
  50. gcc_check()
  51. {
  52. TEST=`$WHICH gcc | grep -v "not found" 2>/dev/null`
  53. if test -n "$TEST"; then
  54. VERS=`gcc --version 2>/dev/null | head -n 1`
  55. infomsg "gcc : $VERS"
  56. # The elif will work in bourne shells, no other shells tested.
  57. elif test -n "`gcc 2>&1 | tail -1 | awk '{print $1}'`"; then
  58. VERS=`gcc --version 2>/dev/null | head -n 1`
  59. infomsg "gcc : $VERS"
  60. else
  61. warningmsg "gcc : Not Found";
  62. fi
  63. }
  64. cc_check()
  65. {
  66. TEST=`$WHICH cc | grep -v "not found" 2>/dev/null`
  67. if test -n "$TEST"; then
  68. VERS=`cc --version 2>/dev/null | head -n 1`
  69. infomsg "cc : $VERS"
  70. else
  71. warningmsg "cc : Not Found";
  72. fi
  73. }
  74. cplusplus_check()
  75. {
  76. TEST=`$WHICH c++ | grep -v "not found" 2>/dev/null`
  77. if test -n "$TEST"; then
  78. VERS=`c++ --version 2>/dev/null | head -n 1`
  79. infomsg "c++ : $VERS"
  80. else
  81. warningmsg "c++ : Not Found";
  82. fi
  83. }
  84. gmake_check()
  85. {
  86. TEST=`$WHICH gmake | grep -v "not found" 2>/dev/null`
  87. if test -n "$TEST" ; then
  88. VER=`gmake --version 2>/dev/null |\
  89. awk -F, '{print $1}' |\
  90. awk '/GNU Make/{,$NF}'`
  91. infomsg "gmake : $VER"
  92. else
  93. TEST=`make --version 2>/dev/null`
  94. if test -n "$TEST"; then
  95. VER=`make --version 2>/dev/null |\
  96. awk -F, '{print $1}' |\
  97. awk '/GNU Make/{print $NF}'`
  98. infomsg "gmake : $VER"
  99. else
  100. warningmsg "gmake : Not Found"
  101. fi
  102. fi
  103. }
  104. # Applies for NetBSD make and possibly every make.
  105. make_check()
  106. {
  107. if test -n "`make 2>/dev/null`"; then
  108. infomsg "make : Found"
  109. else
  110. warningmsg "make : Not Found"
  111. fi
  112. }
  113. autoconf_check()
  114. {
  115. TEST=`$WHICH autoconf | grep -v "not found" 2>/dev/null`
  116. if test -n "$TEST"; then
  117. autoconf --version |\
  118. head -n 1 |\
  119. awk '{\
  120. if (length($4) == 0) {\
  121. print " INFO: autoconf : "$3\
  122. } else {\
  123. print " INFO: autoconf : "$4\
  124. }}'
  125. else
  126. warningmsg "autoconf : Not Found"
  127. fi
  128. }
  129. automake_check()
  130. {
  131. TEST=`$WHICH automake | grep -v "not found" 2>/dev/null`
  132. if test -n "$TEST"; then
  133. VER=`automake --version 2>/dev/null | head -n 1 | awk '{print $4}'`
  134. infomsg "automake : $VER"
  135. else
  136. warningmsg "automake : Not Found"
  137. fi
  138. }
  139. # TODO: More libtool variants.
  140. libtool_check()
  141. {
  142. TEST=`$WHICH libtoolize | grep -v "not found" 2>/dev/null`
  143. if test -n "$TEST"; then
  144. VER=`libtoolize --version 2>/dev/null | head -n 1 | awk '{print $4}'`
  145. infomsg "libtool : $VER"
  146. else
  147. warningmsg "libtool : Not Found"
  148. fi
  149. }
  150. libextractor_check()
  151. {
  152. TEST=`$WHICH extract | grep -v "not found" 2>/dev/null`
  153. if test -n "$TEST"; then
  154. VER=`extract -v 2>/dev/null | head -n 1 | awk '{print $2}'`
  155. infomsg "libextractor : $VER"
  156. else
  157. warningmsg "libextractor : Not Found"
  158. fi
  159. }
  160. gnunet08_check()
  161. {
  162. if test -x gnunetd; then
  163. VER=`gnunetd -v | sed -e "s/v//" 2>/dev/null`
  164. warningmsg "GNUnet 0.8 : $VER (may conflict!)"
  165. else
  166. infomsg "GNUnet 0.8 : Not Found (good)"
  167. fi
  168. }
  169. gnunet09x_check()
  170. {
  171. TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
  172. if test -n "$TEST"; then
  173. VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
  174. VER9=`echo $VER | grep ^0\.9\.`
  175. if test -n "$VER9"; then
  176. warningmsg "GNUnet 0.9 : $VER"
  177. else
  178. infomsg "GNUnet 0.9 : Not Found (good)"
  179. fi
  180. else
  181. infomsg "GNUnet 0.9 : Not Found (good)"
  182. fi
  183. }
  184. gnunet010x_check()
  185. {
  186. TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
  187. if test -n "$TEST"; then
  188. VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
  189. VER9=`echo $VER | grep ^0\.10\.`
  190. if test -n "$VER10"; then
  191. warningmsg "GNUnet 0.10 : $VER"
  192. else
  193. infomsg "GNUnet 0.10 : Not Found (good)"
  194. fi
  195. else
  196. infomsg "GNUnet 0.10 : Not Found (good)"
  197. fi
  198. }
  199. gnunet011x_check()
  200. {
  201. TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
  202. if test -n "$TEST"; then
  203. VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
  204. infomsg "GNUnet 0.11 : $VER"
  205. else
  206. warningmsg "GNUnet 0.11.x : Not Found"
  207. fi
  208. }
  209. gcrypt_check()
  210. {
  211. TEST=`$WHICH libgcrypt-config | grep -v "not found" 2> /dev/null`
  212. if test -n "$TEST"; then
  213. VER=`libgcrypt-config --version 2> /dev/null`
  214. infomsg "libgcrypt : $VER"
  215. else
  216. warningmsg "libgcrypt : Not Found"
  217. fi
  218. }
  219. mysql_check()
  220. {
  221. TEST=`$WHICH mysql_config | grep -v "not found" 2> /dev/null`
  222. if test -n "$TEST"; then
  223. VER=`mysql_config --version 2> /dev/null`
  224. infomsg "mysql : $VER"
  225. else
  226. infomsg "mysql : Not Found"
  227. fi
  228. }
  229. pkgconf_check()
  230. {
  231. TEST=`$WHICH pkgconf | grep -v "not found" 2> /dev/null`
  232. if test -n "$TEST"; then
  233. pkgconf --version 2> /dev/null | awk '{print "pkgconf : "$1}'
  234. else
  235. infomsg "pkgconf : Not Found"
  236. fi
  237. }
  238. pkgconfig_check()
  239. {
  240. TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
  241. if test -n "$TEST"; then
  242. VER=`pkg-config --version 2> /dev/null | awk '{print $1}'`
  243. infomsg "pkg-config : $VER"
  244. else
  245. infomsg "pkg-config : Not Found"
  246. fi
  247. }
  248. glib2_check()
  249. {
  250. TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
  251. if test -n "$TEST"; then
  252. VER=`pkg-config --modversion glib-2.0 2> /dev/null | awk '{print $1}'`
  253. infomsg "glib2 : $VER"
  254. else
  255. infomsg "glib2 : Not Found"
  256. fi
  257. }
  258. gtk2_check()
  259. {
  260. TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
  261. if test -n "$TEST"; then
  262. VER=`pkg-config --modversion gtk+-2.0 2> /dev/null | awk '{print $1}'`
  263. if test -n "$VER"; then
  264. infomsg "gtk2+ : $VER"
  265. else
  266. infomsg "gtk2+ : Not found"
  267. fi
  268. else
  269. infomsg "gtk2+ : Not Found"
  270. fi
  271. }
  272. gtk3_check()
  273. {
  274. TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
  275. if test -n "$TEST"; then
  276. VER=`pkg-config --modversion gtk+-3.0 2> /dev/null | awk '{print $1}'`
  277. if test -n "$VER"; then
  278. infomsg "gtk3+ : $VER"
  279. else
  280. infomsg "gtk3+ : Not found"
  281. fi
  282. else
  283. infomsg "gtk3+ : Not Found"
  284. fi
  285. }
  286. gtk4_check()
  287. {
  288. TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
  289. if test -n "$TEST"; then
  290. VER=`pkg-config --modversion gtk+-4.0 2> /dev/null | awk '{print $1}'`
  291. if test -n "$VER"; then
  292. infomsg "gtk4+ : $VER"
  293. else
  294. infomsg "gtk4+ : Not found"
  295. fi
  296. else
  297. infomsg "gtk4+ : Not Found"
  298. fi
  299. }
  300. gmp_check()
  301. {
  302. TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null`
  303. if test -n "$TEST"; then
  304. LINES=`dpkg -s libgmp-dev | grep Version | wc -l 2> /dev/null`
  305. if test "$LINES" = "1"
  306. then
  307. VERSION=`dpkg -s libgmp-dev | grep Version | awk '{print $2}'`
  308. infomsg "GMP : libgmp-dev-$VERSION.deb"
  309. else
  310. errormsg "GMP : dpkg: libgmp-dev not installed"
  311. fi
  312. else
  313. TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null`
  314. if test -n "$TEST"; then
  315. rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \
  316. infomsg "GMP : $1.rpm"
  317. else
  318. warningmsg "GMP : Test not available"
  319. fi
  320. fi
  321. }
  322. libunistring_check()
  323. {
  324. TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null`
  325. if test -n "$TEST"; then
  326. LINES=`dpkg -s libunistring-dev | grep Version | wc -l`
  327. if test "$LINES" = "1"
  328. then
  329. VERSION=`dpkg -s libunistring-dev | grep Version | awk '{print $2}'`
  330. infomsg "libunistring : libunistring3-dev-$VERSION.deb"
  331. else
  332. errormsg "libunistring : dpkg: libunistring3-dev not installed"
  333. fi
  334. else
  335. TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null`
  336. if test -n "$TEST"; then
  337. rpm -q unistring | sed -e "s/unistring-//" 2> /dev/null | \
  338. awk '{print "libunistring : "$1.rpm}'
  339. else
  340. infomsg "libunistring : Test not available"
  341. fi
  342. fi
  343. }
  344. pkgadd_check()
  345. {
  346. TEST=`$WHICH pkg_add | grep -v "not found" 2> /dev/null`
  347. if test -n "$TEST"; then
  348. VERSION_UNISTRING=`pkg_info -Nb libunistring`
  349. VERSION_GMP=`pkg_info -Nb gmp`
  350. echo "libunistring :"
  351. echo "$VERSION_UNISTRING"
  352. echo "GMP :"
  353. echo "$VERSION_GMP"
  354. fi
  355. }
  356. gettext_check()
  357. {
  358. TEST=`$WHICH gettext | grep -v "not found" 2> /dev/null`
  359. if test -n "$TEST"; then
  360. VER=`gettext --version | head -n1 2> /dev/null | awk '{print $4}'`
  361. infomsg "GNU gettext : $VER"
  362. else
  363. errormsg "GNU gettext : Not found"
  364. fi
  365. }
  366. # Merge curl_check + gnurl_check -> error if neither is
  367. # found (yes those systems exist)
  368. curl_check()
  369. {
  370. TEST=`$WHICH curl-config | grep -v "not found" 2> /dev/null`
  371. if test -n "$TEST"; then
  372. VER=`curl-config --version | head -n1 2> /dev/null | awk '{print $2}'`
  373. infomsg "libcurl : $VER"
  374. else
  375. infomsg "libcurl : Not found"
  376. fi
  377. }
  378. gnurl_check()
  379. {
  380. TEST=`$WHICH gnurl-config | grep -v "not found" 2> /dev/null`
  381. if test -n "$TEST"; then
  382. VER=`gnurl-config --version | head -n1 2> /dev/null | awk '{print $2}'`
  383. infomsg "libgnurl : $VER"
  384. else
  385. infomsg "libgnurl : Not found"
  386. fi
  387. }
  388. libmicrohttpd_check()
  389. {
  390. TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX`
  391. cat - >$TMPFILE.c <<EOF
  392. #include <microhttpd.h>
  393. #include <stdio.h>
  394. int main()
  395. {
  396. fprintf (stdout, "%X\n", MHD_VERSION);
  397. return 0;
  398. }
  399. EOF
  400. VER="Not found"
  401. gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  402. cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  403. rm -f $TMPFILE $TMPFILE.bin
  404. infomsg "libmicrohttpd : $VER"
  405. }
  406. glpk_check()
  407. {
  408. TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX`
  409. cat - >$TMPFILE.c <<EOF
  410. #include <glpk.h>
  411. #include <stdio.h>
  412. int main()
  413. {
  414. fprintf (stdout, "%u.%u\n", GLP_MAJOR_VERSION, GLP_MINOR_VERSION);
  415. return 0;
  416. }
  417. EOF
  418. VER="Not found"
  419. gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  420. cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  421. rm -f $TMPFILE $TMPFILE.bin
  422. infomsg "GNU GLPK : $VER"
  423. }
  424. gnutls_check()
  425. {
  426. TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX`
  427. cat - >$TMPFILE.c <<EOF
  428. #include <gnutls/gnutls.h>
  429. #include <stdio.h>
  430. int main()
  431. {
  432. fprintf (stdout, "%s\n", GNUTLS_VERSION);
  433. return 0;
  434. }
  435. EOF
  436. VER="Not found"
  437. gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  438. cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE`
  439. rm -f $TMPFILE $TMPFILE.bin
  440. infomsg "GnuTLS : $VER"
  441. }
  442. main()
  443. {
  444. infomsg "${progname} 0.11.0"
  445. infomsg
  446. infomsg "Please submit the following"
  447. infomsg "information with your bug report:"
  448. linemsg
  449. os_check
  450. awk_check
  451. gcc_check
  452. cc_check
  453. cplusplus_check
  454. gmake_check
  455. make_check
  456. autoconf_check
  457. automake_check
  458. libtool_check
  459. libextractor_check
  460. gnunet08_check
  461. gnunet09x_check
  462. gnunet010x_check
  463. gnunet011x_check
  464. gcrypt_check
  465. mysql_check
  466. pkgconf_check
  467. pkgconfig_check
  468. glib2_check
  469. gtk2_check
  470. gtk3_check
  471. gtk4_check
  472. gmp_check
  473. libunistring_check
  474. pkgadd_check
  475. gettext_check
  476. curl_check
  477. gnurl_check
  478. libmicrohttpd_check
  479. glpk_check
  480. gnutls_check
  481. linemsg
  482. infomsg "Bug report saved in ./my_gnunet_bugreport.log"
  483. }
  484. main "$@" 2>&1 | tee "my_gnunet_bugreport.log"