Small fixes to update-dependencies.

Fix stage0 location to be the same as build.

Fix ReplaceDependencyVersion to only mark IsUpdated = true when the version was actually updated.

Point to core-setup/release/1.0.0.
This commit is contained in:
Eric Erhardt 2016-06-02 14:08:39 -05:00
parent a58d780962
commit 74a9594634
3 changed files with 24 additions and 8 deletions

View file

@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Scripts
/// The following Environment Variables can optionally be specified:
///
/// COREFX_VERSION_URL - The Url to get the current CoreFx package versions. (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/release/1.0.0/Latest_Packages.txt")
/// CORESETUP_VERSION_URL - The Url to get the current dotnet/core-setup package versions. (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/core-setup/master/Latest_Packages.txt")
/// CORESETUP_VERSION_URL - The Url to get the current dotnet/core-setup package versions. (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/core-setup/release/1.0.0/Latest_Packages.txt")
/// GITHUB_ORIGIN_OWNER - The owner of the GitHub fork to push the commit and create the PR from. (ex. "dotnet-bot")
/// GITHUB_UPSTREAM_OWNER - The owner of the GitHub base repo to create the PR to. (ex. "dotnet")
/// GITHUB_PROJECT - The repo name under the ORIGIN and UPSTREAM owners. (ex. "cli")
@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Scripts
private Lazy<string> _password = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PASSWORD"));
private Lazy<string> _coreFxVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("COREFX_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/release/1.0.0/Latest_Packages.txt"));
private Lazy<string> _coreSetupVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("CORESETUP_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/core-setup/master/Latest_Packages.txt"));
private Lazy<string> _coreSetupVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("CORESETUP_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/core-setup/release/1.0.0/Latest_Packages.txt"));
private Lazy<string> _gitHubOriginOwner;
private Lazy<string> _gitHubUpstreamOwner = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet"));
private Lazy<string> _gitHubProject = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli"));

View file

@ -139,19 +139,33 @@ namespace Microsoft.DotNet.Scripts
{
if (id == packageInfo.Id)
{
string oldVersion;
if (dependencyProperty.Value is JObject)
{
dependencyProperty.Value["version"] = packageInfo.Version.ToNormalizedString();
oldVersion = (string)dependencyProperty.Value["version"];
}
else
{
dependencyProperty.Value = packageInfo.Version.ToNormalizedString();
oldVersion = (string)dependencyProperty.Value;
}
// mark the DependencyInfo as updated so we can tell which dependencies were updated
dependencyInfo.IsUpdated = true;
string newVersion = packageInfo.Version.ToNormalizedString();
if (oldVersion != newVersion)
{
if (dependencyProperty.Value is JObject)
{
dependencyProperty.Value["version"] = newVersion;
}
else
{
dependencyProperty.Value = newVersion;
}
return true;
// mark the DependencyInfo as updated so we can tell which dependencies were updated
dependencyInfo.IsUpdated = true;
return true;
}
}
}
}

View file

@ -17,6 +17,8 @@ if($Help)
exit 0
}
$Architecture='x64'
$RepoRoot = "$PSScriptRoot\..\.."
$AppPath = "$PSScriptRoot"
@ -28,7 +30,7 @@ if (!$env:DOTNET_INSTALL_DIR)
# Install a stage 0
Write-Host "Installing .NET Core CLI Stage 0"
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Architecture x64
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Architecture $Architecture
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
# Put the stage0 on the path