pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files url2pkg: disable resuming trans...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0388aef360bf
branches:  trunk
changeset: 381955:0388aef360bf
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 16 09:16:50 2022 +0000

description:
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:

 pkgtools/url2pkg/files/url2pkg.py |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r d848f46b7455 -r 0388aef360bf pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sat Jul 16 08:59:51 2022 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sat Jul 16 09:16:50 2022 +0000
@@ -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 @@
 
     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(



Home | Main Index | Thread Index | Old Index