[OE-core] how to use AUTOREV for a SVN repo in oe-core?

Cliff Brake cliff.brake at gmail.com
Fri Aug 26 02:56:17 UTC 2011


Hello,

I'm trying to figure out how AUTOREV is supposed to work these days
with oe-core.  In the past, I would do something like:

SRCREV = "${AUTOREV}"
PV = "1.0+svnr${SRCREV}"

in my custom application recipes to always build the head of a SVN repo.

In OE classic, we have:

SRCPV = "${@bb.fetch.get_srcrev(d)}"
AUTOREV = "${SRCPV}"

In oe-core, we have:

AUTOREV = "${@bb.fetch2.get_autorev(d)}"
SRCPV = "${@bb.fetch2.get_srcrev(d)}"

in bitbake, we have:

def get_autorev(d):
    #  only not cache src rev in autorev case
    if bb.data.getVar('BB_SRCREV_POLICY', d, True) != "cache":
        bb.data.setVar('__BB_DONT_CACHE', '1', d)
    return "AUTOINC"

def get_srcrev(d):
    """
    Return the version string for the current package
    (usually to be used as PV)
    Most packages usually only have one SCM so we just pass on the call.
    In the multi SCM case, we build a value based on SRCREV_FORMAT which must
    have been set.
    """

    scms = []
    fetcher = Fetch( ....

Therefore, I get package names like the following with oe-core:

svs_1.0+svnrAUTOINC-r4_armv5te.ipk

In the OE classic days, AUTOINC would be replaced with the SVN revision.

And if I check in new changes to the SVN project, it does not rebuild.

What is the recommended way to create a recipe that always builds the
tip of source in a SVN repo?

Its interesting there is a change in oe-core from Feb 13 that switched
from fetch to fetch2:

commit a26163b8f5fc682e6ee4d597e5dd487485b180f5
Author: Saul Wold <sgw at linux.intel.com>
Date:   Sun Feb 13 23:57:59 2011 -0800

    bitbake.conf: change revision fetching to use newer fetch2 code

    Signed-off-by: Saul Wold <sgw at linux.intel.com>

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index da50fe5..162c792 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -560,8 +560,8 @@ UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT}
update -d -P ${CVSCOOPTS}"
 UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
 SRCDATE = "${DATE}"
 SRCREV = "INVALID"
-AUTOREV = "${@bb.fetch.get_autorev(d)}"
-SRCPV = "${@bb.fetch.get_srcrev(d)}"
+AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+SRCPV = "${@bb.fetch2.get_srcrev(d)}"

 SRC_URI = "file://${FILE}"

and the corresponding functions in fetch are:

def get_autorev(d):
    return get_srcrev(d)

def get_srcrev(d):
   ....

So, before the above change, I would expect the OE classic behavior in oe-core.

Thanks,
Cliff



-- 
=================
http://bec-systems.com




More information about the Openembedded-core mailing list