openembedded git-fetch过程

本文详细解析了OpenEmbedded中git-fetch的过程,包括获取最新tag、读取log及存档步骤。同时,提出了在不同recipe中SRCREV与tag处理的不一致问题,讨论了可能的原因,如CacheData的影响及PV、SRCPV之间的转换关系。此外,还简要介绍了SVN和CVS的fetch过程,探讨了版本控制的策略选择。

git_fetch    过程
fetch.init ->setup_localpath->git.localpath->latest_revision->git->_latest_revision
git ls-remote    git://path     branch  得到最新tag

git.go  self._contains_ref
git log --pretty=oneline -n 1 tag -- 2> /dev/null | wc -l 读取log

读取文件到 暂存区
git read-tree tag

从暂存区拷贝文件到工作目录
 git checkout-index -q -f --prefix=workdir/ -a

存包
tar -czf /work/gitproject.tar.gz ./*

 

疑惑:
recipes/openpli/enigma2-pliplus.bb  在SRC_URI加上tag可以选择不同版本
+SRCREV= "bcf694f5e6d3b9e8dba1f8e14201694420390bad",并不能得到这个tag
-inherit gitpkgv
-PV = "1.0+git${SRCPV}"
-PKGV = "1.0+git${GITPKGV}"仍然更新最新

在recipes/libdvdnav/libdvdnav_4.1.3.7.bb 中也可以在SRC_URI中增加tag可以fetch到正确版本
但是屏蔽SRCREV = "850e513d4fea29b40879378b13003cd677e5214b",却在git.fetch.init中得到tag值为bitbake.conf中设置的1
+inherit gitpkgv
+PV = "1.0+git${SRCPV}"
+PKGV = "1.0+git${GITPKGV}"
tag的值仍为1,并不去更新最新的版本

两方面思考:1.每次实验都用的是clean命令,只是删除了工作目录和stamps,并未删除CacheData,造成有些元数据并没有更新
2.PV中的SRCPV=bb.fetch.get_srcrev  如何把这个PV转换成代码中的SRCREV?以及BB文件中的SRCREV和bitbake.conf中的SRCREV优先级关系?
以及pv中 的1.0如何定义?


SVN_fetch过程
fetch.init ->setup_localpath->svn.localpath->latest_revision->svn->_latest_revision
其中在svn.localpath中可以分为读取SRC_URI的参数 rev,data,如果需要读取特定的版本,可以设置这两个变量来读取某个版本或某天的版本
如果都没有则读PV中是否有DATA的值,如果有则读此时。没有则到latest_revision

LANG=C LC_ALL=C /usr/bin/env svn --non-interactive info  https://openpli.svn.sourceforge.net/svnroot/openpli/trunk/external/tuxterm/
察看服务器文件详细信息
 /usr/bin/env svn --non-interactive update -r {20130426}或/usr/bin/env svn --non-interactive update -r 257
更新到某个时间或某个版本

思考:recipes/tremor_svn.bb中PV = "1:0.0+svn${SRCDATE}"设置了读取当前日期,如果想改成读取latest-revision,改成PV = "1:0.0+svn${SRCPV}
得到的tag是1,并不是想要的NONE,所以进一步验证git中的疑惑,这里的REV要清除CACHEDATA。

CVS_FETCH过程
fetch.init ->setup_localpath->svn.localpath
读取SRC_URI的tag,读取SRC_URI带的data,没有则用系统ud.data,如果有tag,清除ud.data  然后得到要解析的path=ud.localfile

cvs '-d:pserver:anoncvs:anoncvs@anoncvs.handhelds.org:/cvs' co -r r0_7 apps/update-rc.d
检出某个rev或data的版本

RROR: ExpansionError during parsing /home/user/Code/Polus/VSB-0812/build-polus-distro/conf/../../layers/meta-qcom-hwe/recipes-edgegateway/parser/parser_0.1.bb Traceback (most recent call last): File "/home/user/Code/Polus/VSB-0812/layers/bitbake/lib/bb/fetch2/__init__.py", line 1248, in srcrev_internal_helper(ud=<bb.fetch2.FetchData object at 0x71058e584820>, d=<bb.data_smart.DataSmart object at 0x71058e6ff220>, name='default'): d.setVar("__BBAUTOREV_ACTED_UPON", True) > srcrev = ud.method.latest_revision(ud, d, name) File "/home/user/Code/Polus/VSB-0812/layers/bitbake/lib/bb/fetch2/__init__.py", line 1670, in Git.latest_revision(ud=<bb.fetch2.FetchData object at 0x71058e584820>, d=<bb.data_smart.DataSmart object at 0x71058e6ff220>, name='default'): except KeyError: > revs[key] = rev = self._latest_revision(ud, d, name) return rev File "/home/user/Code/Polus/VSB-0812/layers/bitbake/lib/bb/fetch2/git.py", line 850, in Git._latest_revision(ud=<bb.fetch2.FetchData object at 0x71058e584820>, d=<bb.data_smart.DataSmart object at 0x71058e6ff220>, name='default'): > output = self._lsremote(ud, d, "") # Tags of the form ^{} may not work, need to fallback to other form File "/home/user/Code/Polus/VSB-0812/layers/bitbake/lib/bb/fetch2/git.py", line 833, in Git._lsremote(ud=<bb.fetch2.FetchData object at 0x71058e584820>, d=<bb.data_smart.DataSmart object at 0x71058e6ff220>, search=''): bb.fetch2.check_network_access(d, cmd, repourl) > output = runfetchcmd(cmd, d, True) if not output: File "/home/user/Code/Polus/VSB-0812/layers/bitbake/lib/bb/fetch2/__init__.py", line 960, in runfetchcmd(cmd='export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/Code/Polus/VSB-0812/layers/openembedded-core/scripts:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin/aarch64-qcom-linux:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot/usr/bin/crossscripts:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/sbin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/sbin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/bin:/home/user/Code/Polus/VSB-0812/layers/bitbake/bin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/hosttools"; export HOME="/home/user"; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all ls-remote https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/edgegateway.git ', d=<bb.data_smart.DataSmart object at 0x71058e6ff220>, quiet=True, cleanup=[], log=None, workdir=None): > raise FetchError(error_message) bb.data_smart.ExpansionError: Failure expanding variable fetcher_hashes_dummyfunc[vardepvalue], expression was ${@bb.fetch.get_hashvalue(d)} which triggered exception FetchError: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/Code/Polus/VSB-0812/layers/openembedded-core/scripts:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin/aarch64-qcom-linux:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot/usr/bin/crossscripts:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/sbin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/sbin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/bin:/home/user/Code/Polus/VSB-0812/layers/bitbake/bin:/home/user/Code/Polus/VSB-0812/build-polus-distro/tmp-glibc/hosttools"; export HOME="/home/user"; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all ls-remote https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/edgegateway.git failed with exit code 126, output: /home/user/.pyenv/libexec/pyenv: line 138: /home/user/.pyenv/libexec/pyenv-exec: Argument list too long The variable dependency chain for the failure is: fetcher_hashes_dummyfunc[vardepvalue] ERROR: Parsing halted due to errors, see error messages above
08-15
NOTE: Executing Tasks NOTE: Setscene tasks completed ERROR: gnu-config-native-20181128+gitAUTOINC+058639be22-r0 do_unpack: Unpack failure for URL: 'git://git.savannah.gnu.org/config.git'. No up to date source found: clone directory not available or not up to date: /home/bstos/build/../downloads/git2/git.savannah.gnu.org.config.git; shallow clone not enabled ERROR: gnu-config-native-20181128+gitAUTOINC+058639be22-r0 do_unpack: ERROR: gnu-config-native-20181128+gitAUTOINC+058639be22-r0 do_unpack: Function failed: base_do_unpack ERROR: Logfile of failure stored in: /home/bstos/build/tmp/work/x86_64-linux/gnu-config-native/20181128+gitAUTOINC+058639be22-r0/temp/log.do_unpack.2004 ERROR: Task (virtual:native:/home/bstos/openembedded-core/meta/recipes-devtools/gnu-config/gnu-config_git.bb:do_unpack) failed with exit code '1' ERROR: pseudo-native-1.9.0+gitAUTOINC+3fa7c853e0-r0 do_unpack: Unpack failure for URL: 'git://git.yoctoproject.org/pseudo'. No up to date source found: clone directory not available or not up to date: /home/bstos/build/../downloads/git2/git.yoctoproject.org.pseudo; shallow clone not enabled ERROR: pseudo-native-1.9.0+gitAUTOINC+3fa7c853e0-r0 do_unpack: ERROR: pseudo-native-1.9.0+gitAUTOINC+3fa7c853e0-r0 do_unpack: Function failed: base_do_unpack ERROR: Logfile of failure stored in: /home/bstos/build/tmp/work/x86_64-linux/pseudo-native/1.9.0+gitAUTOINC+3fa7c853e0-r0/temp/log.do_unpack.2008 ERROR: Task (virtual:native:/home/bstos/openembedded-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_unpack) failed with exit code '1'
09-29
ERROR: ExpansionError during parsing /home/user/Code/Polus/VSB-0804/build-polus-distro/conf/../../layers/meta-qcom-hwe/recipes-edgegateway/parser/parser_0.1.bb Traceback (most recent call last): File "/home/user/Code/Polus/VSB-0804/layers/bitbake/lib/bb/fetch2/__init__.py", line 1248, in srcrev_internal_helper(ud=<bb.fetch2.FetchData object at 0x77a5943b6830>, d=<bb.data_smart.DataSmart object at 0x77a594e28220>, name='default'): d.setVar("__BBAUTOREV_ACTED_UPON", True) > srcrev = ud.method.latest_revision(ud, d, name) File "/home/user/Code/Polus/VSB-0804/layers/bitbake/lib/bb/fetch2/__init__.py", line 1670, in Git.latest_revision(ud=<bb.fetch2.FetchData object at 0x77a5943b6830>, d=<bb.data_smart.DataSmart object at 0x77a594e28220>, name='default'): except KeyError: > revs[key] = rev = self._latest_revision(ud, d, name) return rev File "/home/user/Code/Polus/VSB-0804/layers/bitbake/lib/bb/fetch2/git.py", line 850, in Git._latest_revision(ud=<bb.fetch2.FetchData object at 0x77a5943b6830>, d=<bb.data_smart.DataSmart object at 0x77a594e28220>, name='default'): > output = self._lsremote(ud, d, "") # Tags of the form ^{} may not work, need to fallback to other form File "/home/user/Code/Polus/VSB-0804/layers/bitbake/lib/bb/fetch2/git.py", line 833, in Git._lsremote(ud=<bb.fetch2.FetchData object at 0x77a5943b6830>, d=<bb.data_smart.DataSmart object at 0x77a594e28220>, search=''): bb.fetch2.check_network_access(d, cmd, repourl) > output = runfetchcmd(cmd, d, True) if not output: File "/home/user/Code/Polus/VSB-0804/layers/bitbake/lib/bb/fetch2/__init__.py", line 960, in runfetchcmd(cmd='export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/Code/Polus/VSB-0804/layers/openembedded-core/scripts:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin/aarch64-qcom-linux:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot/usr/bin/crossscripts:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/sbin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/sbin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/bin:/home/user/Code/Polus/VSB-0804/layers/bitbake/bin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/hosttools"; export HOME="/home/user"; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all ls-remote https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/edgegateway.git ', d=<bb.data_smart.DataSmart object at 0x77a594e28220>, quiet=True, cleanup=[], log=None, workdir=None): > raise FetchError(error_message) bb.data_smart.ExpansionError: Failure expanding variable fetcher_hashes_dummyfunc[vardepvalue], expression was ${@bb.fetch.get_hashvalue(d)} which triggered exception FetchError: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/Code/Polus/VSB-0804/layers/openembedded-core/scripts:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin/aarch64-qcom-linux:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot/usr/bin/crossscripts:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/sbin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/usr/bin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/sbin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/work/armv8-2a-qcom-linux/parser/0.1/recipe-sysroot-native/bin:/home/user/Code/Polus/VSB-0804/layers/bitbake/bin:/home/user/Code/Polus/VSB-0804/build-polus-distro/tmp-qcom-guestvm-glibc/hosttools"; export HOME="/home/user"; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all ls-remote https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/edgegateway.git failed with exit code 126, output: /home/user/.pyenv/libexec/pyenv: line 138: /home/user/.pyenv/libexec/pyenv-exec: Argument list too long The variable dependency chain for the failure is: fetcher_hashes_dummyfunc[vardepvalue] ERROR: Parsing halted due to errors, see error messages above
08-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值