From a58e517aac78b66c6f587e1cc630587e5902dede Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 23 Sep 2011 00:40:09 -0400 Subject: [PATCH 1/2] Fix error that prevents downloader from creating directories. --- share/gitian-updater | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/gitian-updater b/share/gitian-updater index f708493..efab905 100755 --- a/share/gitian-updater +++ b/share/gitian-updater @@ -353,7 +353,7 @@ if quiet == 0: for root, dirs, files in os.walk(unpack_dir, topdown = True): rel = path.relpath(root, unpack_dir) if not path.exists(path.join(dest_path, rel)): - os.mkdir(path.join(dest_path, rel)) + os.mkdir(path.normpath(path.join(dest_path, rel))) for f in files: shutil.copy2(path.join(root, f), path.join(dest_path, rel, f)) From eac16c55531d04e455bc53c488035596b09802f1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 23 Sep 2011 00:41:04 -0400 Subject: [PATCH 2/2] Only attempt to remove files when neccessary (in downloader). --- share/gitian-updater | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/gitian-updater b/share/gitian-updater index efab905..8894572 100755 --- a/share/gitian-updater +++ b/share/gitian-updater @@ -357,11 +357,11 @@ for root, dirs, files in os.walk(unpack_dir, topdown = True): for f in files: shutil.copy2(path.join(root, f), path.join(dest_path, rel, f)) -removed = set(old_manifest['sums'].keys()).difference(out_manifest['sums'].keys()) - -for f in removed: - if path.exists(path.join(dest_path, f)): - os.unlink(path.join(dest_path, f)) +if old_manifest: + removed = set(old_manifest['sums'].keys()).difference(out_manifest['sums'].keys()) + for f in removed: + if path.exists(path.join(dest_path, f)): + os.unlink(path.join(dest_path, f)) f = file(path.join(dest_path, '.gitian-manifest'), 'w') yaml.dump(out_manifest, f)