Commit graph

1154 commits

Author SHA1 Message Date
Nikos Moumoulidis
0729445d2f Make build --verbose autocompletable 2021-05-11 20:59:34 +02:00
William Poteat
883754e2e5 Add support for centpkg 2021-05-11 17:10:05 +02:00
Allen Reese
0dbcfc4554 Remove extraneous extra newline 2021-05-11 02:03:07 +02:00
Allen Reese
8570695097 Add some documentation for tito.builder.SubmoduleAwareBuilder 2021-05-11 02:03:07 +02:00
Allen Reese
71c2712e7e Update based on feedback:
1. Remove PushDir, tito.common.chdir has the same functionality so use that instead.
2. Remove useless override of constructor, it's just extra noise.
2021-05-11 02:03:07 +02:00
Allen Reese
f4251b30cd 150 Add support for repos that use submodules.
Allow though submodules are a contentious topic, this adds a submodule_aware_builder

This can be used with the following config in tito.props:

```
[buildconfig]
builder = SubmoduleAwareBuilder
```
2021-05-11 02:03:07 +02:00
Link Dupont
88699fdf0b doc: fix typo tito.props 2021-04-15 02:18:22 +02:00
Jakub Kadlcik
286d5e4131 Update fedora releaser in .tito/releasers.conf 2021-01-26 16:42:31 +01:00
Jakub Kadlcik
0cbcb8a5e8 Automatic commit of package [tito] release [0.6.16-1].
Created by command:

/usr/bin/tito tag
2021-01-26 16:34:24 +01:00
Pavel Raiskup
6198e4d203 Enable Packit pull-request CI
Enable it on all currently supported Fedora/EPEL architectures.

Packit doesn't support our way of preparing source RPMs via the command
'tito build --srpm --test', but creates it's own source RPM instead.
This doesn't seem to cause a practical problems, so we are good to go
for now till the Packit RFE is implemented:
https://github.com/packit/packit-service/issues/920

Fixes: #395
2021-01-12 17:45:46 +01:00
Jakub Kadlcik
d96c9c7d7a Stop running tests for F27 in favor of F33 2021-01-12 16:27:27 +01:00
Jakub Kadlcik
6a216b2ea6 Fix manpage generation on Fedora Rawhide (F34)
I believe this is a `a2x` bug, not ours, so I am just workarounding it until the
issue gets fixed. The error looks like this

    [root@449665d34a95 sandbox]# a2x -d manpage -f manpage tito.8.asciidoc --verbose
    a2x: args: ['-d', 'manpage', '-f', 'manpage', 'tito.8.asciidoc', '--verbose']
    a2x: resource files: []
    a2x: resource directories: ['/etc/asciidoc/images', '/etc/asciidoc/stylesheets']
    a2x: executing: "/usr/bin/asciidoc.py" --backend docbook -a "a2x-format=manpage"  --doctype manpage --verbose  --out-file "/home/sandbox/tito.8.xml" "/home/sandbox/tito.8.asciidoc"

    asciidoc: reading: /etc/asciidoc/asciidoc.conf
    asciidoc: reading: /home/sandbox/tito.8.asciidoc
    asciidoc: include: /home/sandbox/man.asciidoc
    asciidoc: tito.8.asciidoc: line 3: reading: /home/sandbox/man.asciidoc
    asciidoc: reading: /etc/asciidoc/docbook45.conf
    asciidoc: reading: /etc/asciidoc/filters/graphviz/graphviz-filter.conf
    asciidoc: reading: /etc/asciidoc/filters/source/source-highlight-filter.conf
    asciidoc: reading: /etc/asciidoc/filters/code/code-filter.conf
    asciidoc: reading: /etc/asciidoc/lang-en.conf
    asciidoc: writing: /home/sandbox/tito.8.xml
    asciidoc: include: /home/sandbox/AUTHORS
    asciidoc: tito.8.asciidoc: line 299: reading: /home/sandbox/AUTHORS

    a2x: executing: "xmllint" --nonet --noout --valid "/home/sandbox/tito.8.xml"

    I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
    /home/sandbox/tito.8.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
    D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
										^
    /home/sandbox/tito.8.xml:5: validity error : Validation failed: no DTD found !
    <refentry lang="en">
		    ^

    a2x: ERROR: "xmllint" --nonet --noout --valid "/home/sandbox/tito.8.xml" returned non-zero exit status 4
2021-01-12 16:27:27 +01:00
Jakub Kadlcik
d41626d181 Print filenames that doesn't comply PEP8
The old output was missing filenames, e.g.

    AssertionError: Found PEP8 errors that may break your code in Python 3:
    2       E201 whitespace after '['
    3       E202 whitespace before ']'
    2       E203 whitespace before ':'
    1       E221 multiple spaces before operator
    1       E302 expected 2 blank lines, found 1
    2       E303 too many blank lines (2)

