core/utils: ensure system-wide APT configuration doesn't interfere with ours

Unfortunately "import apt" parses the configuration file before we had a
chance to create our own apt.conf pointed by APT_CONFIG. Thus I opted
to manually clear all the configuration entries before each call to
apt_pkg.init().

To avoid any problem I explicitely set all the important directory
settings to subdirectories of our apt-cache directory.
core/utils: use correct path to "lists" directory

The commit e34d8aaaca11b0706ffa9a773f65442c9c24c987 changed the directory
layout and failed to update parts that were hardcoding the old directory
layout. Rather than hardcoding the path, we now retrieve it from apt's
configuration.
core/retrieve_data: fix _mark_file_not_processed in the case of binary packages

It looks like this function never really worked in the specific case
of Packages files and it's really called only when the Packages files
has not been updated which doesn't happen often with the only binary
repository that we track by default (unstable).
core/utils: fix clear_cache() to restore the cache in a proper initial state

Regression introduced in e34d8aaaca11b0706ffa9a773f65442c9c24c987.
core/templates: drop invalid browse link when no Vcs-Browser field defined

Closes: #759486
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Add infrastructure to generate coverage report

bin/gen-coverage.sh is the script that you should run to generate
a coverage report in the "coverage.html" directory. It will use
tox to run the tests in a Python 2 based environment and then a Python 3
based environment and will combine the result of both run.

There's some hackery needed to make it work with both the Debian packages
python{3,}-coverage and the pypi-installed coverage. The former are using
python-coverage and python3-coverage as executables while the latter uses
the (much too generic) "coverage".
Use "python -m coverage" to avoid calling the script whose name varies

Thanks to this we don't need to provide the name of the executable(s)
in the environment.
tox: exclude .ropeproject directories created by python-vim from the flake8 test
vendor/debian: store "Accepted" mail even if package doesn't exist yet

Closes: #754891
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
core: display a package page for former source packages too

Former source packages are identified by the fact that they
have associated news.

[hertzog@debian.org:
- Update the docstring in get_web_package()
- Add a comment to explain the logic
]

Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
tox: ignore distro_tracker/project/settings/local.py in flake8 test

That file is never committed and not part of our codebase. Still add
proper flag in the sample file to shut up flake8 in case the users is
running it manually.
core/models: add Repository.is_development_repository()

Identifying development repositories is important to know when a package
is going away (because it's no longer in any development repository).

Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
core: add a panel displaying a warning when the package is gone

We distinguish two cases:
- when the package disappeared completely from all repositories
- when the package has been dropped from the development repositories

Closes: #756741
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>