From db02e58fddff16eb02c60c0c66a782516068d654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Tue, 30 May 2006 08:04:54 +0000 Subject: [PATCH] * don't fail if two files are the same --- pisi/file.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pisi/file.py b/pisi/file.py index fd7cd292..1f3470e1 100644 --- a/pisi/file.py +++ b/pisi/file.py @@ -106,8 +106,10 @@ class File: ctx.ui.info(_("Fetching %s") % uri.get_uri()) fetch_url(uri, transfer_dir) else: - ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri()) - shutil.copy(uri.get_uri(), transfer_dir) + # copy to transfer dir, it's okay if transfer_dir is the same + if not os.path.samefile(uri.get_uri(), join(transfer_dir, uri.filename())): + ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri()) + shutil.copy(uri.get_uri(), transfer_dir) else: localfile = uri.get_uri() #TODO: use a special function here? if not os.path.exists(localfile):