rpm: implement file path filters in patch export

Implements a filter option allows one to filter out changes to certain
files/paths in the patch-generation. A commit is totally ignored if all
files would be filtered out. The path filter is given as a Python
regexp.

This option is useful for example in filtering out the changes to
packaging files when maintaining packaging and sources in the same
branch.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
buildpackage-rpm: return 2 for patch-export or tarball generation errors

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: Add doctests to RpmPkgPolicy

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-srpm: suppress some pylint warnings

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: circumvent a bug in python-rpm

Which caused the packager tag to be incorrect in some cases. Rpm-python
doesn't seem to reset spec.sourceHeader[rpm.RPMTAG_PACKAGER] if no
packager tag is defined in the spec file. Thus, if we (in the same
context) first parse spec A (which has a packager tag) and then spec B
(which doesn't have a packager tag) python-rpm will give the packager of
A for B as well.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
tests: add unittests for gbp.rpm

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
docs: update rpm documentation

Sync with the latest version of the git-buildpackage RPM tools. Also add
more content to the "building" and "development" sections.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
import-srpm: return 2 if patch import fails

A new return value for failed patch import. If the patch import fails
the repo is left in clean and buildable state so one might want to
distinguish that from other failures.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
buildpackage-rpm: fail patch-export if local patches found

Make patch export fail if local patch files (not marked for manual
maintenance) exist.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
TODO: add rpm todo

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
debian packaging: HACK: disable test in Debian builds

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
packaging: Add new file packaging/.test-requires

This new file contains distro-specific list of
packages that are needed for testing. These are
written in separate file to avoid polluting specfiles,
and are used by automatic testing script.

Signed-off-by: Olev Kartau <olev.kartau@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
packaging: HACK the version number for Tizen

We can get into sync with upstream version numbering when 0.6.1 is
released...

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
packaging: make it easier to track Tizen releases

RPM: Add a 'Provides:' tag to the git-buildpackage-rpm subpackage in
order to be able to track Tizen releases.

DEB: Add a corresponding release number to the version field in
changelog of Debian packaging.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: configuration option for setting the output color scheme

Adds the new 'color-scheme' option to the rpm tools.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: circumvent an rpm-python macro expansion problem

Parse the spec file two times to circumvent a rpm-python problem which
causes macros not to be correctly expanded if used before their
definition.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: implement a simple doubly linked list

This class is intended to store the spec file content, needed for
modifying the spec file.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: use linked list to store spec content

Tries to make spec parsing and updating more robust by using a linked
list to represent spec content, instead of using normal list and trying
to track line numbers. Deleting and adding lines should be safer, now.
Also, consolidates the regexp usage of spec parsing a bit.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: rename the 'GbpIgnorePatch' special key in spec parsing

to 'Gbp-Ignore-Patches' for better readability. All the special keys (or
"gbp-tags") now have to start with the "Gbp-" prefix.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
rpm: introduce new 'Gbp-Patch-Macros' special key in spec parsing

This can be used to mark location where to add new patch macros when
updating the spec.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>