diff options
author | rillig <rillig@pkgsrc.org> | 2022-07-16 09:16:50 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-07-16 09:16:50 +0000 |
commit | ef0fec0bb4d8efb567c1ff08c321475589802c42 (patch) | |
tree | 1450a81635bcff8cf0ef2030fda4615d6f9242b1 /pkgtools/url2pkg/files | |
parent | 61c1dfa83d68df380fe9b24b8011ec5a6ecbff30 (diff) | |
download | pkgsrc-ef0fec0bb4d8efb567c1ff08c321475589802c42.tar.gz |
url2pkg: disable resuming transfers when fetching distfiles
Resuming the transfer only works if there already is a distinfo file, as
otherwise the correct size of the file is not known.
This prevents these warnings from mk/fetch/fetch:
> fetch: ``-r'' requires ``-f distinfo''.
> fetch: Falling back to non-resume fetch.
Diffstat (limited to 'pkgtools/url2pkg/files')
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.py b/pkgtools/url2pkg/files/url2pkg.py index 53580cf1a5c..9cf59bfc208 100644 --- a/pkgtools/url2pkg/files/url2pkg.py +++ b/pkgtools/url2pkg/files/url2pkg.py @@ -1,5 +1,5 @@ #! @PYTHONBIN@ -# $NetBSD: url2pkg.py,v 1.43 2022/07/16 08:59:38 rillig Exp $ +# $NetBSD: url2pkg.py,v 1.44 2022/07/16 09:16:50 rillig Exp $ # Copyright (c) 2019 The NetBSD Foundation, Inc. # All rights reserved. @@ -108,7 +108,12 @@ class Globals: def bmake(self, *args: str) -> None: self.debug('running bmake {0} in {1}', args, str(self.pkgdir)) - subprocess.check_call([self.make, *args], cwd=self.pkgdir) + env = dict(os.environ) + env.update({ + # Resuming transfers only works when distinfo already exists. + 'PKG_RESUME_TRANSFERS': 'no', + }) + subprocess.check_call([self.make, *args], cwd=self.pkgdir, env=env) def show_var(self, varname: str) -> str: output = subprocess.check_output( |