r315 - /debtorrent/trunk/test.py

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Mon Nov 5 03:21:35 UTC 2007


Author: camrdale-guest
Date: Mon Nov  5 03:21:34 2007
New Revision: 315

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=315
Log:
Update the test suite to work with whichever apt method it can find.

Modified:
    debtorrent/trunk/test.py

Modified: debtorrent/trunk/test.py
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/test.py?rev=315&op=diff
==============================================================================
--- debtorrent/trunk/test.py (original)
+++ debtorrent/trunk/test.py Mon Nov  5 03:21:34 2007
@@ -41,6 +41,7 @@
 from DebTorrent.__init__ import resetPeerIDs
 import sys, os, signal
 from traceback import print_exc
+from os.path import exists
 
 DebTorrentClient = __import__('debtorrent-client', globals(), locals(), [])
 
@@ -546,7 +547,12 @@
 
         # Create apt's config files
         f = open(join([downloader_dir, 'etc', 'apt', 'sources.list']), 'w')
-        f.write('deb debtorrent://localhost:' + str(num_down) + '988/' + mirror + '/ stable ' + suites + '\n')
+        if exists('/usr/lib/apt/methods/newdebtorrent'):
+            f.write('deb newdebtorrent://localhost:' + str(num_down) + '988/' + mirror + '/ stable ' + suites + '\n')
+        elif exists('/usr/lib/apt/methods/debtorrent'):
+            f.write('deb debtorrent://localhost:' + str(num_down) + '988/' + mirror + '/ stable ' + suites + '\n')
+        else:
+            f.write('deb http://localhost:' + str(num_down) + '988/' + mirror + '/ stable ' + suites + '\n')
         f.close()
 
         f = open(join([downloader_dir, 'etc', 'apt', 'apt.conf']), 'w')




More information about the Debtorrent-commits mailing list