Commit graph

901 commits

Author SHA1 Message Date
Devan Goodwin
58b0e0a385 Revert "use LC_ALL=C.UTF-8 rather than plain C" 2017-05-25 08:09:24 -03:00
Devan Goodwin
8e750823f9 Merge pull request #286 from xsuchy/lc
use LC_ALL=C.UTF-8 rather than plain C
2017-05-24 09:22:57 -03:00
Miroslav Suchý
89ebaa23ce use LC_ALL=C.UTF-8 rather than plain C
addressing:
Python runtime initialized with LC_CTYPE=C (a locale with default ASCII encoding), which may cause Unicode compatibility problems. Using C.UTF-8, C.utf8, or UTF-8 (if available) as alternative Unicode-compatible locales is recommended.
2017-05-24 13:37:22 +02:00
Steve Kuznetsov
6566ec5646 Merge pull request #284 from stevekuznetsov/skuznets/formatting
Format package list more cleanly
2017-05-23 12:43:50 -04:00
Steve Kuznetsov
7f6d1a5e14
Format package list more cleanly
When building a large number of packages, the current output from tito
will place all of them on one very long line, which makes it hard to
read. Instead, we should place them on separate lines to format them
more like a list.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-05-19 16:34:15 -07:00
Devan Goodwin
49cb674f25 Merge pull request #278 from vrutkovs/tag_format_release
Custom tag support in tito release
2017-05-05 09:34:33 -03:00
Vadim Rutkovsky
aadafd4e87 Custom tag support in tito release
Signed-off-by: Vadim Rutkovsky <vrutkovs@redhat.com>
2017-05-05 12:35:23 +02:00
Devan Goodwin
1310954605 Merge pull request #277 from vrutkovs/releaseless_tagger
VersionTagger support for custom tag format
2017-05-02 08:51:00 -03:00
Vadim Rutkovsky
3a08af27ce VersionTagger should support custom tag format
It allows projects to format their own tags
2017-04-28 17:03:35 +02:00
Devan Goodwin
74e39e3dd8 Merge pull request #276 from Conan-Kudo/use-createrepo_c
Switch to using createrepo_c for creating rpm repos and drop end-of-life EL5 stuff
2017-04-10 08:45:42 -03:00
Neal Gompa
1906fbd900 Remove createrepo_c BR from spec
It's not even used while building the tito package...
2017-04-09 18:10:51 -04:00
Neal Gompa
cbaa09697f Use createrepo_c for creating rpm-md repos
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.
2017-04-01 18:27:19 -04:00
Neal Gompa
0929d2d296 Fixup Fedora Dockerfiles to work correctly
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.
2017-04-01 18:27:19 -04:00
Neal Gompa
18a21c6c5b Remove useless EL5 stuff
Red Hat Enterprise Linux 5 and its derivatives are now EOL.
2017-04-01 14:55:25 -04:00
Devan Goodwin
b5597fc429 Automatic commit of package [tito] release [0.6.10-1].
Created by command:

