Decouple the determination of packages that need importing from the
actual importing of them by relaying this information via persistent
state.
This shouldn't result in any functional changes.
This will later allow us to put the two things into separate processes,
so that a problem with one part need not affect the other. Further in
the future we will also be able to arrange separate worker processes for
individual import runs using this structure.
Switch to using a database to store persistent information, since we
will soon persist more data than just the current last-seen timestamp
information.
This should not change any existing behaviour except to persist the data
in a database called db instead of a text file called
import-source-packages-log.
There is no consideration for migration of existing persisted data. The
existing git ubuntu importer service operator (me) will have to handle
this by hand.
The replacement implementation is in gitubuntu/importer_service.py so
that it can be tested using the existing framework. In time, I expect to
move more implementation detail into gitubuntu/, leaving bin/ containing
the argparse stubs only.
Move the directory in which we keep persistent state into the one
specified by --data-directory, defaulting to /var/local/git-ubuntu.
This directory must exist.
This moves the previously used directory /tmp into somewhere that can
be expected to persist. This impacts git-ubuntu importer operators,
since they now need to make sure that a persistent area is ready before
use.
This applies to the importer service only. Users of the "git-ubuntu" CLI
tool, as opposed to the operators of the importer, are not affected.