[oe] SVN fetcher fix for SRCREV=AUTOREV situations

Marcin Juszkiewicz marcin at juszkiewicz.com.pl
Wed Dec 2 18:19:05 UTC 2009


Hi

I know that for most people here using SRCREV="${AUTOREV}" sounds bad but
there are situations where it is needed. We, at BugLabs, use it for all
our Java stuff which is run on our device.

We got hit by svn fetcher as it uses "svn co -r REV svn://url@REV" syntax
which fails on AUTOREV... Nevermind which Subversion we use (1.4.6, 1.6.6)
we got same situation:

$ svn co -r 7916 svn://svn.buglabs.net/bug/branches/R1.4/qa/com.buglabs.bug.audio.common@7916
svn: URL 'svn://svn.buglabs.net/bug/branches/R1.4/qa/com.buglabs.bug.audio.common' doesn't exist

But:

$ svn co -r 7916 svn://svn.buglabs.net/bug/branches/R1.4/qa/com.buglabs.bug.audio.common

works fine.

I looked at svn fetcher and prepared this change which fixes situation for me:

diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py
index aead162..f5dabdb 100644
--- a/bitbake/lib/bb/fetch/svn.py
+++ b/bitbake/lib/bb/fetch/svn.py
@@ -117,7 +117,9 @@ class Svn(Fetch):
             suffix = ""
             if ud.revision:
                 options.append("-r %s" % ud.revision)
-                suffix = "@%s" % (ud.revision)
+                url = "%s://%s/%s/" % (proto, svnroot, ud.module)
+                if ud.revision != self._latest_revision(url, ud, d):
+                    suffix = "@%s" % (ud.revision)
             elif ud.date:
                 options.append("-r {%s}" % ud.date)

What it does? It adds extra "svn info" run to get latest revision
(think AUTOREV) and if it is not the same as wanted revision (think 
SRCREV) then it use "@REV" syntax. I do not feel that it is good way to
solve problem so want to know what other people think about it.

Regards, 
-- 
JID:      hrw at jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz






More information about the Openembedded-devel mailing list