Skip to contentSkip to conversation

bitbake-setup: Add strip to dldir

PATCH In review Yiding Liu (Fujitsu) 2 participants 2 messages Feb 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-setup: Add strip to dldir

If user add "" to dl-dir as DL_DIR, it will show FetchError as following.

raise FetchError("Unable to fetch URL from any source.", u)
bb.fetch2.FetchError: Fetcher failure for URL: 'git://git.openembedded.org/bitbake;protocol=https;rev=master;branch=master;destsuffix=bitbake'. Unable to fetch URL from any source.

But from this log, user can't locate the real reason which is that the path "/aa/bb" is invalid.

So I make this fix, even if user add "" to dl-dir, the dl-dir will be the valid path.

---
 bin/bitbake-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/bitbake-setup +1 -1
index abe7614c8..2ea5a5f3b 100755
@@ -41,7 +41,7 @@ def cache_dir(top_dir):
     return os.path.join(top_dir, '.bitbake-setup-cache')
 
 def init_bb_cache(top_dir, settings, args):
-    dldir = settings["default"]["dl-dir"]
+    dldir = settings["default"]["dl-dir"].strip('"')
     bb_cachedir = os.path.join(cache_dir(top_dir), 'bitbake-cache')
 
     d = bb.data.init()
Signature · 1 line
2.43.0
#1 lore raw

bin/bitbake-setup def cache_dir(top_dir): · line 44

Quoted 2 lines · Yiding Liu (Fujitsu) via lists.openembedded.org
bin/bitbake-setup +1 -1
-    dldir = settings["default"]["dl-dir"]
+    dldir = settings["default"]["dl-dir"].strip('"')

This makes sense, but we should be doing it consistently with all the settings that are strings, particularly top dir prefix and name would have the same issue. Can you look into it please?

Alex