author |
<albertogli@telpin.com.ar> 2005-03-02 23:47:56 UTC |
committer |
<albertogli@telpin.com.ar> 2005-03-02 23:47:56 UTC |
parent | 60d89a8a30454172fe71e2910529cbfa26b68772 |
abk | +13 | -0 |
diff --git a/abk b/abk index cb13f8d..f6437c5 100644 --- a/abk +++ b/abk @@ -276,6 +276,19 @@ def make_path(f): # def make_sync(src_path, srcidx_path, dst_path, dstidx_path): + "Sync two directories." + # reduce multiple '/' at the end to none (or only one if it's root) + while src_path[-1] == '/' and src_path != '/': + src_path = src_path[:-1] + + # move to the source's parent, and use the new source so we + # create only one level directories. + if src_path != '/': + parent, src = os.path.split(src_path) + if parent: + os.chdir(parent) + src_path = src + # load destination index print "* loading destination index" dstidx = index_file(dstidx_path)