aboutsummaryrefslogtreecommitdiffstats
path: root/minidinstall/ChangeFile.py
diff options
context:
space:
mode:
authorLibravatarChristoph Goehre <christoph.goehre@gmx.de>2008-09-20 10:52:41 +0200
committerLibravatarChristoph Goehre <christoph.goehre@gmx.de>2008-09-20 18:10:30 +0200
commita4cc92989da6619456a69f8d176e0986c4935496 (patch)
tree5dfbee6a2297f83bf43443e73f10f3523ab55a96 /minidinstall/ChangeFile.py
parent5bbaa283c704fb3a1d83c281031d6131cfc58a91 (diff)
expand tabs and remove tailing whitespaces
Diffstat (limited to 'minidinstall/ChangeFile.py')
-rw-r--r--minidinstall/ChangeFile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/minidinstall/ChangeFile.py b/minidinstall/ChangeFile.py
index 3b89b34..ca88112 100644
--- a/minidinstall/ChangeFile.py
+++ b/minidinstall/ChangeFile.py
@@ -29,16 +29,16 @@ class ChangeFileException(Exception):
self._value = value
def __str__(self):
return `self._value`
-
+
class ChangeFile(DpkgControl.DpkgParagraph):
md5_re = r'^(?P<md5>[0-9a-f]{32})[ \t]+(?P<size>\d+)[ \t]+(?P<section>[-/a-zA-Z0-9]+)[ \t]+(?P<priority>[-a-zA-Z0-9]+)[ \t]+(?P<file>[0-9a-zA-Z][-+:.,=~0-9a-zA-Z_]+)$'
sha1_re = r'^(?P<sha1>[0-9a-f]{40})[ \t]+(?P<size>\d+)[ \t]+(?P<file>[0-9a-zA-Z][-+:.,=~0-9a-zA-Z_]+)$'
sha256_re = r'^(?P<sha256>[0-9a-f]{64})[ \t]+(?P<size>\d+)[ \t]+(?P<file>[0-9a-zA-Z][-+:.,=~0-9a-zA-Z_]+)$'
- def __init__(self):
+ def __init__(self):
DpkgControl.DpkgParagraph.__init__(self)
self._logger = logging.getLogger("mini-dinstall")
-
+
def load_from_file(self, filename):
f = SignedFile.SignedFile(open(filename))
self.load(f)
@@ -78,7 +78,7 @@ class ChangeFile(DpkgControl.DpkgParagraph):
raise ChangeFileException("Couldn't parse file entry \"%s\" in Files field of .changes" % (line,))
output[hash].append([match.group(hash), match.group('size'), match.group('file') ])
return output
-
+
def verify(self, sourcedir):
""" verify size and hash values from changes file """
checksum = self._get_checksum_from_changes()
@@ -86,7 +86,7 @@ class ChangeFile(DpkgControl.DpkgParagraph):
for (hashsum, size, filename) in checksum[hash]:
self._verify_file_integrity(os.path.join(sourcedir, filename), int(size), hash, hashsum)
-
+
def _verify_file_integrity(self, filename, expected_size, hash, expected_hashsum):
""" check uploaded file integrity """
self._logger.debug('Checking integrity of %s' % (filename,))