poky/scripts/lib/devtool
Roland Hieber a6c9ee99b3 devtool: make sure .git/info exists before writing to .git/info/excludes
If nothing else is specified, 'git init' uses its default repository
template from the install location (e.g. /usr/share/git-core/templates),
which already includes an info/ subdirectory. However, when setting
init.templateDir to a different template path in ~/.gitconfig, this
isn't necessarily the case, and it can lead to setup_git_repo() failing
with stack traces like:

    File: '.../scripts/lib/devtool/__init__.py', lineno: 234, function: setup_git_repo
         0230:        pass
         0231:    if 'singletask.lock\n' not in excludes:
         0232:        excludes.append('singletask.lock\n')
         0233:    bb.warn("try writing excludefile")
     *** 0234:    with open(excludefile, 'w') as f:
         0235:        for line in excludes:
         0236:            f.write(line)
         0237:
         0238:    bb.process.run('git checkout -b %s' % devbranch, cwd=repodir)
    Exception: FileNotFoundError: [Errno 2] No such file or directory: '.../devtooltmp-6m36b181/workdir/foobar-1.0.1/.git/info/exclude'

Fix this edge case by creating the .git/info/ directory first.

Fixes: 334ba846c795fc0d8c73 (2018-02-01, "devtool: set up git repos so that singletask.lock is ignored")
(From OE-Core rev: 148a23e4d5ceaf655ccacb52deca4ba501f12975)

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-17 12:34:29 +01:00
..
__init__.py devtool: make sure .git/info exists before writing to .git/info/excludes 2020-10-17 12:34:29 +01:00
build_image.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
build_sdk.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
build.py devtool: build: Also run deploy for devtool build if applicable 2019-08-21 21:52:59 +01:00
deploy.py devtool: deploy-target: Fix size calculation for hard links 2020-09-02 16:00:46 +01:00
export.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
import.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
menuconfig.py devtool: provide support for devtool menuconfig command 2019-07-17 09:36:34 +01:00
package.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
runqemu.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
sdk.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
search.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
standard.py devtool: remove unused variable 2020-10-08 08:08:32 +01:00
upgrade.py devtool: default to empty string, if LIC_FILES_CHKSUM is not available 2020-07-08 10:37:12 +01:00
utilcmds.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00