From 915af668889c4193f28dc056dcaf35330314d038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Thu, 22 Sep 2005 17:05:21 +0000 Subject: [PATCH] =?UTF-8?q?[WorkAround]=20pisi=20paketlerini=20zaten=20var?= =?UTF-8?q?sa=20=C3=A7ekme.=20=C4=B0lerde=20pisi-index.xml=20i=C3=A7inde?= =?UTF-8?q?=20paketlerin=20sha1sum'lar=C4=B1=20gelince=20buraya=20onunla?= =?UTF-8?q?=20kar=C5=9F=C4=B1la=C5=9Ft=C4=B1rma=20da=20eklenmeli...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/package.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pisi/package.py b/pisi/package.py index d08b53d6..545c9093 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -15,7 +15,7 @@ # maintainer: baris and meren -from os.path import join +from os.path import join, exists import pisi import pisi.context as ctx @@ -38,9 +38,15 @@ class Package: if url.is_remote_file(): from fetcher import fetch_url dest = ctx.config.packages_dir() - fetch_url(url, dest, ctx.ui.Progress) self.filepath = join(dest, url.filename()) - + + # FIXME: exists is not enough, also sha1sum check needed \ + # when implemented in pisi-index.xml + if not exists(self.filepath): + fetch_url(url, dest, ctx.ui.Progress) + else: + ctx.ui.info('%s [cached]' % url.filename()) + self.impl = archive.ArchiveZip(self.filepath, 'zip', mode) def add_to_package(self, fn):