sys.stderr.write does not add automatically \n as print does.
Addressing:
Warning: remote.origin do not exist. Assuming --offline, for remote tag checking.Building package [osc-0.132.4-4]
And I checked all sys.stderr.write() occurence in code as well.
Addresses https://github.com/dgoodwin/tito/issues/88
Before this commit: tito fails to build single project when using
git version 1.7.1 (RHEL 6), and `./runtests.py` fails with...
ERROR: test_latest_rpm (functional.singleproject_tests.SingleProjectTests)
ERROR: test_latest_srpm (functional.singleproject_tests.SingleProjectTests)
ERROR: test_latest_tgz (functional.singleproject_tests.SingleProjectTests)
ERROR: test_tag_rpm (functional.singleproject_tests.SingleProjectTests)
ERROR: test_tag_srpm (functional.singleproject_tests.SingleProjectTests)
ERROR: test_tag_tgz (functional.singleproject_tests.SingleProjectTests)
After this commit: tito can build single and multi projects when using
git version 1.7.1 (RHEL 6), and all tests pass.
More info: Git changed the way it interprets tree IDs
between v1.7.3.5 and v1.7.4-rc0.
On git version 1.7.3.5:
$ id="d1fafbe48d24cbb90919b4e886f71c1dc4576c64:./"
$ git archive --format=tar --prefix=tito-0.4.13/ $id | wc -l
fatal: Not a valid object name
0
On git version 1.7.4.rc0:
$ id="d1fafbe48d24cbb90919b4e886f71c1dc4576c64:./"
$ git archive --format=tar --prefix=tito-0.4.13/ $id | wc -l
7837
The `debug` method now takes an optional 2nd argument, which
is a command to run via `run_command` method.
The `run_command` method now takes an optional 2nd argument, which
is used to always print output of command.
If --debug is passed on the CLI, run `git archive` separately
to make problems visible.
Due to error in GemBuilder.tgz method generating the list of sources
there was problem with adding the sources into lookaside (the list of
sources contained all the files in the directory, even directories).
Thanks to 9feb9cf48d the tgz method in
NoTgzBuilder is generic enough to be able to extract the source files
even for GemBuilder.
addressing:
$ tito release git-sat
Will release to the following targets: git-sat
Checking for tag [katello-1.4.2-4-sat] in git repo [ssh://git.corp.redhat.com/srv/git/engineering/katello]
Releasing to target: git-sat
Working in: /tmp/tito/release-katello-6a0e027d9e284d65e3407e7060e98ccf9d48b2fdiD7jdk
Building upstream tgz for tag [katello-1.4.2-1]
Checking for tag [katello-1.4.2-1] in git repo [ssh://git.corp.redhat.com/srv/git/engineering/katello]
Creating katello-1.4.2.tar.gz from git tag: 507e03d5743fd2f7609d5bca80ed1e1b7d302fc4...
Traceback (most recent call last):
File "/usr/bin/tito", line 23, in <module>
CLI().main(sys.argv[1:])
File "/usr/lib/python2.6/site-packages/tito/cli.py", line 94, in main
return module.main(argv)
File "/usr/lib/python2.6/site-packages/tito/cli.py", line 638, in main
scratch=self.options.scratch)
File "/usr/lib/python2.6/site-packages/tito/release.py", line 490, in release
self._git_release()
File "/usr/lib/python2.6/site-packages/tito/release.py", line 507, in _git_release
self.builder.tgz()
File "/usr/lib/python2.6/site-packages/tito/builder.py", line 784, in tgz
self.patch_upstream()
File "/usr/lib/python2.6/site-packages/tito/distributionbuilder.py", line 37, in patch_upstream
error_out("You are doomed. Diff contains binary files. You can not use this builder")
NameError: global name 'error_out' is not defined
addressing:
Traceback (most recent call last):
File "/usr/bin/tito", line 23, in <module>
CLI().main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/tito/cli.py", line 94, in main
return module.main(argv)
File "/usr/lib/python2.7/site-packages/tito/cli.py", line 638, in main
scratch=self.options.scratch)
File "/usr/lib/python2.7/site-packages/tito/release.py", line 490, in release
self._git_release()
File "/usr/lib/python2.7/site-packages/tito/release.py", line 507, in _git_release
self.builder.tgz()
File "/usr/lib/python2.7/site-packages/tito/builder.py", line 784, in tgz
self.patch_upstream()
File "/usr/lib/python2.7/site-packages/tito/distributionbuilder.py", line 34, in patch_upstream
(status, output) = commands.getstatusoutput(
NameError: global name 'commands' is not defined
addressing:
Traceback (most recent call last):
File "/usr/bin/tito", line 23, in <module>
CLI().main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/tito/cli.py", line 94, in main
return module.main(argv)
File "/usr/lib/python2.7/site-packages/tito/cli.py", line 635, in main
auto_accept=self.options.auto_accept)
File "/usr/lib/python2.7/site-packages/tito/release.py", line 473, in __init__
overwrite_checkout = self.config.get(self.target, "remote_git_name")
File "/usr/lib64/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'git-sat'
if package reside in subdirectory, then in metadata file is written
1.0 foo/
but if the package reside in git-root, then in metadata file is written
1.0 /
which is not relative path and if it is evaluated by some tool, it is evaluated incorrectly
This patch will change this singularity to:
1.0 ./
I done s/spacewalk.releng./tito./ in spacewalk.git, but it may reside in some (private) branches.
So let keep it for little bit more releases, but print warnings.