diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-06-21 14:48:44 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-06-21 14:48:44 +0200 |
| commit | 894a226f24150cc35f933b72bf14c9587e15b73e (patch) | |
| tree | eb884e2519eb65bcbbe9b064b99a7cec30545874 | |
| parent | 6338b8abafaef4dcdcf852cab049124cc4ecce06 (diff) | |
| download | python-apt-894a226f24150cc35f933b72bf14c9587e15b73e.tar.gz | |
apt/package.py: Remove duplicated code in Version.fetch_source()
| -rw-r--r-- | apt/package.py | 11 |
1 files 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() |
