mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2026-01-27 11:01:24 +01:00
utils/shared-repo-unpack: Create common mkdir function and fix shared-repo-unpack to create directory to rsync to
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
806957b392
commit
f79fab19a1
|
|
@ -40,12 +40,7 @@ if os.path.exists(autoconf):
|
|||
os.remove(autoconf)
|
||||
|
||||
# Ensure autoconf's directory exists
|
||||
try:
|
||||
os.makedirs(os.path.dirname(autoconf))
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
# Do not complain if the directory exists
|
||||
raise e
|
||||
utils.mkdir(os.path.dirname(autoconf))
|
||||
|
||||
sdkextraconf = os.path.join(builddir, "conf", "sdk-extra.conf")
|
||||
if os.path.exists(sdkextraconf):
|
||||
|
|
|
|||
|
|
@ -37,9 +37,11 @@ with open(repojson) as f:
|
|||
for repo in sorted(repos.keys()):
|
||||
if repo not in needrepos:
|
||||
continue
|
||||
targetrepodir = "%s/%s" % (targetdir, repo)
|
||||
if shared:
|
||||
utils.printheader("Copying in repo %s" % repo)
|
||||
subprocess.check_call(["rsync", "-a", "%s/%s" % (shared, repo), "%s/%s" % (targetdir, repo)])
|
||||
utils.mkdir(targetrepodir)
|
||||
subprocess.check_call(["rsync", "-a", "%s/%s" % (shared, repo), targetrepodir])
|
||||
else:
|
||||
utils.printheader("Fetching repo %s" % repo)
|
||||
utils.fetchgitrepo(targetdir, repo, repos[repo], stashdir)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import subprocess
|
|||
import copy
|
||||
import os
|
||||
import json
|
||||
import errno
|
||||
|
||||
#
|
||||
# Check if config contains all the listed params
|
||||
|
|
@ -101,6 +102,15 @@ def fetchgitrepo(clonedir, repo, params, stashdir):
|
|||
subprocess.check_call(["git", "checkout", branch], cwd=sharedrepo)
|
||||
subprocess.check_call(["git", "reset", revision, "--hard"], cwd=sharedrepo)
|
||||
|
||||
|
||||
def mkdir(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
# Do not complain if the directory exists
|
||||
raise e
|
||||
|
||||
def printheader(msg):
|
||||
print("")
|
||||
print("====================================================================================================")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user