Skip to content

Commit

Permalink
Support new docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Oct 25, 2020
1 parent 231ee2b commit 9e0bd7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions alibuild_helpers/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def doBuild(args, parser):

# Clone/update repos
for p in [p for p in buildOrder if "source" in specs[p]]:
updateReferenceRepoSpec(args.referenceSources, p, specs[p], args.fetchRepos)
updateReferenceRepoSpec(args.referenceSources, p, specs[p], args.fetchRepos, not args.docker)

# Retrieve git heads
cmd = "git ls-remote --heads %s" % (specs[p].get("reference", specs[p]["source"]))
Expand Down Expand Up @@ -938,7 +938,7 @@ def doBuild(args, parser):
referenceStatement = "export GIT_REFERENCE=${GIT_REFERENCE_OVERRIDE:-%s}/%s" % (dirname(spec["reference"]), basename(spec["reference"]))

partialCloneStatement = ""
if partialCloneFilter:
if partialCloneFilter and not args.docker:
partialCloneStatement = "export GIT_PARTIAL_CLONE_FILTER='--filter=blob:none'"

debug(spec)
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def doBuild(args, parser):
additionalEnv += " -e %s='%s' " % env
for volume in args.volumes:
additionalVolumes += " -v %s " % volume
dockerWrapper = format("docker run --rm -it"
dockerWrapper = format("docker run --rm"
" --user $(id -u):$(id -g)"
" -v %(workdir)s:/sw"
" -v %(scriptDir)s/build.sh:/build.sh:ro"
Expand All @@ -1057,7 +1057,7 @@ def doBuild(args, parser):
" %(overrideSource)s"
" -e WORK_DIR_OVERRIDE=/sw"
" %(image)s"
" %(bash)s -e -x /build.sh",
" -c \"%(bash)s -e -x /build.sh\"",
additionalEnv=additionalEnv,
additionalVolumes=additionalVolumes,
bash=BASH,
Expand Down
8 changes: 4 additions & 4 deletions alibuild_helpers/workarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
except ImportError:
from ordereddict import OrderedDict

def updateReferenceRepoSpec(referenceSources, p, spec, fetch):
def updateReferenceRepoSpec(referenceSources, p, spec, fetch, usePartialClone=True):
"""
Update source reference area whenever possible, and set the spec's "reference"
if available for reading.
Expand All @@ -26,11 +26,11 @@ def updateReferenceRepoSpec(referenceSources, p, spec, fetch):
@spec : the spec of the package to be updated (an OrderedDict)
@fetch : whether to fetch updates: if False, only clone if not found
"""
spec["reference"] = updateReferenceRepo(referenceSources, p, spec, fetch)
spec["reference"] = updateReferenceRepo(referenceSources, p, spec, fetch, usePartialClone)
if not spec["reference"]:
del spec["reference"]

def updateReferenceRepo(referenceSources, p, spec, fetch=True):
def updateReferenceRepo(referenceSources, p, spec, fetch=True, usePartialClone=True):
"""
Update source reference area, if possible.
If the area is already there and cannot be written, assume it maintained
Expand Down Expand Up @@ -69,7 +69,7 @@ def updateReferenceRepo(referenceSources, p, spec, fetch=True):

err = False
if not path.exists(referenceRepo):
cmd = ["git", "clone", partialCloneFilter, "--bare", spec["source"], referenceRepo]
cmd = ["git", "clone"] + (usePartialClone and [partialCloneFilter] or []) + ["--bare", spec["source"], referenceRepo]
cmd = [x for x in cmd if x]
debug("Cloning reference repository: %s" % " ".join(cmd))
err = execute(cmd)
Expand Down

0 comments on commit 9e0bd7a

Please sign in to comment.