That's now usefull at all. Where the heck should I search for these errors. The
new output is a little bit messy but contains more usefull information, e.g.

    AssertionError: Found PEP8 errors that may break your code in Python 3:
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:9:1: E302 expected 2 blank lines, found 1
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:17:66: E202 whitespace before ']'
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:21:15: E203 whitespace before ':'
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:22:16: E203 whitespace before ':'
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:26:18: E201 whitespace after '['
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:26:32: E202 whitespace before ']'
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:29:15: E201 whitespace after '['
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:29:32: E202 whitespace before ']'
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:35:17: E221 multiple spaces before operator
    /tito/test/unit/../../src/tito/release/LocalYumRepo.py:76:5: E303 too many blank lines (2)
2021-01-12 16:27:27 +01:00
Jakub Kadlcik
998f7fb067 Make tests working on systems without non-versioned python macros
See RHBZ 1784688

We are using unversioned python macros, such as `%__python` and
`%python_sitelib` which are not supported in Fedora rawhide
anymore. Instead, we should use `%__python3` and `%python3_sitelib`.
2020-10-12 11:39:27 +02:00
Jakub Kadlcik
861d15518e Ignore spectool warnings
Without this change, the spectool output can look like this

    [root@e15222e75294 pkg1]# spectool -S titotestpkg.spec | awk '{print $2}'
    warning: Macro expanded in comment on line 37: %{python3_sitelib}/%{name}

    titotestpkg-0.0.1.tar.gz

and then each of the lines is considered to be a SourceX file. We
should really ignore the warnings.
2020-10-06 21:44:14 +02:00
Jakub Kadlcik
00ee487ed2 Skip nonexisting extra sources
Make the `copy_extra_sources` method more foolproof and don't
traceback when a SourceX file doesn't exist.
2020-10-06 21:44:14 +02:00
Jakub Kadlcik
5947384f32 Fix copy_extra_sources for remote URLs
Fix #387

A build with a remote URL in its `SourceX` will work only with

    %_disable_source_fetch 0

macro defined. It can be done either globally via `~/.rpmmacros` or by
using tito with following parameter

    --rpmbuild-options="--define '%_disable_source_fetch 0'"

IMHO this macro should be set by default but we should also introduce
a switch to turn it off (like e.g. Mock or Copr do). Since it is not
related to fixing #387, I am not doing it in this commit.
2020-10-06 16:20:05 +02:00
Jiri Hnidek
d9ed1db7da Do not use absolute path to generate-patches.pl script
* When tito is installed using pip, then generate-patches is
  installed into the ~/.local/bin directory and the absolute
  path cannot work
2020-10-02 11:57:37 +02:00
Jakub Kadlcik
5575554c95 Use --no-rebuild-srpm for scratch builds in KojiReleaser
Fix #382
2020-08-11 18:00:04 +02:00
Jakub Kadlcik
2a9178dcf2 Automatic commit of package [tito] release [0.6.15-1].
Created by command:

/usr/bin/tito tag
2020-07-10 11:06:05 +02:00
Jakub Kadlcik
7f95272004 Do not release for F30 anymore 2020-07-10 10:59:41 +02:00
Jakub Kadlčík
0d4f1ccd38
Merge pull request #379 from praiskup/copy-extra-sources-fedora-releaser
FedoraGitReleaser: upload extra sources to lookaside cache
2020-06-13 23:11:22 +02:00
Pavel Raiskup
13331c7509 FedoraGitReleaser: upload extra sources to lookaside cache
Related to https://pagure.io/copr/copr/pull-request/1397
2020-06-11 09:49:33 +02:00
Jakub Kadlčík
15ecd02524
Merge pull request #378 from jirihnidek/master
When extra source file exist, then do not copy it
2020-05-28 13:25:12 +02:00
Jiri Hnidek
19fc14842b When extra source file exist, then do not copy it
* Extra source file can be copied/moved by some other tool
* When the source file already exists in destination path, then
  do not try to copy it once again
* This issue was observed, when we tried to build
  subscription-manager on Fedora 32 using tito
2020-05-28 13:00:46 +02:00
Jakub Kadlcik
1ec010e0cd Automatic commit of package [tito] release [0.6.14-1].
Created by command:

/usr/bin/tito tag
2020-05-04 11:46:23 +02:00
Jakub Kadlčík
b9fc2a3f5e
Merge pull request #376 from FrostyX/fix-copy-extra-sources
Fix copy_extra_sources for alternative builders
2020-05-04 10:58:08 +02:00
Jakub Kadlčík
29125932ff
Merge pull request #375 from FrostyX/projects-managed-with-tito
Add a list of projects using tito
2020-05-04 10:56:12 +02:00
Jakub Kadlčík
27cb63e043
Merge pull request #374 from FrostyX/less-aggressive-yes-or-no
Make yes or no input less aggressive
2020-05-04 10:55:53 +02:00
Jakub Kadlčík
1602fbe8db
Merge pull request #373 from FrostyX/optional-bugzilla
Move bugzilla code to a separate file
2020-05-04 10:55:27 +02:00
Jakub Kadlčík
1fcecdb77f
Merge pull request #370 from FrostyX/tito-init-existing
Separate .tito directory creation from tito.props file creation
2020-05-04 10:54:24 +02:00
Jakub Kadlcik
c3c1de77cc Fix copy_extra_sources for alternative builders
Fix #367

