This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore pacakge with unnormalized version
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Microsoft.Framework.Runtime/NuGet/SemanticVersionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace NuGet | ||
{ | ||
public static class SemanticVersionExtensions | ||
{ | ||
/// <summary> | ||
/// Returns true if the original version string is normalized | ||
/// | ||
/// For an installed package, it's original version string represents the folder name | ||
/// contains the pacakge, the path of which is {id}/{version}/. By checking if the | ||
/// package's original version string is normalized, it be prevented from failing the | ||
/// package path resolving because of a miss version string. | ||
/// </summary> | ||
public static bool IsOriginalStringNormalized(this SemanticVersion version) | ||
{ | ||
return version.GetNormalizedVersionString() == version.OriginalString; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters