This means that adding a non-Maven generated tarball is of no use to
the release process. Set Tito to fail if Maven isn't configured to
yield a tarball via the assembly plugin.
Maven doesn't have any ability that I can find to run a build against a
specific git ref. Instead, we create a temporary checkout based on the
working directory, switch that checkout to the required ref, and then
build.
These tests began failing after a correction to another test. The
other test had been patching the error_out function without unpatching
it and thus polluted the test environment.
Also reset to a known directory at the beginning of the common tests so
that we don't start in a directory that has since been unlinked.
The Maven-generated tar file deviates from the spec in several places.
Fields are padded out with spaces instead of NUL bytes and the user and
group ID are left empty.
This patch alters the tar module to correct these issues and ensures a
consistent unchanging fingerprint for the archive by setting the mtime
on the files to the modified time of the commit.
Treat Maven options as key-value pairs and add on the necessary '-D' in
code. The maven-build command in rhpkg wants key-value format so for
that we don't have to do anything at all.
The Python 2.4 style of getting an exception object is forbidden by the
test_exceptions_3 test. Something has to give, and Tito is not being
built for RHEL 5 anymore.
Tito can now build a project with Maven, expose the Maven artifacts to
a Cheetah template, and then build the SRPM (and RPM) using the
rendered template and the Maven artifacts.
Python's read(N) function only guarantees that it will read no more
than N bytes but not that it will return N bytes. This patch adds a
function that will ensure exactly N bytes are read.
Tito passes "git archive" a tree ID. The "git archive" man page states:
git archive behaves differently when given a tree ID versus when
given a commit ID or tag ID. In the first case the current time
is used as the modification time of each file in the archive.
Using the current time means that every time we build the source
tarball, the file fingerprint will change since the metadata in the
tarball changes. We don't want that since build systems track the
fingerprint to see if the actual source has changed.
This process was previously handled in an enigmatic Perl script that
lacked any comments whatsoever. Converting it to well-commented Python
makes the process less mysterious and speedier since Tito doesn't need
to shell out to Perl.
Here's an initial go at getting some bash-completion for the tito
command-line. Module options are a union of those culled from both
"tito MODULE --help" and "man tito" -- there are discrepancies. Some
options were deliberately omitted such as those documented as deprecated
or "avoid using this please". All short options are also omitted as
their completion would not save any typing but would hinder the
accessibility of the longer options.