mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-07-27 14:51:29 +00:00
Default to checking signatures while pulling a .dsc.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
This commit is contained in:
parent
257b0a8d67
commit
3fb7516d72
@ -236,7 +236,7 @@ class SourcePackage(object):
|
|||||||
yield self._mirror_url(mirror, name)
|
yield self._mirror_url(mirror, name)
|
||||||
yield self._lp_url(name)
|
yield self._lp_url(name)
|
||||||
|
|
||||||
def pull_dsc(self):
|
def pull_dsc(self, verify_signature=True):
|
||||||
"Retrieve dscfile and parse"
|
"Retrieve dscfile and parse"
|
||||||
if self._dsc_source:
|
if self._dsc_source:
|
||||||
parsed = urlparse(self._dsc_source)
|
parsed = urlparse(self._dsc_source)
|
||||||
@ -248,7 +248,7 @@ class SourcePackage(object):
|
|||||||
url = self._lp_url(self.dsc_name)
|
url = self._lp_url(self.dsc_name)
|
||||||
self._download_dsc(url)
|
self._download_dsc(url)
|
||||||
|
|
||||||
self._check_dsc()
|
self._check_dsc(verify_signature=verify_signature)
|
||||||
|
|
||||||
def _download_dsc(self, url):
|
def _download_dsc(self, url):
|
||||||
"Download specified dscfile and parse"
|
"Download specified dscfile and parse"
|
||||||
@ -474,7 +474,7 @@ class DebianSourcePackage(SourcePackage):
|
|||||||
def pull_dsc(self, verify_signature=True):
|
def pull_dsc(self, verify_signature=True):
|
||||||
"Retrieve dscfile and parse"
|
"Retrieve dscfile and parse"
|
||||||
try:
|
try:
|
||||||
super(DebianSourcePackage, self).pull_dsc()
|
super(DebianSourcePackage, self).pull_dsc(verify_signature)
|
||||||
return
|
return
|
||||||
except DownloadError:
|
except DownloadError:
|
||||||
pass
|
pass
|
||||||
|
@ -162,7 +162,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
dscfile='test-data/example_1.0-1.dsc',
|
dscfile='test-data/example_1.0-1.dsc',
|
||||||
workdir=self.workdir)
|
workdir=self.workdir)
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
pkg.unpack()
|
pkg.unpack()
|
||||||
|
|
||||||
def test_workdir_srcpkg_noinfo(self):
|
def test_workdir_srcpkg_noinfo(self):
|
||||||
@ -174,7 +174,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
'example_1.0-1.dsc'),
|
'example_1.0-1.dsc'),
|
||||||
workdir=self.workdir)
|
workdir=self.workdir)
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
pkg.unpack()
|
pkg.unpack()
|
||||||
|
|
||||||
def test_workdir_srcpkg_info(self):
|
def test_workdir_srcpkg_info(self):
|
||||||
@ -187,7 +187,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
'example_1.0-1.dsc'),
|
'example_1.0-1.dsc'),
|
||||||
workdir=self.workdir)
|
workdir=self.workdir)
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
pkg.unpack()
|
pkg.unpack()
|
||||||
|
|
||||||
def test_verification(self):
|
def test_verification(self):
|
||||||
@ -202,7 +202,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
dscfile='test-data/example_1.0-1.dsc',
|
dscfile='test-data/example_1.0-1.dsc',
|
||||||
workdir=self.workdir)
|
workdir=self.workdir)
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
|
|
||||||
def test_pull(self):
|
def test_pull(self):
|
||||||
pkg = self.SourcePackage('example', '1.0-1', 'main',
|
pkg = self.SourcePackage('example', '1.0-1', 'main',
|
||||||
@ -210,7 +210,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
pkg.url_opener = self.url_opener
|
pkg.url_opener = self.url_opener
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
|
|
||||||
def test_mirrors(self):
|
def test_mirrors(self):
|
||||||
mirror = 'http://mirror'
|
mirror = 'http://mirror'
|
||||||
@ -226,7 +226,7 @@ class LocalSourcePackageTestCase(unittest.TestCase):
|
|||||||
workdir=self.workdir, mirrors=[mirror])
|
workdir=self.workdir, mirrors=[mirror])
|
||||||
pkg.url_opener = url_opener
|
pkg.url_opener = url_opener
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
|
|
||||||
def test_dsc_missing(self):
|
def test_dsc_missing(self):
|
||||||
self.mock_http.side_effect = self.request_404
|
self.mock_http.side_effect = self.request_404
|
||||||
@ -263,7 +263,7 @@ class DebianLocalSourcePackageTestCase(LocalSourcePackageTestCase):
|
|||||||
debsec_mirror])
|
debsec_mirror])
|
||||||
pkg.quiet = True
|
pkg.quiet = True
|
||||||
pkg.url_opener = url_opener
|
pkg.url_opener = url_opener
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
pkg.unpack()
|
pkg.unpack()
|
||||||
|
|
||||||
def test_dsc_missing(self):
|
def test_dsc_missing(self):
|
||||||
@ -280,7 +280,7 @@ class DebianLocalSourcePackageTestCase(LocalSourcePackageTestCase):
|
|||||||
pkg = self.SourcePackage('example', '1.0-1', 'main',
|
pkg = self.SourcePackage('example', '1.0-1', 'main',
|
||||||
workdir=self.workdir, mirrors=[mirror])
|
workdir=self.workdir, mirrors=[mirror])
|
||||||
pkg.url_opener = self.url_opener
|
pkg.url_opener = self.url_opener
|
||||||
pkg.pull()
|
pkg.pull(verify_signature=False)
|
||||||
|
|
||||||
def test_dsc_badsig(self):
|
def test_dsc_badsig(self):
|
||||||
mirror = 'http://mirror'
|
mirror = 'http://mirror'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user