]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
build-many-glibcs.py: Include URL in download exception
authorFlorian Weimer <fweimer@redhat.com>
Mon, 8 Dec 2025 22:31:02 +0000 (23:31 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 9 Dec 2025 00:23:05 +0000 (01:23 +0100)
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
scripts/build-many-glibcs.py

index 586a2d8f833de186e883ddc15d0263fd3b6a5a44..940b66a09a310ad268917826a0f664facc5839ac 100755 (executable)
@@ -1074,8 +1074,11 @@ class Context(object):
         baseurl = os.environ.get('FTP_GNU_ORG_MIRROR' , 'https://ftp.gnu.org').rstrip('/')
         url = url_map[component] % {'version': version, 'major': version_major, 'baseurl': baseurl}
         filename = os.path.join(self.srcdir, url.split('/')[-1])
-        response = urllib.request.urlopen(url)
-        data = response.read()
+        try:
+            with urllib.request.urlopen(url) as response:
+                data = response.read()
+        except:
+            raise IOError('downloading ' + repr(url))
         with open(filename, 'wb') as f:
             f.write(data)
         subprocess.run(['tar', '-C', self.srcdir, '-x', '-f', filename],