From 0833d78511288674d68e41244d136dd2fd63d9be Mon Sep 17 00:00:00 2001 From: Nick Graczyk Date: Tue, 14 Aug 2018 17:42:32 -0700 Subject: [PATCH 1/2] Correct regex used to match GVFS-aware Git package to actually match the NuGet spec for what defines a package --- Scripts/Mac/BuildGVFSForMac.sh | 2 +- Scripts/Mac/DownloadGVFSGit.sh | 2 +- Scripts/Mac/PrepFunctionalTests.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Mac/BuildGVFSForMac.sh b/Scripts/Mac/BuildGVFSForMac.sh index 5078f9cb06..c624260435 100755 --- a/Scripts/Mac/BuildGVFSForMac.sh +++ b/Scripts/Mac/BuildGVFSForMac.sh @@ -34,7 +34,7 @@ fi $SCRIPTDIR/DownloadGVFSGit.sh || exit 1 GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')" +GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" GITPATH="$(find $PACKAGES/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1 # Now that we have a path containing the version number, generate GVFSConstants.GitVersion.cs $SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1 diff --git a/Scripts/Mac/DownloadGVFSGit.sh b/Scripts/Mac/DownloadGVFSGit.sh index 3d1ced9c96..4ca725b9ed 100755 --- a/Scripts/Mac/DownloadGVFSGit.sh +++ b/Scripts/Mac/DownloadGVFSGit.sh @@ -3,7 +3,7 @@ SRCDIR=$SCRIPTDIR/../.. BUILDDIR=$SRCDIR/../BuildOutput/GVFS.Build PACKAGESDIR=$SRCDIR/../packages GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')" +GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" cp $SRCDIR/nuget.config $BUILDDIR dotnet new classlib -n GVFS.Restore -o $BUILDDIR --force dotnet add $BUILDDIR/GVFS.Restore.csproj package --package-directory $PACKAGESDIR GitForMac.GVFS.Installer --version $GITVERSION \ No newline at end of file diff --git a/Scripts/Mac/PrepFunctionalTests.sh b/Scripts/Mac/PrepFunctionalTests.sh index d7ef9b2b17..f1eca52487 100755 --- a/Scripts/Mac/PrepFunctionalTests.sh +++ b/Scripts/Mac/PrepFunctionalTests.sh @@ -4,7 +4,7 @@ SCRIPTDIR=$(dirname ${BASH_SOURCE[0]}) # Install GVFS-aware Git (that was downloaded by the build script) GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')" +GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" ROOTDIR=$SCRIPTDIR/../../.. GITDIR=$ROOTDIR/packages/gitformac.gvfs.installer/$GITVERSION/tools if [[ ! -d $GITDIR ]]; then From 5db30b34ce6c6adf4eb376869dab59eda7bb012d Mon Sep 17 00:00:00 2001 From: Nick Graczyk Date: Wed, 15 Aug 2018 17:00:04 -0700 Subject: [PATCH 2/2] Rework Git version parsing into a single script --- Scripts/Mac/BuildGVFSForMac.sh | 3 +-- Scripts/Mac/DownloadGVFSGit.sh | 3 +-- Scripts/Mac/GetGitVersionNumber.sh | 4 ++++ Scripts/Mac/PrepFunctionalTests.sh | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100755 Scripts/Mac/GetGitVersionNumber.sh diff --git a/Scripts/Mac/BuildGVFSForMac.sh b/Scripts/Mac/BuildGVFSForMac.sh index c624260435..2eb875c777 100755 --- a/Scripts/Mac/BuildGVFSForMac.sh +++ b/Scripts/Mac/BuildGVFSForMac.sh @@ -33,8 +33,7 @@ if [ ! -d $BUILDDIR ]; then fi $SCRIPTDIR/DownloadGVFSGit.sh || exit 1 -GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" +GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)" GITPATH="$(find $PACKAGES/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1 # Now that we have a path containing the version number, generate GVFSConstants.GitVersion.cs $SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1 diff --git a/Scripts/Mac/DownloadGVFSGit.sh b/Scripts/Mac/DownloadGVFSGit.sh index 4ca725b9ed..74f8bc5282 100755 --- a/Scripts/Mac/DownloadGVFSGit.sh +++ b/Scripts/Mac/DownloadGVFSGit.sh @@ -2,8 +2,7 @@ SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" SRCDIR=$SCRIPTDIR/../.. BUILDDIR=$SRCDIR/../BuildOutput/GVFS.Build PACKAGESDIR=$SRCDIR/../packages -GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" +GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)" cp $SRCDIR/nuget.config $BUILDDIR dotnet new classlib -n GVFS.Restore -o $BUILDDIR --force dotnet add $BUILDDIR/GVFS.Restore.csproj package --package-directory $PACKAGESDIR GitForMac.GVFS.Installer --version $GITVERSION \ No newline at end of file diff --git a/Scripts/Mac/GetGitVersionNumber.sh b/Scripts/Mac/GetGitVersionNumber.sh new file mode 100755 index 0000000000..6942b3a426 --- /dev/null +++ b/Scripts/Mac/GetGitVersionNumber.sh @@ -0,0 +1,4 @@ +SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" +GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props +GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" +echo $GITVERSION \ No newline at end of file diff --git a/Scripts/Mac/PrepFunctionalTests.sh b/Scripts/Mac/PrepFunctionalTests.sh index f1eca52487..f1a0c4260d 100755 --- a/Scripts/Mac/PrepFunctionalTests.sh +++ b/Scripts/Mac/PrepFunctionalTests.sh @@ -3,8 +3,7 @@ SCRIPTDIR=$(dirname ${BASH_SOURCE[0]}) # Install GVFS-aware Git (that was downloaded by the build script) -GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props -GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" +GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)" ROOTDIR=$SCRIPTDIR/../../.. GITDIR=$ROOTDIR/packages/gitformac.gvfs.installer/$GITVERSION/tools if [[ ! -d $GITDIR ]]; then