File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,9 @@ def cfg_url(self, version):
507507 url_expanded = os .path .expandvars (url_subbed )
508508 return url_expanded
509509
510+ def cfg_src_suffix (self ):
511+ return PPG .config .get_value ("%s-src-suffix" % self .m_name )
512+
510513 def cfg_configure (self , deps_lib_dir , deps_lib64_dir ):
511514 if configure := PPG .config .get_value ("%s-configure" % self .m_name ):
512515 configure_template = Template (configure )
@@ -642,9 +645,11 @@ def compile(self):
642645 self ._finalize ()
643646 return
644647
645- if ".tar.gz" not in self .url and ".zip" not in self .url :
646- # TODO: add self.cfg_src_extension to remove assumption of .tar.gz
647- basename = f"{ self .m_name } -{ self .version } .tar.gz"
648+ # Some src_url don't end in file extension, such as with redirects
649+ # Github releases asset endpoint is this way .../releases/assets/48151
650+ if self .url .endswith (".zip" , ".tar.gz" ):
651+ suffix = self .cfg_src_suffix () or ".tar.gz"
652+ basename = f"{ self .m_name } -{ self .version } .{ suffix } "
648653 else :
649654 # Split on '#' for urls that include a checksum, such as #sha256=... fragment
650655 basename = runez .basename (self .url , extension_marker = "#" )
You can’t perform that action at this time.
0 commit comments