* [PATCH] fetch2/svn: Enhance to cope with subversion 1.7 upgrade
@ 2012-07-02 20:23 Richard Purdie
2012-07-03 18:03 ` Martin Jansa
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2012-07-02 20:23 UTC (permalink / raw)
To: bitbake-devel
svn changed working checkout formats between 1.6 and 1.7. Its convoluted to
detect what format a given working copy is in so the simplest solution is simply
to run "svn upgrade" within the working copy.
The base svn command variable is relocated slightly to enable this new code to
work effectively.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index 59d7ccb..bc5b96b 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -49,6 +49,8 @@ class Svn(FetchMethod):
if not "module" in ud.parm:
raise MissingParameterError('module', ud.url)
+ ud.basecmd = d.getVar('FETCHCMD_svn', True)
+
ud.module = ud.parm["module"]
# Create paths to svn checkouts
@@ -69,8 +71,6 @@ class Svn(FetchMethod):
command is "fetch", "update", "info"
"""
- basecmd = data.expand('${FETCHCMD_svn}', d)
-
proto = ud.parm.get('proto', 'svn')
svn_rsh = None
@@ -88,7 +88,7 @@ class Svn(FetchMethod):
options.append("--password %s" % ud.pswd)
if command == "info":
- svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
+ svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
else:
suffix = ""
if ud.revision:
@@ -96,9 +96,9 @@ class Svn(FetchMethod):
suffix = "@%s" % (ud.revision)
if command == "fetch":
- svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
+ svncmd = "%s co %s %s://%s/%s%s %s" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
elif command == "update":
- svncmd = "%s update %s" % (basecmd, " ".join(options))
+ svncmd = "%s update %s" % (ud.basecmd, " ".join(options))
else:
raise FetchError("Invalid svn command %s" % command, ud.url)
@@ -117,6 +117,11 @@ class Svn(FetchMethod):
logger.info("Update " + loc)
# update sources there
os.chdir(ud.moddir)
+ # We need to attempt to run svn upgrade first in case its an older working format
+ try:
+ runfetchcmd(ud.basecmd + " upgrade", d)
+ except FetchError:
+ pass
logger.debug(1, "Running %s", svnupdatecmd)
bb.fetch2.check_network_access(d, svnupdatecmd, ud.url)
runfetchcmd(svnupdatecmd, d)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fetch2/svn: Enhance to cope with subversion 1.7 upgrade
2012-07-02 20:23 [PATCH] fetch2/svn: Enhance to cope with subversion 1.7 upgrade Richard Purdie
@ 2012-07-03 18:03 ` Martin Jansa
0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2012-07-03 18:03 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 3418 bytes --]
On Mon, Jul 02, 2012 at 09:23:04PM +0100, Richard Purdie wrote:
> svn changed working checkout formats between 1.6 and 1.7. Its convoluted to
> detect what format a given working copy is in so the simplest solution is simply
> to run "svn upgrade" within the working copy.
>
> The base svn command variable is relocated slightly to enable this new code to
> work effectively.
>
Tested-by: Martin Jansa <Martin.Jansa@gmail.com>
but as described in [YOCTO #2409] I was using 1.7 on premirror as well
as builder so all my checkouts/tarballs were already in 1.7 format.
Cheers,
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
> index 59d7ccb..bc5b96b 100644
> --- a/bitbake/lib/bb/fetch2/svn.py
> +++ b/bitbake/lib/bb/fetch2/svn.py
> @@ -49,6 +49,8 @@ class Svn(FetchMethod):
> if not "module" in ud.parm:
> raise MissingParameterError('module', ud.url)
>
> + ud.basecmd = d.getVar('FETCHCMD_svn', True)
> +
> ud.module = ud.parm["module"]
>
> # Create paths to svn checkouts
> @@ -69,8 +71,6 @@ class Svn(FetchMethod):
> command is "fetch", "update", "info"
> """
>
> - basecmd = data.expand('${FETCHCMD_svn}', d)
> -
> proto = ud.parm.get('proto', 'svn')
>
> svn_rsh = None
> @@ -88,7 +88,7 @@ class Svn(FetchMethod):
> options.append("--password %s" % ud.pswd)
>
> if command == "info":
> - svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
> + svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
> else:
> suffix = ""
> if ud.revision:
> @@ -96,9 +96,9 @@ class Svn(FetchMethod):
> suffix = "@%s" % (ud.revision)
>
> if command == "fetch":
> - svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
> + svncmd = "%s co %s %s://%s/%s%s %s" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
> elif command == "update":
> - svncmd = "%s update %s" % (basecmd, " ".join(options))
> + svncmd = "%s update %s" % (ud.basecmd, " ".join(options))
> else:
> raise FetchError("Invalid svn command %s" % command, ud.url)
>
> @@ -117,6 +117,11 @@ class Svn(FetchMethod):
> logger.info("Update " + loc)
> # update sources there
> os.chdir(ud.moddir)
> + # We need to attempt to run svn upgrade first in case its an older working format
> + try:
> + runfetchcmd(ud.basecmd + " upgrade", d)
> + except FetchError:
> + pass
> logger.debug(1, "Running %s", svnupdatecmd)
> bb.fetch2.check_network_access(d, svnupdatecmd, ud.url)
> runfetchcmd(svnupdatecmd, d)
>
>
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-03 18:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-02 20:23 [PATCH] fetch2/svn: Enhance to cope with subversion 1.7 upgrade Richard Purdie
2012-07-03 18:03 ` Martin Jansa
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.