MT#5301 add upstream fixes

(cherry picked from commit 201877e2f163f00bde2b2572feb2a85ed9d16009)
MT#5891 wrap-and-sort

(cherry picked from commit b11a51d0289d5ada4abbf61eea23fcafd28a540c)
MT#5891 fix lintian warnings

(cherry picked from commit 65a2db49001c59aaa9595ad3e310dde34580c5bc)