From 46c2e6ddf79ed1ad0885cbc3bdc0e9b6c75a6ffc Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Mon, 21 Mar 2022 08:13:23 -0500 Subject: [PATCH] Refactor build.sh to optimize PackageVersions.props retrieval (#13443) --- src/SourceBuild/tarball/content/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SourceBuild/tarball/content/build.sh b/src/SourceBuild/tarball/content/build.sh index 8cca086c3..01bf9dedb 100755 --- a/src/SourceBuild/tarball/content/build.sh +++ b/src/SourceBuild/tarball/content/build.sh @@ -114,14 +114,14 @@ restoredPackagesDir="$SCRIPT_ROOT/packages/restored" if [ -d "$SCRIPT_ROOT/packages/archive" ]; then sourceBuiltArchive=`find $SCRIPT_ROOT/packages/archive -maxdepth 1 -name 'Private.SourceBuilt.Artifacts*.tar.gz'` - if [ -f "$sourceBuiltArchive" ]; then + if [ -f "$SCRIPT_ROOT/packages/previously-source-built/PackageVersions.props" ]; then + packageVersionsPath=$SCRIPT_ROOT/packages/previously-source-built/PackageVersions.props + elif [ -f "$sourceBuiltArchive" ]; then tar -xzf "$sourceBuiltArchive" -C /tmp PackageVersions.props packageVersionsPath=/tmp/PackageVersions.props fi -else - if [ -f "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props" ]; then - packageVersionsPath="$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props" - fi +elif [ -f "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props" ]; then + packageVersionsPath="$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props" fi if [ ! -f "$packageVersionsPath" ]; then