Commit graph

1098 commits

Author SHA1 Message Date
Jakub Kadlcik
6c75185c87 Use spectool instead of manually parsing the specfile 2020-03-26 18:58:42 +01:00
Jakub Kadlcik
75715dc162 copy symlinks 2020-03-26 18:58:42 +01:00
Jakub Kadlcik
387757e0be Define _sourcedir for get_project_name RPM query
Follow-up for be89941
Fix: #311
Supersedes: #313

The `get_project_name` function is called in an early phase when
the temporary `SOURCES` directory for a current build doesn't exist yet.
Therefore as a little workaround, we set `_sourcedir` to an upstream
directory containing the package spec file.

Defining a custom `_sourcedir` (and therefore not using
`~/rpmbuild/SOURCES`) shouldn't be a problem because tito builds
should not depend on anything outside of the upstream git repository.

The use-case described in PR#313 works as expected.

    SOURCE1: somecool.macros
    %include %{SOURCE1}

For multi-spec projects, where you have e.g

    .
    ├── foo
    │   ├── foo.spec
    ├── bar
    │   ├── bar.spec

It is possible to include the common macros from a parent (or some
other) directory by having a symlink.

    cd foo
    ln -s ../somecool.macros ./

Or possibly some other way which I am currently not aware of
because I wasn't able to e.g. persuade `%include` to include from
the parent directory.
2020-03-26 18:58:42 +01:00
Daniel Hilst Selli
d9cbc94840 Add _copy_extra_sources() method to BuilderBase class.
This method will include extra SOURCE1, SOURCE2, ... SOURCE<N>
files to the source rpm. This fix "No such file or directory" for
included source files.
2020-03-26 18:58:42 +01:00
Jakub Kadlčík
1e70e59cff
Merge pull request #356 from FrostyX/fix-travis-2
Fix travis CI tests for Fedora Rawhide
2020-03-26 18:34:21 +01:00
Jakub Kadlcik
a8e03d8361 Do not run external ls -lR command to debug directory content
When running tests for fedora rawhide in Travis, this debug line
fails with following error:

    Command output: ls: cannot access
    '/tmp/tmpjw15wzfs-titotest/rpmbuild-titotestpkg24v2hy67/SOURCES/titotestpkg-0.0.1/':
    Operation not permitted

Even when changing the debug line to just

    debug('', 'ls -l /')

it still fails. Let's just use `os.listdir`
2020-03-26 03:33:58 +01:00
Jakub Kadlčík
64e571540b
Merge pull request #272 from tjanez/modernize-python-package
Modernize Python package
2020-03-24 13:41:14 +01:00
Tadej Janež
df07df3eda
Rename HACKING to HACKING.md so it renders on GitHub 2020-03-24 09:25:46 +01:00
Tadej Janež
6f5a455aac
Modernize developer installation
Support the popular pip editable installation mode.

