From 7262bab8e520db7e326c219c24e996e20f91e906 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 3 Sep 2014 10:25:26 +0200 Subject: fix tests --- apt/auth.py | 6 ++++-- apt/debfile.py | 2 +- python/tag.cc | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apt/auth.py b/apt/auth.py index b8089d0c..74fea10b 100644 --- a/apt/auth.py +++ b/apt/auth.py @@ -192,9 +192,11 @@ def _add_key_from_keyserver(keyid, keyserver, tmp_keyring_dir): # what gnupg is using) signing_key_fingerprint = keyid.replace("0x", "").upper() if got_fingerprint != signing_key_fingerprint: + # make the error match what gnupg >= 1.4.18 will output when + # it checks the key itself before importing it raise AptKeyError( - "Fingerprints do not match, not importing: '%s' != '%s'" % ( - signing_key_fingerprint, got_fingerprint)) + "recv from '%s' failed for '%s'" % ( + keyserver, signing_key_fingerprint)) # finally add it add_key_from_file(tmp_export_keyring) diff --git a/apt/debfile.py b/apt/debfile.py index 2528fd8a..1f93b7bb 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -721,7 +721,7 @@ class DscSrcPackage(DebPackage): # we only care about the stanza with the "Format:" tag, the # rest is gpg signature noise. we should probably have # bindings for apts OpenMaybeClearsignedFile() - if not "Format" in sec: + if "Format" not in sec: continue for tag in depends_tags: if tag not in sec: diff --git a/python/tag.cc b/python/tag.cc index 8f483467..8fb0a78e 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -344,7 +344,7 @@ static PyObject *TagFileNext(PyObject *Self) Obj.Section->Data = new char[Stop-Start+2]; snprintf(Obj.Section->Data, Stop-Start+2, "%s\n", Start); // Rescan it - if(Obj.Section->Object.Scan(Obj.Section->Data, Stop-Start) == false) + if(Obj.Section->Object.Scan(Obj.Section->Data, Stop-Start+2) == false) return HandleErrors(NULL); Py_INCREF(Obj.Section); -- cgit v1.2.3