Universal configurable base tmpdir for all gbp rpm tools

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
buildpackage-rpm: support special tree-ish names in --git-upstream-tree

Support special 'WC*' and 'INDEX' values for the --git-upstream-tree
option.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
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>
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>
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>
rpm: simplify the SrcRpmFile class a bit

Get rid of the unnecessary private methods.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
tests: add more comprehensive tests for import-srpm

Basic tests for virtually all features of import-srpm.

Adds a new python module to include all (upcoming) git-buildpackage rpm
commandline tool tests. Also, adds a separate git submodule for the rpm
test data.

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