When trying to use git I stumbled upon following problem:

22:02:36 [D] Executing  git clone -n
git://github.com/jamis/sqlite3-ruby.git
/home/marcin/p/pkgtools/work.sqlite3rb/.gittmp
('/home/marcin/p/pkgtools/work.sqlite3rb')
22:02:37 [C] Checkout of proj-sqlite3rb failed!
22:02:37 [C] Something unexpected!
Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/vcpx/tailor.py", line
144, in __call__
    self.bootstrap()
  File "/usr/local/lib/python2.5/site-packages/vcpx/tailor.py", line
74, in bootstrap
    actual = dwd.checkoutUpstreamRevision(revision)
  File "/usr/local/lib/python2.5/site-packages/vcpx/source.py", line
244, in checkoutUpstreamRevision
    last = self._checkoutUpstreamRevision(revision)
  File "/usr/local/lib/python2.5/site-packages/vcpx/repository/git/source.py",
line 38, in _checkoutUpstreamRevision
    ChangesetApplicationFailure, False)
  File "/usr/local/lib/python2.5/site-packages/vcpx/repository/git/__init__.py",
line 75, in runCommand
    c.execute()
  File "/usr/local/lib/python2.5/site-packages/vcpx/repository/git/__init__.py",
line 156, in execute
    return ExternalCommand.execute(self, *args, **kwargs)
  File "/usr/local/lib/python2.5/site-packages/vcpx/shwrap.py", line
159, in execute
    return self._execute(allargs, **kwargs)
  File "/usr/local/lib/python2.5/site-packages/vcpx/shwrap.py", line
257, in _execute
    raise OSError("%r does not exist!" % self._last_command[0])
OSError: 'git' does not exist!

The reason for this is that shwrpa.py calls Popen with new env that
overwrites existing environment including PATH.
It should merge existing environment or at least pass PATH.
I am no python expert and likely there is some better way than what is
below, but at least it fixes the problem for me:

====== patch ======
--- shwrap.py   2008-07-15 21:13:36.000000000 +0200
+++ vcpx/shwrap.py       2008-07-15 22:13:36.000000000 +0200
@@ -245,11 +245,15 @@
             if error is None:
                 error = open(devnull, 'w')
         try:
+            from os import environ
+           env = environ.copy()
+            env.update(kwargs.get('env'))
+
             process = Popen(self._last_command,
                             stdin=input and PIPE or None,
                             stdout=output,
                             stderr=error,
-                            env=kwargs.get('env'),
+                            env=env,
                             cwd=cwd,
                             universal_newlines=True)
         except OSError, e:
====== end of patch ======

Also there were some other problems with git. I had to use
LANG=en_US.UTF-8 instead of LANG=C otherwise it would fail at
converting message logs with national characters ("encoding = utf8"
does not help)
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to