self.releaseFile = f
break
- self.client.file_updated(self.releaseFile[self.releaseFile.find('_dists_')-6:].replace('_','/'),
+ self.client.file_updated(self.releaseFile[self.releaseFile.find('_dists_'):].replace('_','/'),
'/var/lib/apt/lists/' + self.releaseFile)
- self.client.file_updated(self.packagesFile[self.packagesFile.find('_dists_')-6:].replace('_','/'),
+ self.client.file_updated(self.packagesFile[self.packagesFile.find('_dists_'):].replace('_','/'),
'/var/lib/apt/lists/' + self.packagesFile)
- self.client.file_updated(self.sourcesFile[self.sourcesFile.find('_dists_')-6:].replace('_','/'),
+ self.client.file_updated(self.sourcesFile[self.sourcesFile.find('_dists_'):].replace('_','/'),
'/var/lib/apt/lists/' + self.sourcesFile)
def test_pkg_hash(self):
'/var/lib/apt/lists/' + self.releaseFile +
' | grep -E " main/binary-i386/Packages.bz2$"'
' | head -n 1 | cut -d\ -f 2').read().rstrip('\n')
- idx_path = self.releaseFile[self.releaseFile.find('_dists_')-6:].replace('_','/')[:-7] + 'main/binary-i386/Packages.bz2'
+ idx_path = '/' + self.releaseFile[self.releaseFile.find('_dists_')+1:].replace('_','/')[:-7] + 'main/binary-i386/Packages.bz2'
d = self.client.findHash(idx_path)
d.addCallback(self.verifyHash, idx_path, idx_hash)
'/var/lib/apt/lists/' + self.packagesFile +
' | grep -E "^SHA1:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')
- pkg_path = os.popen('grep -A 30 -E "^Package: dpkg$" ' +
+ pkg_path = '/' + os.popen('grep -A 30 -E "^Package: dpkg$" ' +
'/var/lib/apt/lists/' + self.packagesFile +
' | grep -E "^Filename:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')
def test_findSrcHash(self):
lastDefer = defer.Deferred()
- src_dir = os.popen('grep -A 30 -E "^Package: dpkg$" ' +
+ src_dir = '/' + os.popen('grep -A 30 -E "^Package: dpkg$" ' +
'/var/lib/apt/lists/' + self.sourcesFile +
' | grep -E "^Directory:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')
'/var/lib/apt/lists/' + self.releaseFile +
' | grep -E " main/binary-i386/Packages.bz2$"'
' | head -n 1 | cut -d\ -f 2').read().rstrip('\n')
- idx_path = self.releaseFile[self.releaseFile.find('_dists_')-6:].replace('_','/')[:-7] + 'main/binary-i386/Packages.bz2'
+ idx_path = '/' + self.releaseFile[self.releaseFile.find('_dists_')+1:].replace('_','/')[:-7] + 'main/binary-i386/Packages.bz2'
d = self.client.findHash(idx_path)
d.addCallback(self.verifyHash, idx_path, idx_hash)
'/var/lib/apt/lists/' + self.packagesFile +
' | grep -E "^SHA1:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')
- pkg_path = os.popen('grep -A 30 -E "^Package: dpkg$" ' +
+ pkg_path = '/' + os.popen('grep -A 30 -E "^Package: dpkg$" ' +
'/var/lib/apt/lists/' + self.packagesFile +
' | grep -E "^Filename:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')
d = self.client.findHash(pkg_path)
d.addCallback(self.verifyHash, pkg_path, pkg_hash)
- src_dir = os.popen('grep -A 30 -E "^Package: dpkg$" ' +
+ src_dir = '/' + os.popen('grep -A 30 -E "^Package: dpkg$" ' +
'/var/lib/apt/lists/' + self.sourcesFile +
' | grep -E "^Directory:" | head -n 1' +
' | cut -d\ -f 2').read().rstrip('\n')