summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/svn.py
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2019-05-17 04:54:50 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-21 12:56:34 +0100
commita1c1f3f7c583267ef9ccc9b24c84568ed0cb47f6 (patch)
treec4500d76aaeeed8c142f8905324e301b9acad29f /bitbake/lib/bb/fetch2/svn.py
parent937e67f95e7ea54a18927826c4888515b67436d6 (diff)
downloadpoky-a1c1f3f7c583267ef9ccc9b24c84568ed0cb47f6.tar.gz
bitbake: svn.py: Stop SVN from directly pulling from an external layer w/o fetcher
Add a new option to the svn fetcher url "externals=allowed". This will allow a user to enable svn co w/ externals. However, this does avoid the fetcher, network access and mirror systems. By default we no longer allow externals in the checkout. This ensures a deterministic download. The system does attempt to identify SVN repos that have externals enabled, and will warn the user. It is up to the user to determine if these are necessary for the recipe. They may disable the warning by adding "externals=nowarn" to the url. In the future we would like to parse this list and see if the items are already in the SRC_URI for that recipe, but with SVN being in limited use these days that extra work is likely not worth the trouble. Add test cases that generated a local SVN tree, with an external source set to github bitbake in svn format. One test case checks that externals are ignored, and one checks that they in downloaded. (Bitbake rev: bf53f07c3647e57d8452a7743a2b04bcb72c80d6) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/svn.py')
-rw-r--r--bitbake/lib/bb/fetch2/svn.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index baeb0e7eea..59ce93160c 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -91,6 +91,13 @@ class Svn(FetchMethod):
91 svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module) 91 svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
92 else: 92 else:
93 suffix = "" 93 suffix = ""
94
95 # externals may be either 'allowed' or 'nowarn', but not both. Allowed
96 # will not issue a warning, but will log to the debug buffer what has likely
97 # been downloaded by SVN.
98 if not ("externals" in ud.parm and ud.parm["externals"] == "allowed"):
99 options.append("--ignore-externals")
100
94 if ud.revision: 101 if ud.revision:
95 options.append("-r %s" % ud.revision) 102 options.append("-r %s" % ud.revision)
96 suffix = "@%s" % (ud.revision) 103 suffix = "@%s" % (ud.revision)
@@ -136,6 +143,18 @@ class Svn(FetchMethod):
136 bb.fetch2.check_network_access(d, svnfetchcmd, ud.url) 143 bb.fetch2.check_network_access(d, svnfetchcmd, ud.url)
137 runfetchcmd(svnfetchcmd, d, workdir=ud.pkgdir) 144 runfetchcmd(svnfetchcmd, d, workdir=ud.pkgdir)
138 145
146 if not ("externals" in ud.parm and ud.parm["externals"] == "nowarn"):
147 # Warn the user if this had externals (won't catch them all)
148 output = runfetchcmd("svn propget svn:externals", d, workdir=ud.moddir)
149 if output:
150 if "--ignore-externals" in svnfetchcmd.split():
151 bb.warn("%s contains svn:externals." % ud.url)
152 bb.warn("These should be added to the recipe SRC_URI as necessary.")
153 bb.warn("svn fetch has ignored externals:\n%s" % output)
154 bb.warn("To disable this warning add ';externals=nowarn' to the url.")
155 else:
156 bb.debug(1, "svn repository has externals:\n%s" % output)
157
139 scmdata = ud.parm.get("scmdata", "") 158 scmdata = ud.parm.get("scmdata", "")
140 if scmdata == "keep": 159 if scmdata == "keep":
141 tar_flags = "" 160 tar_flags = ""