# HG changeset patch # User Jeff Hammel # Date 1316367970 25200 # Node ID a984091d681a53886230a53505daef352ca26858 # Parent 11e11e5c0c488803f6c8245b9d8a0138f6cb0e06 fix up destination diff -r 11e11e5c0c48 -r a984091d681a fetch/main.py --- a/fetch/main.py Sun Sep 18 10:41:18 2011 -0700 +++ b/fetch/main.py Sun Sep 18 10:46:10 2011 -0700 @@ -81,9 +81,19 @@ assert not [i for i in types if [True for fetcher in fetchers if fetcher.match(i)]] - # fetch the items for item in items: - self(item['url']) + + # fix up relative paths + dest = item['destination'] + if not os.path.isabs(dest): + if self.relative_to: + dest = os.path.join(self.relative_to, dest) + else: + dest = os.path.join(os.path.dirname(os.path.abspath(item['manifest'])), dest) + + # fetch the items + self(item['url'], destination=dest, type=item['type'], **item['options']) + format_string = "[URL] [destination] [type] " def read_manifests(*manifests):