Skip to content

Commit

Permalink
fetcher: svn: Add support for checkout to a custom path
Browse files Browse the repository at this point in the history
Add support for the Subversion fetcher to checkout modules to a custom path
than the module name to avoid checkout is always module - svn is path
based and tag/branch-checkout might break builds because of invaid path specs.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information
rehsack authored and rpurdie committed Oct 27, 2015
1 parent 02c64f7 commit af88f53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/bb/fetch2/svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def urldata_init(self, ud, d):

ud.module = ud.parm["module"]

if not "path_spec" in ud.parm:
ud.path_spec = ud.module
else:
ud.path_spec = ud.parm["path_spec"]

# Create paths to svn checkouts
relpath = self._strip_leading_slashes(ud.path)
ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
Expand Down Expand Up @@ -102,7 +107,7 @@ def _buildsvncommand(self, ud, d, command):

if command == "fetch":
transportuser = ud.parm.get("transportuser", "")
svncmd = "%s co %s %s://%s%s/%s%s %s" % (ud.basecmd, " ".join(options), proto, transportuser, svnroot, ud.module, suffix, ud.module)
svncmd = "%s co %s %s://%s%s/%s%s %s" % (ud.basecmd, " ".join(options), proto, transportuser, svnroot, ud.module, suffix, ud.path_spec)
elif command == "update":
svncmd = "%s update %s" % (ud.basecmd, " ".join(options))
else:
Expand Down Expand Up @@ -149,7 +154,7 @@ def download(self, ud, d):

os.chdir(ud.pkgdir)
# tar them up to a defined filename
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d, cleanup = [ud.localpath])
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.path_spec), d, cleanup = [ud.localpath])

def clean(self, ud, d):
""" Clean SVN specific files and dirs """
Expand Down

0 comments on commit af88f53

Please sign in to comment.