lintian-junit-report: Allow passing options to lintian

This patch adds support for passing options directly to lintian,
allowing things like

lintian-junit-report \
    --lintian-opt=-Xsource-copyright,copyright-file *.deb

for those who like to break Debian Policy on purpose :). To be sure that
arguments are passed correctly lintian process is now executed with
IO::popen.
lintian-junit-report: Accept multiple file arguments

Usage note promises possibility of passing multiple files to check,
which hasn't been actually supported until now.
Support POST_BUILD_HOOK at the end of the build process

E.g. useful if you want to run 'debc *.changes' as part of
the build process.
Make lintian-junit-report ruby 1.8 safe

The changes from commits 7a974f4f and 21b8527d don't work when
running on Ruby 1.8:

| /usr/bin/lintian-junit-report:85:in `popen': can't convert Array into String (TypeError)
| 	from /usr/bin/lintian-junit-report:85
lintian-junit-report: quote XML strings
lintian-junit-report: Convert output to XML after parsing

First thing first, original conversion creating intermediate REXML::Text
object and then converting it to string results in a more complex
wrapper around REXML::Text::normalize, which actually does the job which
is simply translating some characters to XML entities.

Although I know which characters are going to be converted
(REXML::DocType::DEFAULT_ENTITIES which is: ", &, < and >) and those
should not make difference in the parts of output being parsed it still
feels better for me to parse raw unmodified lintian output.

So instead of converting lintian output at once this change XML-escapes
string where needed. As additional bonus original lintian margins are
kept in output (previously those were squeezed).
lintian-junit-report: Simplify matching error/warning lines
lintian-junit-report: Name test cases after lintian tags

This patch improves representation of lintian results in Jenkins. All
the lintian results are now in package called "lintian" to separate them
from other aggregated tests. The next level of grouping in Jenkins are
classes and for those package name from lintian output is used. The
spaces in package field in lintian output are preserved, as Jenkins
doesn't care about "class" names with spaces. Finally lintian tag and
arguments (i.e. rest of line) form the test case name.
lintian-junit-report: Split lintian output between test cases

This makes only the appropriate part of lintian output to go to test
case. The error line is put as is into Stacktrace (i.e. <failure> tag)
and "Standard Output" is filled in with lintian tag information (if not
disabled).
lintian-junit-report: Fix reported total time for TCs
Add support for user-defined BINDMOUNTs
Force local apt repos to be trusted
Merge branch 'force-trusted-repos' of https://github.com/efine/jenkins-debian-glue
Merge remote-tracking branch 'remotes/origin/pr/63'

https://github.com/mika/jenkins-debian-glue/pull/63
Speed up pbuilder: disable building of manual pages with a hook script

Credits: Debian bug #561539
Add execute permissions to D10-man-db
Rework generate-git-snapshot to make sure quilt can't break the build

When using the dpkg 3.0 (quilt) format (see debian/source/format)
there might be quilt patches still applied in the source tree,
either because of a broken build or under certain - though not yet
clearly identified - situations which seem to end with a
"diff: standard output: Broken pipe" message in the build log.

This then might end up in a build failure like:

| + cd /var/lib/jenkins/workspace/glusterfs-source
| + dpkg-source -i -I -b source
| dpkg-source: info: using source format `3.0 (quilt)'
| diff: standard output: Broken pipe
| diff: standard output: Broken pipe
| dpkg-source: info: building glusterfs using existing ./glusterfs_3.2.7.orig.tar.gz
| dpkg-source: info: local changes detected, the modified files are:
|  source/ChangeLog
|  source/doc/gluster.8
|  source/doc/glusterfs.8
|  source/libglusterfs/src/common-utils.c
|  source/rpc/rpc-lib/src/rpcsvc.c
|  source/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
| dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/glusterfs_3.2.7-2~bpo60+1.diff.3Wkisr
| dpkg-source: info: you can integrate the local changes with dpkg-source --commit

While everything has been cleanly integrated in debian/patches/
the build process fails because it looks like there have been
modifications to upstream sources whereas it's just wrong
information about patches applied.

So instead make sure we enter a clean git repository before doing
any changes (this can be skipped via SKIP_GIT_CLEANUP=true) and
also unapply all present quilt patches (this can be skipped via
SKIP_QUILT_CLEANUP=true). Finally replace the dpkg-source call
with dpkg-buildpackage and its --source-option=--unapply-patches
feature. While the combination of the git cleanup, quilt cleanup
and dpkg-source->dpkg-buildpackage is more than explicitely
necessary this provides more flexibility if needed.

Thanks: Raphael Hertzog <hertzog@debian.org> for his dpkg related feedback
Remove *_source.changes file generated by dpkg-buildpackage in *-source job [Closes: #67]

The recent commit to make sure quilt can't break the build (git
commit 63d6c47) made a switch from dpkg-source to
dpkg-buildpackage. dpkg-buildpackage generates a *_source.changes
file which isn't present when using dpkg-source. While this file
is nice it doesn't provide any real value for us, but what's more
important, it might break existing setups:

If all files are copied around from one Jenkins job to another
then in the final jenkins job the changes file from the binaries
job and the source.changes one end up together. If those are
passed to other tools then things might break (see github issue
67 as an example). So let's just remove the file after the
dpkg-buildpackage call to provide the used behaviour.
build-and-provide-package: Look only for the "real" debian/control file

Otherwise this breaks in a situation like that:

| % tar atf autopkgtest_2.3.5~pgdg70+1.tar.gz | grep control
| -rw-r--r-- 0/0             297 2013-09-25 08:51 source/tests/testpkg/debian/control
| -rw-r--r-- 0/0             151 2013-09-25 08:51 source/debian/tests/control
| -rw-r--r-- 0/0            1982 2013-09-25 08:51 source/debian/control

Thanks: Christoph Berg <christoph.berg@credativ.de> for the bugreport and fix
lintian-junit-report: Use REXML to generate XML output

Parsing lintian output in two runs in order to collect summary of
results had shortcomings - extending the code further to support skipped
tests would require replicating conditional logic in two separate
places. One of the possibilities to fix this would be to keep all but
header output in memory, then print the header and dump the collected
output. However using REXML::Document seemed a better idea resulting in
more readable code. And in fact the change makes the code 5 lines
shorter! ;)

I use REXML::Formatters::Transitive for output, as it preserves exact
text format, even though this makes XML look a bit unusual.