Skip to content
Snippets Groups Projects
Commit 1b28a4bf authored by ATLAS Robot's avatar ATLAS Robot Committed by Christian Gumpert
Browse files

handle already existing source directories

The build scripts were failing when executed twice with the same
build directory. Re-using previous builds is essential for
incremental builds.


Former-commit-id: 534656e7
parent 2706425d
No related merge requests found
...@@ -62,12 +62,17 @@ if [ "$HASHFILE" != "" ]; then ...@@ -62,12 +62,17 @@ if [ "$HASHFILE" != "" ]; then
echo "Writing the commit hash into file: $HASHFILE" echo "Writing the commit hash into file: $HASHFILE"
fi fi
# Clone the repository: if [ ! -d "${SOURCEDIR}" ]; then
git clone https://gitlab.cern.ch/atlas/Gaudi.git \ # Clone the repository:
git clone https://gitlab.cern.ch/atlas/Gaudi.git \
${SOURCEDIR} ${SOURCEDIR}
else
echo "${SOURCEDIR} already exists -> assume previous checkout"
fi
# Get the appropriate tag of it: # Get the appropriate tag of it:
cd ${SOURCEDIR} cd ${SOURCEDIR}
git fetch origin
git checkout ${TAGBRANCH} git checkout ${TAGBRANCH}
# If an output file was not specified, stop here: # If an output file was not specified, stop here:
......
...@@ -67,11 +67,16 @@ if [ "$HASHFILE" != "" ]; then ...@@ -67,11 +67,16 @@ if [ "$HASHFILE" != "" ]; then
echo "Writing the commit hash into file: $HASHFILE" echo "Writing the commit hash into file: $HASHFILE"
fi fi
# Clone the repository: if [ ! -d "${SOURCEDIR}" ]; then
git clone ${EXTERNALSURL} ${SOURCEDIR} # Clone the repository:
git clone ${EXTERNALSURL} ${SOURCEDIR}
else
echo "${SOURCEDIR} already exists -> assume previous checkout"
fi
# Get the appropriate tag of it: # Get the appropriate tag of it:
cd ${SOURCEDIR} cd ${SOURCEDIR}
git fetch origin
git checkout ${TAGBRANCH} git checkout ${TAGBRANCH}
# If an output file was not specified, stop here: # If an output file was not specified, stop here:
...@@ -81,4 +86,4 @@ fi ...@@ -81,4 +86,4 @@ fi
# Write the hash of whatever we have checked out currently, into the # Write the hash of whatever we have checked out currently, into the
# specified output file: # specified output file:
git rev-parse ${TAGBRANCH} > ${HASHFILE} git rev-parse ${TAGBRANCH} > ${HASHFILE}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment