From f47aeeba7f705a40bbfe947f5eb374018f57ab37 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Wed, 5 Mar 2008 16:10:07 -0800 Subject: [PATCH] Rename project to apt-p2p. --- .gbp.conf | 2 +- COPYRIGHT | 6 ++-- README | 12 +++---- apt-dht.conf | 10 +++--- apt-dht.py | 26 +++++++-------- apt_dht/AptPackages.py | 4 +-- apt_dht/CacheManager.py | 6 ++-- apt_dht/HTTPDownloader.py | 4 +-- apt_dht/HTTPServer.py | 8 ++--- apt_dht/Hash.py | 18 +++++----- apt_dht/MirrorManager.py | 2 +- apt_dht/__init__.py | 10 +++--- apt_dht/apt_dht.py | 8 ++--- apt_dht/apt_dht_conf.py | 14 ++++---- apt_dht/db.py | 10 +++--- apt_dht/interfaces.py | 2 +- apt_dht/util.py | 2 +- apt_dht_Khashmir/DHT.py | 16 ++++----- apt_dht_Khashmir/__init__.py | 6 ++-- apt_dht_Khashmir/util.py | 2 +- debian/apt-dht.conf.sgml | 16 ++++----- debian/apt-dht.sgml | 16 ++++----- debian/changelog | 4 +-- debian/control | 20 ++++++------ debian/copyright | 10 +++--- debian/default | 6 ++-- debian/dirs | 6 ++-- debian/init.d | 26 +++++++-------- debian/install | 2 +- debian/manpages | 4 +-- debian/postinst | 16 ++++----- debian/postrm | 12 +++---- debian/prerm | 2 +- debian/rules | 16 ++++----- docs/epydoc.config | 6 ++-- docs/motivation/apt-dht-motivation.kilepr | 4 +-- docs/motivation/motivation.tex | 4 +-- setup.py | 8 ++--- test.py | 40 +++++++++++------------ 39 files changed, 193 insertions(+), 193 deletions(-) diff --git a/.gbp.conf b/.gbp.conf index 35aa406..1e745f7 100644 --- a/.gbp.conf +++ b/.gbp.conf @@ -1,7 +1,7 @@ # Configuration file for git-buildpackage and friends [DEFAULT] -debian-branch = apt-dht +debian-branch = apt-p2p debian-tag = %(version)s [git-buildpackage] diff --git a/COPYRIGHT b/COPYRIGHT index 93bc824..790dbe8 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,14 +1,14 @@ Unless otherwise noted, all files are released under the GNU General Public License, exceptions are noted below. -Apt-dht is Copyright (C) 2008 Cameron Dale +Apt-p2p is Copyright (C) 2008 Cameron Dale -Apt-dht is licensed under the terms of the GNU General Public License (GPL), +Apt-p2p is licensed under the terms of the GNU General Public License (GPL), version 2 or later, as published by the Free Software Foundation. See /usr/share/common-licenses/GPL, or for the terms of the latest version of the GNU General Public License. -The module apt_dht_Khashmir is a modified version of the original khashmir, +The module apt_p2p_Khashmir is a modified version of the original khashmir, the source of which can be found at http://sourceforge.net/projects/khashmir. It is covered by the following copyright and permission notice: diff --git a/README b/README index a6b1d5f..4c08494 100644 --- a/README +++ b/README @@ -1,11 +1,11 @@ -Apt-DHT: a peer-to-peer proxy for apt downloads +Apt-P2P: a peer-to-peer proxy for apt downloads ### Goal -Similar to DebTorrent[1], Apt-DHT will act as a proxy between apt +Similar to DebTorrent[1], Apt-P2P will act as a proxy between apt requests and a debian repository server, downloading any requested files from peers (if possible), but falling back to a direct HTTP -download. Unlike DebTorrent, Apt-DHT will be simple, efficient, and +download. Unlike DebTorrent, Apt-P2P will be simple, efficient, and fast. [1]: http://debtorrent.alioth.debian.org/ @@ -60,12 +60,12 @@ future. ### Installing There are detailed instructions on the web site[6] showing how to -install the Apt-DHT program. If you have any trouble using the +install the Apt-P2P program. If you have any trouble using the program, you can email me[7], or come and find me in the DebTorrent IRC channel (#debtorrent on OFTC[8]). If you think you've found a bug in the program, please let me know. -[6]: http://www.camrdale.org/apt-dht.html +[6]: http://www.camrdale.org/apt-p2p.html [7]: mailto:camrdale@gmail.com [8]: http://irc.oftc.net @@ -80,7 +80,7 @@ libraries. Dealing with apt's repository files is handled by python-apt, the code for which is based on that of the apt-proxy[12] program. -[9]: http://git.camrdale.org/?p=apt-dht.git;a=summary +[9]: http://git.camrdale.org/?p=apt-p2p.git;a=summary [10]: http://khashmir.sourceforge.net/ [11]: http://en.wikipedia.org/wiki/Kademlia [12]: http://apt-proxy.sourceforge.net/ diff --git a/apt-dht.conf b/apt-dht.conf index e9a481b..9a12eed 100644 --- a/apt-dht.conf +++ b/apt-dht.conf @@ -1,4 +1,4 @@ -# The apt-dht configuration file. +# The apt-p2p configuration file. # # This is an ini-type configuration file, using sections identified by # square brackets. Values are specified on a single line using the '=' @@ -19,7 +19,7 @@ PORT = 9977 # Directory to store the downloaded files in -CACHE_DIR = /var/cache/apt-dht +CACHE_DIR = /var/cache/apt-p2p # Other directories containing packages to share with others # WARNING: all files in these directories will be hashed and available @@ -42,14 +42,14 @@ KEY_REFRESH = 57m # It must be possile to do "from .DHT import DHT" to get a class that # implements the IDHT interface. There should also be a similarly named # section below to specify the options for the DHT. -DHT = apt_dht_Khashmir +DHT = apt_p2p_Khashmir # Whether to only run the DHT (for providing only a bootstrap node) DHT-ONLY = no -####################### apt_dht_Khashmir ############################ +####################### apt_p2p_Khashmir ############################ # This is the default (included) DHT to use. -[apt_dht_Khashmir] +[apt_p2p_Khashmir] # To specify a different (UDP) port for the DHT to use. # If not specified here, the PORT value in the DEFAULT section will be used. diff --git a/apt-dht.py b/apt-dht.py index 1d9933b..6873204 100644 --- a/apt-dht.py +++ b/apt-dht.py @@ -1,9 +1,9 @@ #!/usr/bin/env python -# Load apt-dht application +# Load apt-p2p application # -# There are two ways apt-dht can be started: -# 1. twistd -y apt-dht +# There are two ways apt-p2p can be started: +# 1. twistd -y apt-p2p # - twistd will load this file and execute the app # in 'application' variable # 2. from command line @@ -16,14 +16,14 @@ from twisted.internet import reactor from twisted.python import usage, log from twisted.web2 import channel -from apt_dht.apt_dht_conf import config, version, DEFAULT_CONFIG_FILES -from apt_dht.interfaces import IDHT +from apt_p2p.apt_p2p_conf import config, version, DEFAULT_CONFIG_FILES +from apt_p2p.interfaces import IDHT config_file = '' if __name__ == '__main__': # Parse command line parameters when started on command line - class AptDHTOptions(usage.Options): + class AptP2POptions(usage.Options): optFlags = [ ['help', 'h', 'Print this help message'], ] @@ -31,12 +31,12 @@ if __name__ == '__main__': ['config-file', 'c', '', "Configuration file"], ['log-file', 'l', '-', "File to log to, - for stdout"], ] - longdesc="apt-dht is a peer-to-peer downloader for apt users" + longdesc="apt-p2p is a peer-to-peer downloader for apt users" def opt_version(self): - print "apt-dht %s" % version.short() + print "apt-p2p %s" % version.short() sys.exit(0) - opts = AptDHTOptions() + opts = AptP2POptions() try: opts.parseOptions() except usage.UsageError, ue: @@ -60,9 +60,9 @@ else: uid,gid = None,None log.msg('Starting application') -application = service.Application("apt-dht", uid, gid) +application = service.Application("apt-p2p", uid, gid) #print service.IProcess(application).processName -#service.IProcess(application).processName = 'apt-dht' +#service.IProcess(application).processName = 'apt-p2p' log.msg('Starting DHT') DHT = __import__(config.get('DEFAULT', 'DHT')+'.DHT', globals(), locals(), ['DHT']) @@ -71,8 +71,8 @@ myDHT = DHT.DHT() if not config.getboolean('DEFAULT', 'DHT-only'): log.msg('Starting main application server') - from apt_dht.apt_dht import AptDHT - myapp = AptDHT(myDHT) + from apt_p2p.apt_p2p import AptP2P + myapp = AptP2P(myDHT) factory = myapp.getHTTPFactory() s = strports.service('tcp:'+config.get('DEFAULT', 'port'), factory) s.setServiceParent(application) diff --git a/apt_dht/AptPackages.py b/apt_dht/AptPackages.py index c784b8b..44c84b5 100644 --- a/apt_dht/AptPackages.py +++ b/apt_dht/AptPackages.py @@ -285,7 +285,7 @@ class AptPackages: file = self.packages[f] if f.split('/')[-1] == "Release": self.addRelease(f, file) - fake_uri='http://apt-dht'+f + fake_uri='http://apt-p2p'+f fake_dirname = '/'.join(fake_uri.split('/')[:-1]) if f.endswith('Sources'): deb_src_added = True @@ -434,7 +434,7 @@ class TestAptPackages(unittest.TestCase): def setUp(self): """Initializes the cache with files found in the traditional apt location.""" - self.client = AptPackages(FilePath('/tmp/.apt-dht'), 300) + self.client = AptPackages(FilePath('/tmp/.apt-p2p'), 300) # Find the largest index files that are for 'main' self.packagesFile = os.popen('ls -Sr /var/lib/apt/lists/ | grep -E "_main_.*Packages$" | tail -n 1').read().rstrip('\n') diff --git a/apt_dht/CacheManager.py b/apt_dht/CacheManager.py index a0f6b6b..ccf13c5 100644 --- a/apt_dht/CacheManager.py +++ b/apt_dht/CacheManager.py @@ -200,7 +200,7 @@ class CacheManager: @ivar all_dirs: all the directories that have cached files in them @type db: L{db.DB} @ivar db: the database to use for tracking files and hashes - @type manager: L{apt_dht.AptDHT} + @type manager: L{apt_p2p.AptP2P} @ivar manager: the main program object to send requests to @type scanning: C{list} of L{twisted.python.filepath.FilePath} @ivar scanning: all the directories that are currectly being scanned or waiting to be scanned @@ -216,7 +216,7 @@ class CacheManager: @type other_dirs: C{list} of L{twisted.python.filepath.FilePath} @param other_dirs: the other directories that have shared files in them (optional, defaults to only using the cache directory) - @type manager: L{apt_dht.AptDHT} + @type manager: L{apt_p2p.AptP2P} @param manager: the main program object to send requests to (optional, defaults to not calling back with cached files) """ @@ -430,7 +430,7 @@ class TestMirrorManager(unittest.TestCase): client = None def setUp(self): - self.client = CacheManager(FilePath('/tmp/.apt-dht')) + self.client = CacheManager(FilePath('/tmp/.apt-p2p')) def tearDown(self): for p in self.pending_calls: diff --git a/apt_dht/HTTPDownloader.py b/apt_dht/HTTPDownloader.py index 49bab65..eb36932 100644 --- a/apt_dht/HTTPDownloader.py +++ b/apt_dht/HTTPDownloader.py @@ -15,7 +15,7 @@ from twisted.web2 import version as web2_version from twisted.trial import unittest from zope.interface import implements -from apt_dht_conf import version +from apt_p2p_conf import version class Peer(ClientFactory): """A manager for all HTTP requests to a single peer. @@ -158,7 +158,7 @@ class Peer(ClientFactory): """Get the common HTTP headers for all requests.""" headers = http_headers.Headers() headers.setHeader('Host', self.host) - headers.setHeader('User-Agent', 'apt-dht/%s (twisted/%s twisted.web2/%s)' % + headers.setHeader('User-Agent', 'apt-p2p/%s (twisted/%s twisted.web2/%s)' % (version.short(), twisted_version.short(), web2_version.short())) return headers diff --git a/apt_dht/HTTPServer.py b/apt_dht/HTTPServer.py index 82a9bab..d252a63 100644 --- a/apt_dht/HTTPServer.py +++ b/apt_dht/HTTPServer.py @@ -10,7 +10,7 @@ from twisted.web2 import server, http, resource, channel, stream from twisted.web2 import static, http_headers, responsecode from policies import ThrottlingFactory -from apt_dht_Khashmir.bencode import bencode +from apt_p2p_Khashmir.bencode import bencode class FileDownloader(static.File): """Modified to make it suitable for apt requests. @@ -19,7 +19,7 @@ class FileDownloader(static.File): freshness before being sent. Requests for unfound and stale files are forwarded to the main program for downloading. - @type manager: L{apt_dht.AptDHT} + @type manager: L{apt_p2p.AptP2P} @ivar manager: the main program to query """ @@ -134,7 +134,7 @@ class TopLevel(resource.Resource): @ivar directory: the directory to check for cached files @type db: L{db.DB} @ivar db: the database to use for looking up files and hashes - @type manager: L{apt_dht.AptDHT} + @type manager: L{apt_p2p.AptP2P} @ivar manager: the main program object to send requests to @type factory: L{twisted.web2.channel.HTTPFactory} or L{policies.ThrottlingFactory} @ivar factory: the factory to use to server HTTP requests @@ -150,7 +150,7 @@ class TopLevel(resource.Resource): @param directory: the directory to check for cached files @type db: L{db.DB} @param db: the database to use for looking up files and hashes - @type manager: L{apt_dht.AptDHT} + @type manager: L{apt_p2p.AptP2P} @param manager: the main program object to send requests to """ self.directory = directory diff --git a/apt_dht/Hash.py b/apt_dht/Hash.py index fb13457..850f393 100644 --- a/apt_dht/Hash.py +++ b/apt_dht/Hash.py @@ -299,10 +299,10 @@ class TestHashObject(unittest.TestCase): found = True break self.failUnless(found == True) - h.set(hashType, 'c722df87e1acaa64b27aac4e174077afc3623540', '19') + h.set(hashType, '3bba0a5d97b7946ad2632002bf9caefe2cb18e00', '19') h.new() - h.update('apt-dht is the best') - self.failUnless(h.hexdigest() == 'c722df87e1acaa64b27aac4e174077afc3623540') + h.update('apt-p2p is the best') + self.failUnless(h.hexdigest() == '3bba0a5d97b7946ad2632002bf9caefe2cb18e00') self.failUnlessRaises(HashError, h.update, 'gfgf') self.failUnless(h.verify() == True) @@ -315,10 +315,10 @@ class TestHashObject(unittest.TestCase): found = True break self.failUnless(found == True) - h.set(hashType, '2a586bcd1befc5082c872dcd96a01403', '19') + h.set(hashType, '6b5abdd30d7ed80edd229f9071d8c23c', '19') h.new() - h.update('apt-dht is the best') - self.failUnless(h.hexdigest() == '2a586bcd1befc5082c872dcd96a01403') + h.update('apt-p2p is the best') + self.failUnless(h.hexdigest() == '6b5abdd30d7ed80edd229f9071d8c23c') self.failUnlessRaises(HashError, h.update, 'gfgf') self.failUnless(h.verify() == True) @@ -331,10 +331,10 @@ class TestHashObject(unittest.TestCase): found = True break self.failUnless(found == True) - h.set(hashType, '55b971f64d9772f733de03f23db39224f51a455cc5ad4c2db9d5740d2ab259a7', '19') + h.set(hashType, '47f2238a30a0340faa2bf01a9bdc42ba77b07b411cda1e24cd8d7b5c4b7d82a7', '19') h.new() - h.update('apt-dht is the best') - self.failUnless(h.hexdigest() == '55b971f64d9772f733de03f23db39224f51a455cc5ad4c2db9d5740d2ab259a7') + h.update('apt-p2p is the best') + self.failUnless(h.hexdigest() == '47f2238a30a0340faa2bf01a9bdc42ba77b07b411cda1e24cd8d7b5c4b7d82a7') self.failUnlessRaises(HashError, h.update, 'gfgf') self.failUnless(h.verify() == True) diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index bccb2e5..4c19f10 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -133,7 +133,7 @@ class TestMirrorManager(unittest.TestCase): client = None def setUp(self): - self.client = MirrorManager(FilePath('/tmp/.apt-dht'), 300) + self.client = MirrorManager(FilePath('/tmp/.apt-p2p'), 300) def test_extractPath(self): """Test extracting the site and base directory from various mirrors.""" diff --git a/apt_dht/__init__.py b/apt_dht/__init__.py index b945cec..356924f 100644 --- a/apt_dht/__init__.py +++ b/apt_dht/__init__.py @@ -1,17 +1,17 @@ -"""The main apt-dht modules. +"""The main apt-p2p modules. -To run apt-dht, you probably want to do something like:: +To run apt-p2p, you probably want to do something like:: - from apt_dht.apt_dht import AptDHT - myapp = AptDHT(myDHT) + from apt_p2p.apt_p2p import AptP2P + myapp = AptP2P(myDHT) where myDHT is a DHT that implements interfaces.IDHT. Diagram of the interaction between the given modules:: +---------------+ +-----------------------------------+ +------------- - | AptDHT | | DHT | | Internet + | AptP2P | | DHT | | Internet | |--->|join DHT|----|--\ | |--->|loadConfig | | | Another | |--->|getValue | | | Node diff --git a/apt_dht/apt_dht.py b/apt_dht/apt_dht.py index 014ac51..9e360a0 100644 --- a/apt_dht/apt_dht.py +++ b/apt_dht/apt_dht.py @@ -18,7 +18,7 @@ from twisted.web2 import server, http, http_headers, static from twisted.python import log, failure from twisted.python.filepath import FilePath -from apt_dht_conf import config +from apt_p2p_conf import config from PeerManager import PeerManager from HTTPServer import TopLevel from MirrorManager import MirrorManager @@ -32,7 +32,7 @@ TORRENT_PIECES = 70 download_dir = 'cache' -class AptDHT: +class AptP2P: """The main code object that does all of the work. Contains all of the sub-components that do all the low-level work, and @@ -65,11 +65,11 @@ class AptDHT: @type dht: L{interfaces.IDHT} @param dht: the DHT instance to use """ - log.msg('Initializing the main apt_dht application') + log.msg('Initializing the main apt_p2p application') self.cache_dir = FilePath(config.get('DEFAULT', 'cache_dir')) if not self.cache_dir.child(download_dir).exists(): self.cache_dir.child(download_dir).makedirs() - self.db = DB(self.cache_dir.child('apt-dht.db')) + self.db = DB(self.cache_dir.child('apt-p2p.db')) self.dht = dht self.dht.loadConfig(config, config.get('DEFAULT', 'DHT')) self.dht.join().addCallbacks(self.joinComplete, self.joinError) diff --git a/apt_dht/apt_dht_conf.py b/apt_dht/apt_dht_conf.py index f5d75a5..aaf2013 100644 --- a/apt_dht/apt_dht_conf.py +++ b/apt_dht/apt_dht_conf.py @@ -22,7 +22,7 @@ class ConfigError(Exception): def __str__(self): return repr(self.message) -version = versions.Version('apt-dht', 0, 0, 0) +version = versions.Version('apt-p2p', 0, 0, 0) # Set the home parameter home = os.path.expandvars('${HOME}') @@ -31,8 +31,8 @@ if home == '${HOME}' or not os.path.isdir(home): if not os.path.isdir(home): home = os.path.abspath(os.path.dirname(sys.argv[0])) -DEFAULT_CONFIG_FILES=['/etc/apt-dht/apt-dht.conf', - home + '/.apt-dht/apt-dht.conf'] +DEFAULT_CONFIG_FILES=['/etc/apt-p2p/apt-p2p.conf', + home + '/.apt-p2p/apt-p2p.conf'] DEFAULTS = { @@ -40,7 +40,7 @@ DEFAULTS = { 'PORT': '9977', # Directory to store the downloaded files in - 'CACHE_DIR': home + '/.apt-dht/cache', + 'CACHE_DIR': home + '/.apt-p2p/cache', # Other directories containing packages to share with others # WARNING: all files in these directories will be hashed and available @@ -65,7 +65,7 @@ DEFAULTS = { # Which DHT implementation to use. # It must be possile to do "from .DHT import DHT" to get a class that # implements the IDHT interface. - 'DHT': 'apt_dht_Khashmir', + 'DHT': 'apt_p2p_Khashmir', # Whether to only run the DHT (for providing only a bootstrap node) 'DHT-ONLY': 'no', @@ -120,7 +120,7 @@ DHT_DEFAULTS = { 'SPEW': 'yes', } -class AptDHTConfigParser(SafeConfigParser): +class AptP2PConfigParser(SafeConfigParser): """Adds 'gettime' and 'getstringlist' to ConfigParser objects. @ivar time_multipliers: the 'gettime' suffixes and the multipliers needed @@ -159,7 +159,7 @@ class AptDHTConfigParser(SafeConfigParser): return option.upper() # Initialize the default config parameters -config = AptDHTConfigParser(DEFAULTS) +config = AptP2PConfigParser(DEFAULTS) config.add_section(config.get('DEFAULT', 'DHT')) for k in DHT_DEFAULTS: config.set(config.get('DEFAULT', 'DHT'), k, DHT_DEFAULTS[k]) diff --git a/apt_dht/db.py b/apt_dht/db.py index fd265f6..396f419 100644 --- a/apt_dht/db.py +++ b/apt_dht/db.py @@ -310,12 +310,12 @@ class TestDB(unittest.TestCase): timeout = 5 db = FilePath('/tmp/khashmir.db') hash = '\xca\xec\xb8\x0c\x00\xe7\x07\xf8~])\x8f\x9d\xe5_B\xff\x1a\xc4!' - directory = FilePath('/tmp/apt-dht/') - file = FilePath('/tmp/apt-dht/khashmir.test') + directory = FilePath('/tmp/apt-p2p/') + file = FilePath('/tmp/apt-p2p/khashmir.test') testfile = 'tmp/khashmir.test' - dirs = [FilePath('/tmp/apt-dht/top1'), - FilePath('/tmp/apt-dht/top2/sub1'), - FilePath('/tmp/apt-dht/top2/sub2/')] + dirs = [FilePath('/tmp/apt-p2p/top1'), + FilePath('/tmp/apt-p2p/top2/sub1'), + FilePath('/tmp/apt-p2p/top2/sub2/')] def setUp(self): if not self.file.parent().exists(): diff --git a/apt_dht/interfaces.py b/apt_dht/interfaces.py index 2c022c5..b38de39 100644 --- a/apt_dht/interfaces.py +++ b/apt_dht/interfaces.py @@ -1,5 +1,5 @@ -"""Some interfaces that are used by the apt-dht classes.""" +"""Some interfaces that are used by the apt-p2p classes.""" from zope.interface import Interface diff --git a/apt_dht/util.py b/apt_dht/util.py index 1f571e5..c334d1d 100644 --- a/apt_dht/util.py +++ b/apt_dht/util.py @@ -1,5 +1,5 @@ -"""Some utitlity functions for use in the apt-dht program. +"""Some utitlity functions for use in the apt-p2p program. @var isLocal: a compiled regular expression suitable for testing if an IP address is from a known local or private range diff --git a/apt_dht_Khashmir/DHT.py b/apt_dht_Khashmir/DHT.py index 81c2696..399babf 100644 --- a/apt_dht_Khashmir/DHT.py +++ b/apt_dht_Khashmir/DHT.py @@ -13,11 +13,11 @@ from twisted.python import log from twisted.trial import unittest from zope.interface import implements -from apt_dht.interfaces import IDHT +from apt_p2p.interfaces import IDHT from khashmir import Khashmir from bencode import bencode, bdecode -khashmir_dir = 'apt-dht-Khashmir' +khashmir_dir = 'apt-p2p-Khashmir' class DHTError(Exception): """Represents errors that occur in the DHT.""" @@ -51,7 +51,7 @@ class DHT: @type retrieved: C{dictionary} @ivar retrieved: keys are the keys for which getValue requests are active, values are list of the values returned so far - @type config_parser: L{apt_dht.apt_dht_conf.AptDHTConfigParser} + @type config_parser: L{apt_p2p.apt_p2p_conf.AptP2PConfigParser} @ivar config_parser: the configuration info for the main program @type section: C{string} @ivar section: the section of the configuration info that applies to the DHT @@ -76,7 +76,7 @@ class DHT: self.retrieved = {} def loadConfig(self, config, section): - """See L{apt_dht.interfaces.IDHT}.""" + """See L{apt_p2p.interfaces.IDHT}.""" self.config_parser = config self.section = section self.config = {} @@ -104,7 +104,7 @@ class DHT: self.config[k] = self.config_parser.get(section, k) def join(self): - """See L{apt_dht.interfaces.IDHT}.""" + """See L{apt_p2p.interfaces.IDHT}.""" if self.config is None: raise DHTError, "configuration not loaded" if self.joining: @@ -172,7 +172,7 @@ class DHT: return self.foundAddrs def leave(self): - """See L{apt_dht.interfaces.IDHT}.""" + """See L{apt_p2p.interfaces.IDHT}.""" if self.config is None: raise DHTError, "configuration not loaded" @@ -201,7 +201,7 @@ class DHT: return key def getValue(self, key): - """See L{apt_dht.interfaces.IDHT}.""" + """See L{apt_p2p.interfaces.IDHT}.""" if self.config is None: raise DHTError, "configuration not loaded" if not self.joined: @@ -232,7 +232,7 @@ class DHT: del self.retrieving[key] def storeValue(self, key, value): - """See L{apt_dht.interfaces.IDHT}.""" + """See L{apt_p2p.interfaces.IDHT}.""" if self.config is None: raise DHTError, "configuration not loaded" if not self.joined: diff --git a/apt_dht_Khashmir/__init__.py b/apt_dht_Khashmir/__init__.py index cd6f7e8..594e80a 100644 --- a/apt_dht_Khashmir/__init__.py +++ b/apt_dht_Khashmir/__init__.py @@ -1,5 +1,5 @@ -"""The apt-dht implementation of the Khashmir DHT. +"""The apt-p2p implementation of the Khashmir DHT. These modules implement a modified Khashmir, which is a kademlia-like Distributed Hash Table available at:: @@ -8,11 +8,11 @@ Distributed Hash Table available at:: The protocol for the implementation's communication is described here:: - http://www.camrdale.org/apt-dht/protocol.html + http://www.camrdale.org/apt-p2p/protocol.html To run the DHT you probably want to do something like:: - from apt_dht_Khashmir import DHT + from apt_p2p_Khashmir import DHT myDHT = DHT.DHT() myDHT.loadConfig(config, section) myDHT.join() diff --git a/apt_dht_Khashmir/util.py b/apt_dht_Khashmir/util.py index 2b10919..52b6e97 100644 --- a/apt_dht_Khashmir/util.py +++ b/apt_dht_Khashmir/util.py @@ -1,7 +1,7 @@ ## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved # see LICENSE.txt for license information -"""Some utitlity functions for use in apt-dht's khashmir DHT.""" +"""Some utitlity functions for use in apt-p2p's khashmir DHT.""" from twisted.trial import unittest diff --git a/debian/apt-dht.conf.sgml b/debian/apt-dht.conf.sgml index e1da2a3..301ccb1 100644 --- a/debian/apt-dht.conf.sgml +++ b/debian/apt-dht.conf.sgml @@ -10,8 +10,8 @@ 5"> camrdale@gmail.com"> - apt-dht.conf"> - + apt-p2p.conf"> + Debian"> GNU"> @@ -51,8 +51,8 @@ Configuration information for &dhpackage; is searched for in the following order, with later entries overriding former ones: - /etc/apt-dht/apt-dht.conf - ${HOME}/.apt-dht/apt-dht.conf + /etc/apt-p2p/apt-p2p.conf + ${HOME}/.apt-p2p/apt-p2p.conf the location specified by the config-file parameter @@ -97,7 +97,7 @@ The directory to store the downloaded files in. - (Default is ${HOME}/.apt-dht/cache.) + (Default is ${HOME}/.apt-p2p/cache.) @@ -137,7 +137,7 @@ The DHT implementation to use. It must be possile to do (in python) ``from <DHT>.DHT import DHT'' to get a class that implements the IDHT interface. There should also be a similarly named section below to specify the options for the DHT. - (Default is `apt_dht_Khashmir') + (Default is `apt_p2p_Khashmir') @@ -150,7 +150,7 @@ - apt_dht_Khashmir + apt_p2p_Khashmir @@ -267,7 +267,7 @@ SEE ALSO - apt-dht8 + apt-p2p8 diff --git a/debian/apt-dht.sgml b/debian/apt-dht.sgml index c368bc8..aa106a8 100644 --- a/debian/apt-dht.sgml +++ b/debian/apt-dht.sgml @@ -10,8 +10,8 @@ 8"> camrdale@gmail.com"> - apt-dht"> - + apt-p2p"> + Debian"> GNU"> @@ -47,7 +47,7 @@ Normally &dhpackage; is run from init.d using twistd, in which case no &dhpackage; options can be specified on the command-line, and all configuration variables are - read from the default config file locations of ${HOME}/.apt-dht.conf and /etc/apt-dht/apt-dht.conf. + read from the default config file locations of ${HOME}/.apt-p2p.conf and /etc/apt-p2p/apt-p2p.conf. The command is then: twistd -y /path/to/&dhpackage; @@ -66,7 +66,7 @@ This manual page documents briefly the options available to the &dhpackage; command. &dhpackage; is a helper for downloading Debian packages files with APT. - It will download any needed files from other Apt-DHT peers in a + It will download any needed files from other Apt-P2P peers in a bittorrent-like manner, and so reduce the strain on the Debian mirrors. In order for APT to send it's requests to &dhpackage;, the source.list entries must be modified to point to the @@ -95,8 +95,8 @@ the filename to use for the configuration file, options found in this - file are combined with those in ${HOME}/.apt-dht/apt-dht.conf and /etc/apt-dht/apt-dht.conf - (see apt-dht.conf5 for the format of the file) + file are combined with those in ${HOME}/.apt-p2p/apt-p2p.conf and /etc/apt-p2p/apt-p2p.conf + (see apt-p2p.conf5 for the format of the file) @@ -104,7 +104,7 @@ the filename to print log messages to, or `-' to log to standard output, if not specified then - /var/log/apt-dht.log will be used + /var/log/apt-p2p.log will be used @@ -126,7 +126,7 @@ SEE ALSO - apt-dht.conf5, + apt-p2p.conf5, twistd1 diff --git a/debian/changelog b/debian/changelog index a102107..fcf86f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt-dht (0.0.1~2.gbpc98e84) UNRELEASED; urgency=low +apt-p2p (0.0.1~2.gbpc98e84) UNRELEASED; urgency=low ** SNAPSHOT build @c98e840e6f67e2971ffc26a698d76c09a919db91 ** @@ -19,7 +19,7 @@ apt-dht (0.0.1~2.gbpc98e84) UNRELEASED; urgency=low -- Cameron Dale Wed, 20 Feb 2008 11:35:14 -0800 -apt-dht (0.0.0) unstable; urgency=low +apt-p2p (0.0.0) unstable; urgency=low * Initial release. diff --git a/debian/control b/debian/control index b10043f..928e9a1 100644 --- a/debian/control +++ b/debian/control @@ -1,31 +1,31 @@ -Source: apt-dht +Source: apt-p2p Section: net Priority: optional Maintainer: Cameron Dale -Homepage: http://www.camrdale.org/apt-dht.html +Homepage: http://www.camrdale.org/apt-p2p.html Standards-Version: 3.7.3 Build-Depends: debhelper (>= 5.0.37.2) Build-Depends-Indep: python-dev, python-support (>= 0.5.4), docbook-to-man, python-debian (>= 0.1.4) -Vcs-Git: git://git.camrdale.org/git/apt-dht.git -Vcs-Browser: http://git.camrdale.org/?p=apt-dht.git;a=summary +Vcs-Git: git://git.camrdale.org/git/apt-p2p.git +Vcs-Browser: http://git.camrdale.org/?p=apt-p2p.git;a=summary XS-Dm-Upload-Allowed: yes -Package: apt-dht +Package: apt-p2p Architecture: all Depends: ${python:Depends}, python-twisted-web2 (>= 0.2), adduser, python-debian (>= 0.1.4), python-apt (>= 0.6.20), python-pysqlite2 (>= 2.1) -Provides: python-apt-dht, python-apt-dht-khashmir +Provides: python-apt-p2p, python-apt-p2p-khashmir Description: apt helper for peer-to-peer downloads of Debian packages - Apt-DHT is a helper for downloading Debian packages files with APT. - It will download any needed files from other Apt-DHT peers in a + Apt-P2P is a helper for downloading Debian packages files with APT. + It will download any needed files from other Apt-P2P peers in a bittorrent-like manner, and so reduce the strain on the Debian mirrors. . - The Apt-DHT daemon runs automatically on startup and listens for + The Apt-P2P daemon runs automatically on startup and listens for requests from APT for files, as well as maintaining membership in a Distributed Hash Table (DHT). For any files which have a hash available (most files), peers that have the file are looked for in the DHT. The file can then be downloaded from them, using the uploading bandwidth of other peers while reducing the demand on the Debian mirror - network. However, if a package cannot be found on any peers, Apt-DHT + network. However, if a package cannot be found on any peers, Apt-P2P will fall back to downloading from a mirror to ensure all packages are downloaded. Once downloaded, the file is hash checked and added to the DHT so that other peers can download it without the mirror. diff --git a/debian/copyright b/debian/copyright index 4598a40..14f9ef3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,14 +1,14 @@ -This is the Debian GNU/Linux packaged version of apt-dht +This is the Debian GNU/Linux packaged version of apt-p2p The package is written and maintained by Cameron Dale. The original source can always be found at: - http://ftp.debian.org/debian/pool/main/a/apt-dht/ + http://ftp.debian.org/debian/pool/main/a/apt-p2p/ The project homepage is at - http://www.camrdale.org/apt-dht.html + http://www.camrdale.org/apt-p2p.html -Apt-dht is Copyright (C) 2008 Cameron Dale +Apt-p2p is Copyright (C) 2008 Cameron Dale This software is released under the terms of the GNU General Public License, with the exceptions noted below. @@ -16,7 +16,7 @@ with the exceptions noted below. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. -The module apt_dht_Khashmir is a modified version of the original khashmir, +The module apt_p2p_Khashmir is a modified version of the original khashmir, the source of which can be found at http://sourceforge.net/projects/khashmir. It is covered by the following copyright and permission notice: diff --git a/debian/default b/debian/default index 490116c..08f503f 100644 --- a/debian/default +++ b/debian/default @@ -1,7 +1,7 @@ -# apt-dht configuration +# apt-p2p configuration ## Filename to store pid of process -#pidfile=/var/run/apt-dht/apt-dht.pid +#pidfile=/var/run/apt-p2p/apt-p2p.pid ## Log file -#logfile=/var/log/apt-dht.log +#logfile=/var/log/apt-p2p.log diff --git a/debian/dirs b/debian/dirs index 74bf09f..28f1071 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,6 +1,6 @@ etc/default etc/init.d -usr/share/doc/apt-dht +usr/share/doc/apt-p2p usr/sbin -var/cache/apt-dht -var/lib/apt-dht +var/cache/apt-p2p +var/lib/apt-p2p diff --git a/debian/init.d b/debian/init.d index 1543442..2faf531 100755 --- a/debian/init.d +++ b/debian/init.d @@ -1,7 +1,7 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: apt-dht +# Provides: apt-p2p # Required-Start: $network # Required-Stop: # Should-Start: $named @@ -9,25 +9,25 @@ # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: apt helper for peer-to-peer downloads of Debian packages -# Description: Apt-DHT is a helper for downloading Debian packages +# Description: Apt-p2p is a helper for downloading Debian packages # files with APT. It will download any needed files from -# other Apt-DHT peers in a bittorrent-like manner, and so +# other Apt-p2p peers in a bittorrent-like manner, and so # reduce the strain on the Debian mirrors. ### END INIT INFO -# /etc/init.d/apt-dht: start and stop the apt-dht daemon +# /etc/init.d/apt-p2p: start and stop the apt-p2p daemon PATH=/sbin:/bin:/usr/sbin:/usr/bin -rundir=/var/run/apt-dht/ -pidfile=$rundir/apt-dht.pid -logfile=/var/log/apt-dht.log -application=/usr/sbin/apt-dht +rundir=/var/run/apt-p2p/ +pidfile=$rundir/apt-p2p.pid +logfile=/var/log/apt-p2p.log +application=/usr/sbin/apt-p2p twistd=/usr/bin/twistd -user=aptdht +user=aptp2p group=nogroup -[ -r /etc/default/apt-dht ] && . /etc/default/apt-dht +[ -r /etc/default/apt-p2p ] && . /etc/default/apt-p2p test -x $twistd || exit 0 test -r $application || exit 0 @@ -50,7 +50,7 @@ alive() case "$1" in start) - echo -n "Starting apt-dht" + echo -n "Starting apt-p2p" [ ! -d $rundir ] && mkdir $rundir [ ! -f $logfile ] && touch $logfile chown $user $rundir $logfile @@ -64,7 +64,7 @@ case "$1" in ;; stop) - echo -n "Stopping apt-dht" + echo -n "Stopping apt-p2p" start-stop-daemon --stop --quiet --pidfile $pidfile # # Continue stopping until daemon finished or time over @@ -100,7 +100,7 @@ case "$1" in ;; *) - echo "Usage: /etc/init.d/apt-dht {start|stop|restart|force-reload}" >&2 + echo "Usage: /etc/init.d/apt-p2p {start|stop|restart|force-reload}" >&2 exit 1 ;; esac diff --git a/debian/install b/debian/install index 4ea6423..4ef453d 100644 --- a/debian/install +++ b/debian/install @@ -1 +1 @@ -apt-dht.conf etc/apt-dht +apt-p2p.conf etc/apt-p2p diff --git a/debian/manpages b/debian/manpages index 31493df..b10fc0d 100644 --- a/debian/manpages +++ b/debian/manpages @@ -1,2 +1,2 @@ -debian/apt-dht.8 -debian/apt-dht.conf.5 +debian/apt-p2p.8 +debian/apt-p2p.conf.5 diff --git a/debian/postinst b/debian/postinst index 636f90f..eb87fd2 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,5 +1,5 @@ #! /bin/sh -# postinst script for apt-dht +# postinst script for apt-p2p # # see: dh_installdeb(1) @@ -25,17 +25,17 @@ set -e case "$1" in configure) - if ! getent passwd aptdht >/dev/null; then + if ! getent passwd aptp2p >/dev/null; then adduser --quiet --system --no-create-home \ - --home /var/cache/apt-dht --disabled-password \ + --home /var/cache/apt-p2p --disabled-password \ --disabled-login --shell /bin/false --ingroup nogroup \ - aptdht + aptp2p fi - touch /var/log/apt-dht.log - chown aptdht:adm /var/log/apt-dht.log - mkdir -p /var/cache/apt-dht - chown -R aptdht:adm /var/cache/apt-dht + touch /var/log/apt-p2p.log + chown aptp2p:adm /var/log/apt-p2p.log + mkdir -p /var/cache/apt-p2p + chown -R aptp2p:adm /var/cache/apt-p2p ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm index 8ff06f8..b604ced 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,5 +1,5 @@ #! /bin/sh -# postrm script for apt-dht +# postrm script for apt-p2p # # see: dh_installdeb(1) @@ -19,13 +19,13 @@ set -e if test "$1" = "purge"; then # Remove the logs - rm -rf /var/log/apt-dht.log* + rm -rf /var/log/apt-p2p.log* - echo Purging apt-dht cache directory - rm -rf /var/cache/apt-dht + echo Purging apt-p2p cache directory + rm -rf /var/cache/apt-p2p - if id aptdht >/dev/null; then - deluser aptdht + if id aptp2p >/dev/null; then + deluser aptp2p fi fi diff --git a/debian/prerm b/debian/prerm index f148cf5..9acdfc4 100644 --- a/debian/prerm +++ b/debian/prerm @@ -16,7 +16,7 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -PACKAGE="apt-dht" +PACKAGE="apt-p2p" dpkg --listfiles $PACKAGE | awk '$0~/\.py$/ {print $0"c\n" $0"o"}' | diff --git a/debian/rules b/debian/rules index d9b1943..456af9b 100755 --- a/debian/rules +++ b/debian/rules @@ -8,7 +8,7 @@ PYTHON_VERSION=$(shell /usr/bin/python -V 2>&1 | /usr/bin/perl -le 'print "$$1.$$2" if <> =~m/^Python\s+(\d+)\.(\d+)(\.\d+)*/') -build-stamp: apt-dht.8 apt-dht.conf.5 +build-stamp: apt-p2p.8 apt-p2p.conf.5 dh_testdir touch build-stamp @@ -18,7 +18,7 @@ build-stamp: apt-dht.8 apt-dht.conf.5 clean: dh_testdir dh_testroot - rm -rf build/ apt_dht/*.pyc apt_dht_Khashmir/*.pyc *.pyc + rm -rf build/ apt_p2p/*.pyc apt_p2p_Khashmir/*.pyc *.pyc rm -f debian/*.[58] rm -f build-stamp dh_clean @@ -31,14 +31,14 @@ install: build-stamp dh_clean -k dh_installdirs - ./setup.py install --prefix=$(CURDIR)/debian/apt-dht/usr \ - --install-lib=$(CURDIR)/debian/apt-dht/usr/share/python-support/apt-dht \ - --install-scripts=$(CURDIR)/debian/apt-dht/usr/sbin + ./setup.py install --prefix=$(CURDIR)/debian/apt-p2p/usr \ + --install-lib=$(CURDIR)/debian/apt-p2p/usr/share/python-support/apt-p2p \ + --install-scripts=$(CURDIR)/debian/apt-p2p/usr/sbin # Remove the generated .pyc files - ( cd debian/apt-dht/usr/share/python-support/apt-dht/apt_dht_Khashmir && \ + ( cd debian/apt-p2p/usr/share/python-support/apt-p2p/apt_p2p_Khashmir && \ rm -f *.pyc && \ - cd ../apt_dht && \ + cd ../apt_p2p && \ rm -f *.pyc ) # Build architecture-independent files here. @@ -49,7 +49,7 @@ binary-indep: install dh_installman # Remove the .py from the end of each of these - mv debian/apt-dht/usr/sbin/apt-dht.py debian/apt-dht/usr/sbin/apt-dht + mv debian/apt-p2p/usr/sbin/apt-p2p.py debian/apt-p2p/usr/sbin/apt-p2p dh_installchangelogs dh_install diff --git a/docs/epydoc.config b/docs/epydoc.config index 7435dd0..593c5ab 100644 --- a/docs/epydoc.config +++ b/docs/epydoc.config @@ -3,7 +3,7 @@ # The list of objects to document. Objects can be named using # dotted names, module filenames, or package directory names. # Alases for this option include "objects" and "values". -modules: apt_dht apt_dht_Khashmir test.py +modules: apt_p2p apt_p2p_Khashmir test.py # The type of output that should be generated. Should be one # of: html, text, latex, dvi, ps, pdf. @@ -73,14 +73,14 @@ include-log: yes ### Output options # The documented project's name. -name: Apt-DHT +name: Apt-P2P # The CSS stylesheet for HTML output. Can be the name of a builtin # stylesheet, or the name of a file. css: white # The documented project's URL. -url: http://www.camrdale.org/apt-dht.html +url: http://www.camrdale.org/apt-p2p.html # HTML code for the project link in the navigation bar. If left # unspecified, the project link will be generated based on the diff --git a/docs/motivation/apt-dht-motivation.kilepr b/docs/motivation/apt-dht-motivation.kilepr index 05bdc2f..e3bba67 100644 --- a/docs/motivation/apt-dht-motivation.kilepr +++ b/docs/motivation/apt-dht-motivation.kilepr @@ -5,7 +5,7 @@ kileprversion=1 kileversion=1.9.2 lastDocument=motivation.tex masterDocument= -name=apt-dht-motivation +name=apt-p2p-motivation pkg_extIsRegExp=false pkg_extensions=.cls .sty .dtx src_extIsRegExp=false @@ -23,7 +23,7 @@ highlight=BibTeX line=225 open=true -[item:apt-dht-motivation.kilepr] +[item:apt-p2p-motivation.kilepr] archive=true column=0 encoding= diff --git a/docs/motivation/motivation.tex b/docs/motivation/motivation.tex index 4504abd..80e6db5 100644 --- a/docs/motivation/motivation.tex +++ b/docs/motivation/motivation.tex @@ -324,7 +324,7 @@ method as file downloads), should return the torrent string. A sample implementation has been created that functions as described in section \ref{opportunity}. This software, called -\texttt{apt-dht}, interacts with the \texttt{apt} tool found in most +\texttt{apt-p2p}, interacts with the \texttt{apt} tool found in most Debian-based Linux distributions. Apt uses SHA1 hashes to verify most downloaded files, including the large index files that contain the hashes of the individual packages. We chose this @@ -362,7 +362,7 @@ smaller pieces of a large file using the Range request header. \begin{figure} \centering -\includegraphics[width=\columnwidth]{apt_dht_simulation-size_CDF.eps} +\includegraphics[width=\columnwidth]{apt_p2p_simulation-size_CDF.eps} \caption{The CDF of the size of packages in a Debian system, both for the actual size and adjusted size based on the popularity of the package.} diff --git a/setup.py b/setup.py index 664f390..189af15 100755 --- a/setup.py +++ b/setup.py @@ -12,14 +12,14 @@ c = changelog.Changelog(file=data, max_blocks=1) del data setup( - name = "apt-dht", + name = "apt-p2p", version = c.full_version, author = "Cameron Dale", author_email = "", - url = "http://www.camrdale.org/apt-dht.html", + url = "http://www.camrdale.org/apt-p2p.html", license = "GPL", - packages = ["apt_dht", "apt_dht_Khashmir"], + packages = ["apt_p2p", "apt_p2p_Khashmir"], - scripts = ['apt-dht.py'] + scripts = ['apt-p2p.py'] ) diff --git a/test.py b/test.py index d697b37..10ca2d6 100755 --- a/test.py +++ b/test.py @@ -1,9 +1,9 @@ #!/usr/bin/env python -"""Automated tests of the apt-dht functionality. +"""Automated tests of the apt-p2p functionality. This script runs several automatic tests of some of the functionality in -the apt-dht program. +the apt-p2p program. @type tests: C{dictionary} @var tests: all of the tests that can be run. @@ -15,11 +15,11 @@ the apt-dht program. The bootstrap nodes keys are integers, which must be in the range 1-9. The values are the dictionary of string formatting values for creating - the apt-dht configuration file (see L{apt_dht_conf_template} below). + the apt-p2p configuration file (see L{apt_p2p_conf_template} below). The downloaders keys are also integers in the range 1-99. The values are - the dictionary of string formatting values for creating the apt-dht - configuration file (see L{apt_dht_conf_template} below). + the dictionary of string formatting values for creating the apt-p2p + configuration file (see L{apt_p2p_conf_template} below). The apt-get commands' list elements are tuples with 2 elements: the downloader to run the command on, and the list of command-line @@ -312,7 +312,7 @@ Debug } """ -apt_dht_conf_template = """ +apt_p2p_conf_template = """ [DEFAULT] # Port to listen on for all requests (TCP and UDP) @@ -344,12 +344,12 @@ KEY_REFRESH = 57m # Which DHT implementation to use. # It must be possile to do "from .DHT import DHT" to get a class that # implements the IDHT interface. -DHT = apt_dht_Khashmir +DHT = apt_p2p_Khashmir # Whether to only run the DHT (for providing only a bootstrap node) DHT-ONLY = %(DHT-ONLY)s -[apt_dht_Khashmir] +[apt_p2p_Khashmir] # bootstrap nodes to contact to join the DHT BOOTSTRAP = %(BOOTSTRAP)s @@ -579,7 +579,7 @@ def start_downloader(bootstrap_addresses, num_down, options = {}, @param num_down: the number of the downloader to use @type options: C{dictionary} @param options: the dictionary of string formatting values for creating - the apt-dht configuration file (see L{apt_dht_conf_template} above). + the apt-p2p configuration file (see L{apt_p2p_conf_template} above). (optional, defaults to only using the default arguments) @type mirror: C{string} @param mirror: the Debian mirror to use @@ -635,20 +635,20 @@ def start_downloader(bootstrap_addresses, num_down, options = {}, for k in options: defaults[k] = options[k] - f = open(join([downloader_dir, 'apt-dht.conf']), 'w') - f.write(apt_dht_conf_template % defaults) + f = open(join([downloader_dir, 'apt-p2p.conf']), 'w') + f.write(apt_p2p_conf_template % defaults) f.close() - pid = start('python', [join([sys.path[0], 'apt-dht.py']), - '--config-file=' + join([downloader_dir, 'apt-dht.conf']), - '--log-file=' + join([downloader_dir, 'apt-dht.log']),], + pid = start('python', [join([sys.path[0], 'apt-p2p.py']), + '--config-file=' + join([downloader_dir, 'apt-p2p.conf']), + '--log-file=' + join([downloader_dir, 'apt-p2p.log']),], downloader_dir) return pid def start_bootstrap(bootstrap_addresses, num_boot, options = [], clean = True): """Initialize a new bootstrap node process. - The default arguments specified to the apt-dht invocation are + The default arguments specified to the apt-p2p invocation are the state file and port to use. Any additional arguments needed should be specified by L{options}. @@ -687,13 +687,13 @@ def start_bootstrap(bootstrap_addresses, num_boot, options = [], clean = True): for k in options: defaults[k] = options[k] - f = open(join([bootstrap_dir, 'apt-dht.conf']), 'w') - f.write(apt_dht_conf_template % defaults) + f = open(join([bootstrap_dir, 'apt-p2p.conf']), 'w') + f.write(apt_p2p_conf_template % defaults) f.close() - pid = start('python', [join([sys.path[0], 'apt-dht.py']), - '--config-file=' + join([bootstrap_dir, 'apt-dht.conf']), - '--log-file=' + join([bootstrap_dir, 'apt-dht.log']),], + pid = start('python', [join([sys.path[0], 'apt-p2p.py']), + '--config-file=' + join([bootstrap_dir, 'apt-p2p.conf']), + '--log-file=' + join([bootstrap_dir, 'apt-p2p.log']),], bootstrap_dir) return pid -- 2.39.5