To work-around a problem in setuptools' develop target, generalize
'install_dir' to say all packages are in 'src' (for more info, see:
https://github.com/pypa/pip/issues/126).

Remove pre-generated bin/tito-dev script.
2020-03-24 09:25:44 +01:00
Tadej Janež
46bc5ab1a1
Update source installation instructions
Instruct users how to install dependencies and then install tito via
so-called User install.
2020-03-24 09:25:43 +01:00
Tadej Janež
9820841af5
Automatically create tito's console script
Create tito.cli.main() which serves as command line's entry point that
can be used:
- by setuptools' 'console_scripts' entry point mechanism for automatic
  script creation,
- via 'if __name__ == "__main__":'.

Remove pre-generated bin/tito script.

Update SPEC file.
2020-03-24 09:25:41 +01:00
Jakub Kadlčík
805ce9ca4a
Merge pull request #340 from adamladd17/patch-1
Update common.py
2020-03-09 18:11:47 +01:00
Jakub Kadlčík
3bb01ebb56
Merge pull request #333 from evgeni/get_project_name
make get_project_name more resilient
2020-03-09 10:40:17 +01:00
Jakub Kadlčík
d2cc16064c
Merge pull request #351 from FrostyX/fix-source0-url-and-prep
Fix the Source0 URL and prep phase
2020-02-01 17:16:50 +01:00
Jakub Kadlčík
be4ebadf5e
Merge pull request #353 from FrostyX/fix-travis
Fix travis
2020-02-01 17:00:55 +01:00
Jakub Kadlcik
1929f7f5a0 Temporarily skip some createrepo_c tests because it coredumps
This is probably not our fault, createrepo_c coredumps on Fedora
rawhide, please see the upstream issue
https://github.com/rpm-software-management/createrepo_c/issues/202

Once it gets resolved, revert this commit.
2020-01-31 21:23:17 +01:00
Evgeni Golov
fef2cfd161 add tests for get_package_name 2020-01-31 14:08:10 +01:00
Evgeni Golov
fe5d4fddb9 split tag instead of parsing it using a regex
nothing says that the version number must start with a number as seen in
the gpg-pubkey packages in Fedora:

    gpg-pubkey-facb00b1-570a8081
    gpg-pubkey-c3898297-5d25cdbd
    gpg-pubkey-d38b4796-570c8cd3
    gpg-pubkey-cfc659b9-5b6eac67
2020-01-31 14:06:18 +01:00
Evgeni Golov
ee7536aa5f make get_project_name more resilient
before this, packages with a name like "foo-1-setup" would be end up
parsed as "foo" and confused the heck out of the whitelisting code.

the new regex is less greedy about numbers by expecting the tag to end
in something that looks like a version (any number of numbers, dots and
hyphens) followed by an optional "dash anything" for the release.
2020-01-31 14:05:23 +01:00
Jakub Kadlcik
a219896ba5 Remove circular macro definition
[root@8d279f4efad9 /]# rpm -q --specfile tito.spec
    error: Recursion depth(17) greater than max(16)

This problem seems to appear only on EL6, but either way
the macro definition makes no sense (at least to me).
2020-01-31 00:03:27 +01:00
Jakub Kadlcik
8afe478b97 Temporarily disable checks for E7 and W6 2020-01-30 23:31:36 +01:00
Jakub Kadlcik
b7d64be5d0 Fix E305 PEP8 error
> expected 2 blank lines after end of function or class
2020-01-30 23:31:36 +01:00
Jakub Kadlcik
30f59ec027 Use pycodestyle pacakge when pep8 is not available 2020-01-30 23:31:34 +01:00
Jakub Kadlcik
176d546872 There is no python2 in Fedora rawhide anymore 2020-01-30 23:30:42 +01:00
Jakub Kadlčík
e6c2fd2e71
Merge pull request #352 from ernestask/wip/ernestask/blessedings
Move to python-blessed
2020-01-30 12:35:44 +01:00
Jakub Kadlčík
7ccf441125
Merge pull request #315 from vfreex/fix-build-output
Bugfix: run_command_print should behave similar to run_command
2020-01-30 12:34:26 +01:00
Ernestas Kulik
3a79fdde9f Move to python-blessed
As python-blessings is unmaintained nowadays and is not packaged for
EPEL 8, it might be good to move to an active fork.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1777377
2020-01-13 09:04:38 +01:00
Jakub Kadlcik
e2bbb4da66 Fix the Source0 URL and prep phase
Fixing this build error

    line 40: cd: tito-tito-0.6.12: No such file or directory

We don't need the weird directory naming because it is possible to
pass an optional part of the URL specifying the targeted filename.

See https://fedoraproject.org/wiki/Packaging:SourceURL#Git_Tags

However, we still can't define `Source0` as an URL because then the
checksum differs from what `tito build --tgz` produces
2020-01-06 14:01:33 +01:00
Jakub Kadlcik
fbef7d7f02 Automatic commit of package [tito] release [0.6.12-1].
Created by command:

/usr/bin/tito tag
2019-12-20 17:19:06 +01:00
Jakub Kadlčík
780a7dda65
Merge pull request #350 from FrostyX/update-releaser-branches
Update fedora releaser branches
2019-12-20 17:03:27 +01:00
Jakub Kadlcik
c8c44686b9 Update fedora releaser branches 2019-12-20 16:32:27 +01:00
Jakub Kadlčík
91ed57efcd
Merge pull request #349 from FrostyX/merge-downstream-patches
Merge downstream patches
2019-12-20 16:27:42 +01:00
Igor Gnatenko
3ab90dac58 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-12-06 23:28:34 +01:00
Adam Williamson
655bf0b87e Update URL and Source locations
The old site no longer appears to exist, nor do the tarballs.
Use github instead.
2019-12-06 23:28:12 +01:00
Adam Williamson
6d8e0adb8e Fix cheetah binary dependency (it's not always in python-cheetah) 2019-12-06 23:26:29 +01:00
Adam Williamson
a116d503ad Correct and make less confusing the conditional Python macros
This was using 'python_sitelib' in a non-standard way (it got
defined to either python2_sitelib or python3_sitelib depending
on whether we're doing a python2 or python3 build). Igor saw
the uses of 'python_sitelib' and assumed it was just using the
old name for 'the python 2 sitelib' and changed them all to
'python2_sitelib'...which broke all Fedora builds.

This fixes that problem and renames the package's confusing
'python_sitelib' and 'pythonbin' so hopefully no-one will make
the same mistake in future.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2019-12-06 23:24:00 +01:00
Brian C. Lane
e6f4811e07 Drop unused fedora-cert Require line from tito.spec 2019-12-06 23:23:42 +01:00
Igor Gnatenko
71a861c2a8 python-devel → python2-devel
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-06 23:22:14 +01:00
Igor Gnatenko
cf56cf36ce %{python_sitelib} → %{python2_sitelib}
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-06 23:22:02 +01:00
Igor Gnatenko
632d0a4f5a Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-06 23:20:55 +01:00
Devan Goodwin
7f3016953e
Merge pull request #348 from FrostyX/python3-on-epel
Use python3 on EPEL8
2019-12-02 08:01:12 -04:00
Jakub Kadlcik
3dbde91000 Use python3 on EPEL8 2019-12-02 00:25:43 +01:00
Devan Goodwin
e75b8d378f
Merge pull request #344 from xsuchy/spec
two bugfixes to spec file
2019-10-03 08:09:04 -03:00
Devan Goodwin
fd6945d84b
Merge pull request #345 from xsuchy/tarutf8
Partial revert "Fix #335. Handle source tarballs with UTF8 characters…
2019-10-03 08:07:42 -03:00
Miroslav Suchý
9c3f00f2cf Partial revert "Fix #335. Handle source tarballs with UTF8 characters in the name."
This partialy reverts commit 03509b36d5.
It removes just test and keep the functionality.

The test cannot be there right now because tito 0.6.11 and older will choke on this and will produce demaged tarball.

This revert can be added back later when all devel has tito in version 0.6.12 or higher.

Resolves: #337
2019-10-03 09:35:24 +02:00
Miroslav Suchý
72e51fe833 disable macro in comment
macros are evaluated even in comments
2019-10-03 08:38:12 +02:00
Miroslav Suchý
f1bcf5c261 do not require obsoleted fedora-cert
fedora-cert does not exists on Fedora 31+
It has been obsoleted by fedora-packager, but not provided
  https://src.fedoraproject.org/rpms/fedora-packager/blob/master/f/fedora-packager.spec#_23
This make tito uninstallable on Fedora 31+.
2019-10-03 08:36:03 +02:00
Devan Goodwin
8bd9c721de
Merge pull request #343 from schlupov/tito_build_traceback
tito build --test --rpm -i Traceback on Fedora 31
2019-10-02 11:35:39 -03:00
Silvie Chlupova
e0cc5fe989 tito build --test --rpm -i Traceback on Fedora 31
Fixes: #341
2019-10-02 12:36:32 +02:00
adamladd17
8b02dbed00
Update common.py
Add in a check to confirm we get the original root commit has in case there are multiple. This can occur when two separate repositories are merged in to one new one. Without this addition the count will always return 0.
2019-09-04 12:56:54 -04:00