mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
drop quiet download stuff, not worth an API debate
This commit is contained in:
parent
44df5e3081
commit
a4000c606c
@ -348,8 +348,8 @@ def copy(src_pkg, release, simulate=False, force=False):
|
||||
sys.exit(1)
|
||||
|
||||
# Check whether a fakesync would be required.
|
||||
src_pkg.pull_dsc(quiet=not Logger.verbose)
|
||||
ubuntu_pkg.pull_dsc(quiet=not Logger.verbose)
|
||||
src_pkg.pull_dsc()
|
||||
ubuntu_pkg.pull_dsc()
|
||||
if not src_pkg.dsc.compare_dsc(ubuntu_pkg.dsc):
|
||||
Logger.error('The checksums of the Debian and Ubuntu packages '
|
||||
'mismatch. A fake sync using --no-lp is required.')
|
||||
|
@ -231,7 +231,7 @@ class SourcePackage(object):
|
||||
yield self._mirror_url(mirror, name)
|
||||
yield self._lp_url(name)
|
||||
|
||||
def pull_dsc(self, quiet = False):
|
||||
def pull_dsc(self):
|
||||
"Retrieve dscfile and parse"
|
||||
if self._dsc_source:
|
||||
parsed = urlparse.urlparse(self._dsc_source)
|
||||
@ -245,12 +245,11 @@ class SourcePackage(object):
|
||||
# Temporarily rename to the filename we are going to open
|
||||
os.rename(parsed.path, self.dsc_pathname)
|
||||
else:
|
||||
if not self._download_file(self._dsc_source, self.dsc_name,
|
||||
quiet=quiet):
|
||||
if not self._download_file(self._dsc_source, self.dsc_name):
|
||||
raise DownloadError('dsc not found')
|
||||
else:
|
||||
if not self._download_file(self._lp_url(self.dsc_name),
|
||||
self.dsc_name, quiet=quiet):
|
||||
self.dsc_name):
|
||||
raise DownloadError('dsc not found')
|
||||
self._check_dsc()
|
||||
|
||||
@ -297,7 +296,7 @@ class SourcePackage(object):
|
||||
else:
|
||||
Logger.info(message)
|
||||
|
||||
def _download_file(self, url, filename, quiet = False):
|
||||
def _download_file(self, url, filename):
|
||||
"Download url to filename in workdir."
|
||||
logurl = url
|
||||
if os.path.basename(url) != filename:
|
||||
@ -311,11 +310,9 @@ class SourcePackage(object):
|
||||
if entry['name'] == filename]
|
||||
assert len(size) == 1
|
||||
size = int(size[0])
|
||||
if not quiet:
|
||||
Logger.normal('Downloading %s (%0.3f MiB)', logurl,
|
||||
size / 1024.0 / 1024)
|
||||
else:
|
||||
if not quiet:
|
||||
Logger.normal('Downloading %s', logurl)
|
||||
|
||||
# Launchpad will try to redirect us to plain-http Launchpad Librarian,
|
||||
@ -336,11 +333,9 @@ class SourcePackage(object):
|
||||
if block == '':
|
||||
break
|
||||
out.write(block)
|
||||
if not quiet:
|
||||
Logger.stdout.write('.')
|
||||
Logger.stdout.flush()
|
||||
in_.close()
|
||||
if not quiet:
|
||||
Logger.stdout.write(' done\n')
|
||||
Logger.stdout.flush()
|
||||
if self.dsc and not url.endswith('.dsc'):
|
||||
@ -461,10 +456,10 @@ class DebianSourcePackage(SourcePackage):
|
||||
if self.snapshot_list:
|
||||
yield self._snapshot_url(name)
|
||||
|
||||
def pull_dsc(self, quiet = False):
|
||||
def pull_dsc(self):
|
||||
"Retrieve dscfile and parse"
|
||||
try:
|
||||
super(DebianSourcePackage, self).pull_dsc(quiet=quiet)
|
||||
super(DebianSourcePackage, self).pull_dsc()
|
||||
return
|
||||
except DownloadError:
|
||||
pass
|
||||
@ -472,7 +467,7 @@ class DebianSourcePackage(SourcePackage):
|
||||
# Not all Debian Source packages get imported to LP
|
||||
# (or the importer could be lagging)
|
||||
for url in self._source_urls(self.dsc_name):
|
||||
if self._download_file(url, self.dsc_name, quiet=quiet):
|
||||
if self._download_file(url, self.dsc_name):
|
||||
break
|
||||
else:
|
||||
raise DownloadError('dsc could not be found anywhere')
|
||||
|
Loading…
x
Reference in New Issue
Block a user