Bug 972

Summary: tag= does not work as expected for git URIs
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Ke Yu <ke.yu>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: poky.bs.watcher, poky.watcher, sgw
Version: 1.0   
Target Milestone: 1.0 PointRelease   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Paul Eggleton 2011-04-12 08:09:30 UTC
If you specify a tag which is not a sha1 hash in a git URI then it will be ignored; when it unpacks you get master instead.

Example URI:

SRC_URI = "git://git.ipxe.org/ipxe.git;protocol=git;tag=v${PV}"
Comment 1 Ke Yu 2011-04-19 21:39:34 UTC
The culprit is here:
bitbake/lib/bb/fetch2/git.py:
"
        for name in ud.names:
            # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
            if not ud.revisions[name] or len(ud.revisions[name]) != 40  or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
                ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
"

when revision is tag like v${PV}, fetcher will consider it as invalid sha256 checksum, and replace it with master laster revision.

Need to think about the better way to handle this case