diff options
author | Constantin Musca <constantinx.musca@intel.com> | 2012-12-05 10:58:26 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-17 17:41:54 +0000 |
commit | 61cf01c5c236b4218f40cfae7c059c2b86765dbd (patch) | |
tree | 3535ac513601dd3d877477fa35972be5f4accb0f /lib/bb/fetch2/git.py | |
parent | a906c94328b040d5076571bd593b57be7ee403a5 (diff) | |
download | bitbake-61cf01c5c236b4218f40cfae7.tar.gz |
fetch2: remove localcount and use AUTOINC instead
- do not use the BB_URI_LOCALCOUNT database for computing revision
incremental numbers anymore
- sortable_revision now generates "AUTOINC+${latest_rev}"
- use one incrementing value rather than several
- PV becomes 0.1+gitAUTOINC+deadbeefdecafbad_decafbaddeadbeef
- remove all localcount code and simplify the fetcher
- this patch addresses the following proposal:
http://lists.linuxtogo.org/pipermail/bitbake-devel/2012-November/003878.html
Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/git.py')
-rw-r--r-- | lib/bb/fetch2/git.py | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index ba9f5fb9a..63ff00b16 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -71,11 +71,8 @@ from bb.fetch2 import logger class Git(FetchMethod): """Class to fetch a module or modules from git repositories""" def init(self, d): - # - # Only enable _sortable revision if the key is set - # - if d.getVar("BB_GIT_CLONE_FOR_SRCREV", True): - self._sortable_buildindex = self._sortable_buildindex_disabled + pass + def supports(self, url, ud, d): """ Check to see if a given url can be fetched with git. @@ -316,38 +313,6 @@ class Git(FetchMethod): def _build_revision(self, url, ud, d, name): return ud.revisions[name] - def _sortable_buildindex_disabled(self, url, ud, d, rev): - """ - Return a suitable buildindex for the revision specified. This is done by counting revisions - using "git rev-list" which may or may not work in different circumstances. - """ - - cwd = os.getcwd() - - # Check if we have the rev already - - if not os.path.exists(ud.clonedir): - logger.debug(1, "GIT repository for %s does not exist in %s. \ - Downloading.", url, ud.clonedir) - self.download(None, ud, d) - if not os.path.exists(ud.clonedir): - logger.error("GIT repository for %s does not exist in %s after \ - download. Cannot get sortable buildnumber, using \ - old value", url, ud.clonedir) - return None - - - os.chdir(ud.clonedir) - if not self._contains_ref(rev, d): - self.download(None, ud, d) - - output = runfetchcmd("%s rev-list %s -- 2> /dev/null | wc -l" % (ud.basecmd, rev), d, quiet=True) - os.chdir(cwd) - - buildindex = "%s" % output.split()[0] - logger.debug(1, "GIT repository for %s in %s is returning %s revisions in rev-list before %s", url, ud.clonedir, buildindex, rev) - return buildindex - def checkstatus(self, uri, ud, d): fetchcmd = "%s ls-remote %s" % (ud.basecmd, uri) try: |