All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] convert-srcuri.py: remove extra spaces before backslash
@ 2021-11-11  3:48 kai.kang
  2021-11-11  8:40 ` [OE-core] " Quentin Schulz
  0 siblings, 1 reply; 3+ messages in thread
From: kai.kang @ 2021-11-11  3:48 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

There may be more than one spaces before backslash in SRC_URI. Strip
them otherwise it forges a malformed uri such as open-iscsi-user in
meta-openstack:

SRC_URI = "git://github.com/open-iscsi/open-iscsi.git;protocol=https  ;branch=master \

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 scripts/contrib/convert-srcuri.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/contrib/convert-srcuri.py b/scripts/contrib/convert-srcuri.py
index 5b362ea2e8..e7a97fdbd4 100755
--- a/scripts/contrib/convert-srcuri.py
+++ b/scripts/contrib/convert-srcuri.py
@@ -36,7 +36,7 @@ def processfile(fn):
                         if line.endswith('"\n'):
                             line = line.replace('"\n', ';branch=master"\n')
                         elif line.endswith(" \\\n"):
-                            line = line.replace(' \\\n', ';branch=master \\\n')
+                            line = line.replace(' \\\n', '').rstrip() + ';branch=master \\\n'
                         modified = True
                     if ("git://" in line or "gitsm://" in line) and "github.com" in line and "protocol=https" not in line and matchline(line):
                         if "protocol=git" in line:
@@ -44,7 +44,7 @@ def processfile(fn):
                         elif line.endswith('"\n'):
                             line = line.replace('"\n', ';protocol=https"\n')
                         elif line.endswith(" \\\n"):
-                            line = line.replace(' \\\n', ';protocol=https \\\n')
+                            line = line.replace(' \\\n', '').rstrip() + ';protocol=https \\\n'
                         modified = True
                     new_file.write(line)
         if modified:
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-11  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-11  3:48 [PATCH] convert-srcuri.py: remove extra spaces before backslash kai.kang
2021-11-11  8:40 ` [OE-core] " Quentin Schulz
2021-11-11  9:58   ` Kai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.