- tf.add(OS.path.join(dir, file), OS.path.join(root, base, file),
- recursive = False)
+ full = OS.path.join(dir, file)
+ tarname = OS.path.join(root, name, file)
+ skip = False
+ if OS.path.islink(full):
+ dest = OS.path.realpath(full)
+ for d, local in dirmap:
+ if dest.startswith(d):
+ fix = OS.path.relpath(OS.path.join('/', local, dest[len(d):]),
+ OS.path.join('/', name,
+ OS.path.dirname(file)))
+ st = OS.stat(full)
+ ti = tf.gettarinfo(full, tarname)
+ ti.linkname = fix
+ tf.addfile(ti)
+ skip = True
+ if not skip:
+ tf.add(full, tarname, recursive = False)