We accidentally introduced `copy_extra_sources` method as a part of
`BuilderBase` class. Which wouldn't be a problem, except for the fact
that its implementation uses properties, that are not a part of
that class but are rather defined in **some** of its descendats.

Let's define this method only abstractly and let more specific
builder classes to provide their own implementation if it makes
sense for them.
2020-04-26 22:51:49 +02:00
Jakub Kadlcik
a087b017d0 Add a list of projects using tito
Fix #243
2020-04-26 14:59:38 +02:00
Jakub Kadlcik
ad74e00a77 Make yes or no input less aggressive
Fix #364

Previously all non-yes input was considered to be "no". Which is not
what we typically want. There should be expected "yes" inputs, expected
"no" inputs and everything else should be considered to be an uknown
input and should be treated this way.

I think that printing an error for unknown input is too verbose and have
no added value. Simply repeating the question is the way to go here:

    ##### Please review the above diff #####
    Do you wish to proceed with commit? [y/n] foo
    Do you wish to proceed with commit? [y/n] y
    Proceeding with commit.
2020-04-26 14:13:35 +02:00
Jakub Kadlcik
ecd5718f62 Define a small abstraction for mocking builtins
It's better to do the python2 and python3 compatibility magic on
one place rather than having having `if PY2` conditions everywhere
and figuring whether to use `builtins.foo` or `__builtin__.foo
over and over again.
2020-04-26 14:13:35 +02:00
Jakub Kadlcik
3a62bb6613 Move bugzilla code to a separate file
Fix #358

Previously the bugzilla-specific code was implemented in `tito.common`
which is imported from everywhere. Therefore missing dependency
to `python3-bugzilla` resulted in failure even for simple commands
such as `tito build --tgz`.
2020-04-24 18:22:17 +02:00
Jakub Kadlčík
6e1ebf4a3f
Merge pull request #372 from FrostyX/changelog-datetime
Add a possibility to have full datetime entries in changelog
2020-04-24 17:54:31 +02:00
Jakub Kadlcik
219efc50a2 Add a possibility to have full datetime entries in changelog
Fix #305

Unfortunatelly we need to use `pytz` instead of `datetime.timezone`
because of python2.
2020-04-24 17:41:00 +02:00
Jakub Kadlcik
3e5450a533 Separate .tito directory creation from tito.props file creation
Fix #158

As a consequence we can easily print a different message when running
`tito init' an already initialized tito project.
2020-04-23 11:51:35 +02:00
Jakub Kadlčík
e3173db770
Merge pull request #368 from FrostyX/init-path-with-space
Use mkpath instead of running mkdir -p command
2020-04-23 11:50:23 +02:00
Jakub Kadlcik
a72d4fbe50 Move is_rawhide and is_epel6 definitions to __init__ so other tests can use it 2020-04-23 11:35:03 +02:00
Jakub Kadlčík
754c2f72bc
Merge pull request #371 from FrostyX/version-template
Implement --version parameter
2020-04-20 09:59:09 +02:00
Jakub Kadlčík
09ffde545a
Merge pull request #369 from FrostyX/filedigest-md5
Do not specify file digest algorithms
2020-04-20 09:58:16 +02:00
Jakub Kadlcik
d73495afa8 Use os.makedirs instead of running mkdir -p command
Fix #338

We want to use as few bash commands instead of python functions as
possible anyway, but this rewrite fixes #338
2020-04-19 00:29:09 +02:00
Jakub Kadlcik
40287ca668 Do not specify file digest algorithms
Fix #331

Do not specify `_source_filedigest_algorithm`
and `_binary_filedigest_algorithm` anymore

EPEL5 did understand only MD5 checksums but since it is EOLed and
newer releases know SHA, we can probably safely remove it.
2020-04-18 21:05:59 +02:00
Jakub Kadlcik
0407099f24 Implement --version parameter
Fix #187
2020-04-18 20:52:40 +02:00
Jakub Kadlcik
2c61072cdc Use template to generate file with __version__
Fix #252
2020-04-18 20:51:26 +02:00
Jakub Kadlčík
df8df65bde
Merge pull request #365 from rpm-software-management/irc
mention the #tito irc channel in the readme
2020-04-18 16:48:35 +02:00
Jakub Kadlcik
f7f5fb2c8c mention the #tito irc channel in the readme 2020-04-14 00:14:31 +02:00
Jakub Kadlčík
f71033d7ce
Merge pull request #361 from FrostyX/maintenance-documentation
Describe how to release tito
2020-04-07 19:59:37 +02:00