From 894a226f24150cc35f933b72bf14c9587e15b73e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 21 Jun 2009 14:48:44 +0200 Subject: apt/package.py: Remove duplicated code in Version.fetch_source() --- apt/package.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apt/package.py b/apt/package.py index 0a80215e..cb99fe6a 100644 --- a/apt/package.py +++ b/apt/package.py @@ -492,14 +492,9 @@ class Version(object): destfile = os.path.join(destdir, base) if type == 'dsc': dsc = destfile - if os.path.exists(base) and os.path.getsize(base) == size: - fobj = open(base) - try: - if apt_pkg.md5sum(fobj) == md5: - print 'Ignoring already existing file:', destfile - continue - finally: - fobj.close() + if _file_is_same(destfile, size, md5): + print 'Ignoring already existing file:', destfile + continue apt_pkg.AcquireFile(acq, src.index.archive_uri(path), md5, size, base, destfile=destfile) acq.run() -- cgit v1.2.3