createrepo_c is a faster and more correct implementation of
generating rpm repositories, used by Fedora, openSUSE, and Mageia
for creating official distro repositories. It is also used by COPR
for creating repositories for packages built through its system.
The test suite tests both Python 2 and Python 3, but the spec file
doesn't install both sets of dependencies, so we need to declare
the Python 2 dependencies to be installed in the Dockerfiles.
In addition, there's no reason to drag in yum-utils, since
"dnf builddep" exists and serves the same purpose.
Previously, the `optparse` option parsing was not being done in the
call to `tito init`, which led to CLI invocations that used `--help`
not getting the helptext and instead getting the normal output of
`tito init`.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
CentOS 6 only has Python 2.6 available, on which the unit testing
frameworks do not expose a `.assertIn()` helper method. Instead, we can
use `.assertTrue(x in y)`.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
CentOS 6 only has rpmbuild 4.8 available, on which the `--noclean` option
is not present. We should only pass `--noclean` to `rpmbuild` when we
can determine that it is supported.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
Python 2.6 is the latest Python version available on CentOS 6. In Python
2.6, the newer formatting statements must have indexed formatting
specifiers, so you must write
"{0}{1}".format(foo, bar)
instead of:
"{}{}".format(foo, bar)
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
The output from `rpmbuild` is necessary to capture for determining which
artifacts were created as part of the build, so we cannot achieve quiet
output from `tito build --quiet` by passing `--quiet` to `rpmbuild` as
well. Instead we just don't print the output from the command unless it
fails.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
No `README.mkd` file exists, but `README.md` does. No files ending in
`.5` exist, but some manpages that end in `.5.asciidoc` do.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
The current output levels from `tito build` are both very verbose in the
case that nothing goes wrong and often missing full context when some-
thing does go wrong. By exposing `--quiet` and `--verbose`, the build
process should be able to modulate the amount of output coming from the
internal process and from `rpmbuild`.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
While file handles support the `.flush()` method, some of the more
UNIX-ey pipes and tees do not. We should try to `.flush()` when we
can, but not bother when we can't.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
Running the entire suite of containerized tests across all of the
platforms that are supported takes quite a while, especially if the
container images need to be built. Now, the platforms that are to be
tested can be specified with `$PY2_DISTROS` and `$PY3_DISTROS`.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
While the `tito.VersionTagger._get_new_tag()` method encapsulated some
of the version->tag mapping logic, other areas in the `VersionTagger`
used their own logic to do the mapping. This commit ensures that this
mapping happens in one place, which allows for custom implementations
to override the behavior simply.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
When debugging is turned on and a command is run that fails or with
`print_on_success` on, the output for the command execution ends up
being printed twice. This change ensures that only one set of output
is printed at any point.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
When using `$DEBUG=1`, often the output from different parts of `tito`
that output to different streams (for instance, `stderr` and `stdout`)
appears in the terminal in a garbled order. Furthermore, the stacktraces
generated by the Python interpreter are out of order with the output
from the `tito` process and often fragmented. By flushing the output
buffers on `tito.common._out()` we should be able to work around this.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
When using `tito build --install` on a system without `sudo`, such as
inside of a Linux container build, the current implementation fails.
Furthermore, if the user is running `tito build --install` with the
correct level of privilege, it is not necessary to escalate privileges
further for the installation step.
This patch adds the `--dont-escalate-privileges` flag to `tito build`
and defaults it to `True`, which keeps the behavior backwards compat-
ible. Users will want to use this flag when building RPMs inside of a
container or when running `tito build` with the requisite permissions
for installing in the first place.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
When a custom implementation of a tito Tagger is used, the mapping
function that is used to generate a tag from a version in the custom
Tagger must also be used in whichever tito Builder is used on that
repository. This commit factors out the mapping of version to tag so
that custom implementations of a Builder can inject custom logic here
with minimal effort, as is possible on the tito.VersionTagger by
overriding the _get_new_tag() function.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
In 26b02a7, the utility of the `ForceVersionTagger` was merged with the
base `VersionTagger`, so it is no longer necessary to ever explicitly
invoke the `ForceVersionTagger` class. Furthermore, the `elif` and
`else` branches of the decision tree for the tagger class were identical
in the previous implementation, so they were collapsed as well. The
remaining tagger class assignment is a simple query of the `tito.props`
file.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
From the looks of it, the `globalconfig` section is deprecated and
adding anything to that section of `tito.props` results in an error:
WARNING: Please rename [globalconfig] to [buildconfig] in tito.props
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>