Some very suspicious changes to relpath() and sname() calls.

The problem is that redo-ifchange has a different $PWD than its
sub-dependencies, so as it's chasing them down, fixing up the relative paths
totally doesn't work at all.

There's probably a much smarter fix than this, but it's too late at night to
think of it right now.
This commit is contained in:
Avery Pennarun 2010-11-16 05:46:52 -08:00
commit 84046bcab2
3 changed files with 19 additions and 14 deletions

View file

@ -83,12 +83,17 @@ def relpath(t, base):
return '/'.join(tparts)
def sname(typ, t):
def sname(typ, t, fromdir=None):
# FIXME: t.replace(...) is non-reversible and non-unique here!
if fromdir:
t = os.path.join(fromdir, t)
tnew = relpath(t, vars.BASE)
#log('sname: (%r) %r -> %r\n' % (vars.BASE, t, tnew))
return vars.BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
v = vars.BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
debug2('sname: (%r) %r -> %r\n' % (os.getcwd(), t, tnew))
return v
def add_dep(t, mode, dep):
open(sname('dep', t), 'a').write('%s %s\n' % (mode, dep))
debug2('add-dep(%r)\n' % t)
open(sname('dep', t), 'a').write('%s %s\n'
% (mode, relpath(dep, vars.BASE)))