Patchwork archiver: delete the tail slash in directory name

login
register
mail settings
Submitter Liu Jian
Date July 24, 2014, 5:37 a.m.
Message ID <53D09B99.2030301@windriver.com>
Download mbox | patch
Permalink /patch/76535/
State New
Headers show

Comments

Liu Jian - July 24, 2014, 5:37 a.m.
From: Jian Liu <jian.liu@windriver.com>

If directory names in SRC_URI ended with "/", function
do_ar_original() in layers/oe-core/meta/classes/archiver.bbclass
will generate a tar file whose name is ".tar.gz".
So delete the "/" at the tail of the directory names before use the names.

Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/classes/archiver.bbclass | 1 +
1 file changed, 1 insertion(+)
Khem Raj - July 24, 2014, 3:25 p.m.
On Wed, Jul 23, 2014 at 10:37 PM, Liu Jian <jian.liu@windriver.com> wrote:
> local = fetch.localpath(url)
> + local = local.rstrip("/")

may be you could just do local = fetch.localpath(url).rstrip("/") in
the same line

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 70ffda5..a95b516 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -149,6 +149,7 @@  python do_ar_original() {
fetch = bb.fetch2.Fetch([], d)
for url in fetch.urls:
local = fetch.localpath(url)
+ local = local.rstrip("/")
if os.path.isfile(local):
shutil.copy(local, ar_outdir)
elif os.path.isdir(local):