r234 - in /debtorrent/branches/unique: DebTorrent/BT1/makemetafile.py test.py uniquely.py

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Tue Aug 14 00:51:20 UTC 2007


Author: camrdale-guest
Date: Tue Aug 14 00:51:19 2007
New Revision: 234

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=234
Log:
Keep old unique piece orderings so out-of-date mirrors will work.

Modified:
    debtorrent/branches/unique/DebTorrent/BT1/makemetafile.py
    debtorrent/branches/unique/test.py
    debtorrent/branches/unique/uniquely.py

Modified: debtorrent/branches/unique/DebTorrent/BT1/makemetafile.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/unique/DebTorrent/BT1/makemetafile.py?rev=234&op=diff
==============================================================================
--- debtorrent/branches/unique/DebTorrent/BT1/makemetafile.py (original)
+++ debtorrent/branches/unique/DebTorrent/BT1/makemetafile.py Tue Aug 14 00:51:19 2007
@@ -513,6 +513,10 @@
         ordered_pieces.sort()
         cur_piece = 0
         for next_piece in ordered_pieces:
+            if piece_ordering[next_piece] not in pieces:
+                # Skip files we don't know about
+                continue
+
             if next_piece > cur_piece:
                 fs_list.append({'length': 0, 'path': []})
                 cur_piece = next_piece

Modified: debtorrent/branches/unique/test.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/unique/test.py?rev=234&op=diff
==============================================================================
--- debtorrent/branches/unique/test.py (original)
+++ debtorrent/branches/unique/test.py Tue Aug 14 00:51:19 2007
@@ -189,6 +189,13 @@
               (1, ['install', 'doc-iana']),
               ]),
 
+        '8': ('Test updating to a (possibly) out-of-date mirror.',
+             {1: []},
+             {1: (1, [], {'mirror': 'debian.mirror.iweb.ca/debian'})},
+             [(1, ['update']),
+              (1, ['install', 'aboot-base']),
+              ]),
+
         }
 
 assert 'all' not in tests

Modified: debtorrent/branches/unique/uniquely.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/branches/unique/uniquely.py?rev=234&op=diff
==============================================================================
--- debtorrent/branches/unique/uniquely.py (original)
+++ debtorrent/branches/unique/uniquely.py Tue Aug 14 00:51:19 2007
@@ -390,6 +390,10 @@
             sys.stdout.flush()
             pieces, new_pieces = get_new(filename, old_pieces, old_all_pieces, 
                                          all_pieces, all_new_pieces)
+
+            # Add the old removed pieces so out-of-date mirrors will work too
+            for file in old_pieces:
+                pieces[old_pieces[file]] = file
     
             if pieces or new_pieces:
                 # Add any new pieces to the end of pieces
@@ -406,6 +410,10 @@
                 
             print "done."
     
+        # Add the old removed pieces so out-of-date mirrors will work too
+        for file in old_all_pieces:
+            all_pieces[old_all_pieces[file]] = file
+
         print all_file + ": reading ...",
         if new_all_torrent:
             print "new torrent created ...",




More information about the Debtorrent-commits mailing list