r105 - in /debtorrent/trunk/DebTorrent: BT1/makemetafile.py download_bt1.py
camrdale-guest at users.alioth.debian.org
camrdale-guest at users.alioth.debian.org
Wed Jun 13 22:23:50 UTC 2007
Author: camrdale-guest
Date: Wed Jun 13 22:23:50 2007
New Revision: 105
URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=105
Log:
Revert some more dpkg-status changes that snuck in.
Modified:
debtorrent/trunk/DebTorrent/BT1/makemetafile.py
debtorrent/trunk/DebTorrent/download_bt1.py
Modified: debtorrent/trunk/DebTorrent/BT1/makemetafile.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/BT1/makemetafile.py?rev=105&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/BT1/makemetafile.py (original)
+++ debtorrent/trunk/DebTorrent/BT1/makemetafile.py Wed Jun 13 22:23:50 2007
@@ -222,17 +222,11 @@
return pieces
-def getpieces(f, encoding, progress = lambda x: None, sub_pieces = {},
- installed_versions = {}, status_to_download = 0):
+def getpieces(f, encoding, progress = lambda x: None, sub_pieces = {}):
pieces = []
lengths = []
fs = []
packages = 0
-
- if installed_versions:
- priority = {}
- else:
- priority = None
p = [None, None, None, None, None]
for line in f:
@@ -246,13 +240,6 @@
lengths.append(p[0])
pieces.append(p[2])
- if (p[3] and installed_versions.has_key(p[3])):
- if status_to_download == 2:
- priority[p[1]] = 1
- elif (status_to_download == 1 and p[4]):
- ret = system('dpkg --compare-versions "' + installed_versions[p[3]] + '" lt "' + p[4] + '"')
- if ret == 0:
- priority[p[1]] = 1
path = []
while p[1]:
p[1],d = split(p[1])
@@ -272,8 +259,7 @@
if line[:8] == "Version:":
p[4] = line[9:]
- return ({'pieces': ''.join(pieces), 'piece lengths': lengths, 'files': fs},
- priority)
+ return {'pieces': ''.join(pieces), 'piece lengths': lengths, 'files': fs}
def makeinfo(file, piece_length, encoding, progress, pieces_file = ''):
@@ -284,7 +270,7 @@
file = abspath(file)
f = open(file)
- (info, temp) = getpieces(f, encoding, progress, sub_pieces = sub_pieces)
+ info = getpieces(f, encoding, progress, sub_pieces = sub_pieces)
f.close()
return info
Modified: debtorrent/trunk/DebTorrent/download_bt1.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/DebTorrent/download_bt1.py?rev=105&op=diff
==============================================================================
--- debtorrent/trunk/DebTorrent/download_bt1.py (original)
+++ debtorrent/trunk/DebTorrent/download_bt1.py Wed Jun 13 22:23:50 2007
@@ -398,7 +398,7 @@
"""
- response = get_packages(file, url, errorfunc)
+ response = get_packages(file, url)
if response:
try:
check_message(response)
@@ -453,7 +453,7 @@
return response
-def get_packages(file, url, errorfunc):
+def get_packages(file, url):
"""Extract the response data from a Packages file.
@type file: C{string}
@@ -516,9 +516,8 @@
sub_pieces = getsubpieces(name)
- (info, priority) = getpieces(h, encoding, sub_pieces = sub_pieces,
- installed_versions = installed_versions,
- status_to_download = status_to_download)
+ info = getpieces(h, encoding, sub_pieces = sub_pieces)
+
response = {'info': info,
'announce': 'http://dttracker.debian.net:6969/announce',
'name': uniconvert(name, encoding)}
More information about the Debtorrent-commits
mailing list