/usr/bin/tito tag
2017-02-01 10:51:34 -04:00
Devan Goodwin
4ac375ef6a F25 branches update. 2017-02-01 10:49:54 -04:00
Steve Kuznetsov
12d1eb49e9 Merge pull request #271 from stevekuznetsov/skuznets/init-options
Parse options in `tito init`
2017-01-30 09:31:35 -05:00
Steve Kuznetsov
10f5cfa0c2 Merge pull request #270 from stevekuznetsov/skuznets/better-undo
Do not undo tags when git state is dirty
2017-01-30 09:30:38 -05:00
Steve Kuznetsov
ce7cb5b3c7
Do not undo tags when git state is dirty
When using `tito tag --undo` in a repository with a dirty
`git` state, no action should be taken.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-30 08:03:03 -05:00
Steve Kuznetsov
c175a04f88
Parse options in tito init
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>
2017-01-30 08:02:51 -05:00
Steve Kuznetsov
26219abfde Merge pull request #269 from stevekuznetsov/skuznets/python-26-compat
Iron out Python 2.6 incompatibilities for CentOS 6
2017-01-26 16:10:32 -05:00
Steve Kuznetsov
ed0d21708b
Use .assertTrue() instead of .assertIn()
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>
2017-01-26 15:54:41 -05:00
Steve Kuznetsov
27be5761d1
Only use rpmbuild --noclean if it is supported
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>
2017-01-26 15:54:41 -05:00
Steve Kuznetsov
5580b02c13
Explicitly define indicies in formatting statements
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>
2017-01-26 15:54:41 -05:00
Devan Goodwin
9f89a7eaa0 Merge pull request #268 from stevekuznetsov/skuznets/updaets
Updates to the MANIFEST and `tito build --quiet`
2017-01-26 16:06:23 -04:00
Steve Kuznetsov
22bf7485d7
Achieve quiet output from rpmbuild without passing --quiet
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>
2017-01-26 14:26:02 -05:00
Steve Kuznetsov
287f9dccdb
Update the MANIFEST.in
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>
2017-01-26 14:26:02 -05:00
Steve Kuznetsov
e41712706f
Correctly pass verbosity options through the builder CLI
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 14:26:01 -05:00
Steve Kuznetsov
4716654c7c
Use correct print-formatting directive in debugging
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 14:26:01 -05:00
Steve Kuznetsov
efab80283d Merge pull request #250 from stevekuznetsov/skuznets/fix-rawhide-tests
Work around `dnf` issues and install builddep for Rawhide
2017-01-26 13:39:39 -05:00
Devan Goodwin
1753549a74 Merge pull request #266 from stevekuznetsov/skuznets/travis
Add a Travis CI manifest
2017-01-26 11:10:08 -04:00
Devan Goodwin
77919a9912 Merge pull request #264 from stevekuznetsov/skuznets/build-verbosity
Added `--quiet` and `--verbose` to `tito build`
2017-01-26 11:00:39 -04:00
Steve Kuznetsov
95a6f1352b
Use .format() string formatting correctly in Builder
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
e8297aa5be
Refactor rpmbuild invocation for readability
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
db654d1437
Added --quiet and --verbose to tito build
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>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
0ebcf99443
Add a Travis CI manifest
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:56:15 -05:00
Devan Goodwin
77736f370f Merge pull request #265 from stevekuznetsov/skuznets/tag-mapping
Refactored version->tag mapping logic in Tagger
2017-01-26 10:03:41 -04:00
Steve Kuznetsov
ae4b761829
Only flush output stream if flushing is supported
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>
2017-01-26 08:42:30 -05:00
Steve Kuznetsov
81dc44d611
Added support for choosing platforms for tests
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>
2017-01-26 08:42:30 -05:00
Steve Kuznetsov
7154ac479a
Refactored version->tag mapping logic in Tagger
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>
2017-01-26 08:42:30 -05:00
Devan Goodwin
b277962316 Merge pull request #262 from stevekuznetsov/skuznets/force-flush
Flush output buffers
2017-01-26 08:47:36 -04:00
Devan Goodwin
ced4e19743 Merge pull request #263 from stevekuznetsov/skuznets/command_debug
Updated some debugging statements
2017-01-26 08:46:24 -04:00
Steve Kuznetsov
66a0a9edac
Improved debugging for RPM build step
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 17:31:10 -05:00
Steve Kuznetsov
459b377a3d
Print command debugging information only once
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>
2017-01-25 17:31:09 -05:00
Steve Kuznetsov
b5e8182c69
Flush output buffers
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>
2017-01-25 17:28:35 -05:00
Devan Goodwin
1aa39dc089 Merge pull request #261 from stevekuznetsov/skuznets/tag-version-mapping
Factor out the version->tag mapping in the Builder
2017-01-25 12:10:26 -04:00
Devan Goodwin
f37a510191 Merge pull request #260 from stevekuznetsov/skuznets/non-escalating-install
Added an option to not escalate privileges on `tito build --install`
2017-01-25 12:09:49 -04:00
Steve Kuznetsov
44b18596ec
Document tito tag --use-release in the manpage
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 10:10:08 -05:00
Steve Kuznetsov
b537fe0607
Added an option to not escalate privileges on tito build --install
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>
2017-01-25 10:10:08 -05:00
Steve Kuznetsov
ed2c0a8ce9
Factor out the version->tag mapping in the Builder
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>
2017-01-24 17:53:50 -05:00