Skip to contentSkip to conversation

wget: Make wget --passive-ftp option conditional on ftp/ftps

PATCH New Rob Woolley 1 participant 1 message Apr 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wget: Make wget --passive-ftp option conditional on ftp/ftps

Fedora 40 introduces wget2 as a drop-in replacement for wget. This rewrite does not currently have support for FTP. This causes the wget fetcher to fail complaining about an unrecognized option.

Making --passive-ftp conditional based on the protocol used in the SRC_URI limits the scope of the problem. It also gives us an opportunity to build the older wget as a host tool.

---
 lib/bb/fetch2/wget.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/wget.py +4 -1
index dc025800..fbfa6938 100644
@@ -87,7 +87,10 @@ class Wget(FetchMethod):
         if not ud.localfile:
             ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
 
-        self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp"
+        self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30"
+
+        if ud.type == 'ftp' or ud.type == 'ftps':
+            self.basecmd += " --passive-ftp"
 
         if not self.check_certs(d):
             self.basecmd += " --no-check-certificate"
Signature · 1 line
2.43.0