Browse Source

Merge pull request #292 from harishsk/TFRedistMigration

Fixed behavior of UpdateSHA
tags/v0.10
Haiping GitHub 6 years ago
parent
commit
3c266fbfc5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj

+ 8
- 9
src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj View File

@@ -102,27 +102,26 @@
ItemName="FilesWithHashes" /> ItemName="FilesWithHashes" />
</GetFileHash> </GetFileHash>


<Message Importance="High"
Text="%(FilesWithHashes.Identity): %(FilesWithHashes.FileHash)" />
<WriteLinesToFile File="%(FilesWithHashes.Identity).sha" Lines="%(FilesWithHashes.FileHash)" Overwrite="true"/>

<!-- If specified we'll update the checked in SHAs with the downloaded ones. -->
<Copy Condition="'$(UpdateSHA)' == 'true'"
SourceFiles="@(TensorFlowArchive->'%(DownloadShaFile)')"
DestinationFiles="@(TensorFlowArchive->'%(LocalShaFile)')" />


<ItemGroup> <ItemGroup>
<TensorFlowArchive> <TensorFlowArchive>
<DownloadSha>@(FilesWithHashes->'%(FileHash)')</DownloadSha> <DownloadSha>@(FilesWithHashes->'%(FileHash)')</DownloadSha>
<LocalSha>$([System.IO.File]::ReadAllText('%(LocalShaFile)'))</LocalSha>
<LocalSha>$([System.IO.File]::ReadAllText('%(LocalShaFile)').Replace("%0A", "").Replace("%0D", ""))</LocalSha>
</TensorFlowArchive> </TensorFlowArchive>
</ItemGroup> </ItemGroup>


<!-- If specified we'll update the checked in SHAs with the downloaded ones. -->
<!--<WriteLinesToFile Condition="'$(UpdateSHA)' == 'true'"
File="@(TensorFlowArchive->'%(LocalShaFile)')"
Lines="@(TensorFlowArchive->'%(LocalShaFile)')" />-->

<Error Condition="!Exists('%(TensorFlowArchive.LocalShaFile)')" Text="SHA file '%(TensorFlowArchive.LocalShaFile)' does not exist. Build with /p:UpdateSHA=true to save it." /> <Error Condition="!Exists('%(TensorFlowArchive.LocalShaFile)')" Text="SHA file '%(TensorFlowArchive.LocalShaFile)' does not exist. Build with /p:UpdateSHA=true to save it." />


<Message Importance="High" Text="@TensorFlowArchive->'%(TensorFlowArchive.DownloadFile) - %(TensorFlowArchive.LocalSha) - %(TensorFlowArchive.DownloadSha)"/> <Message Importance="High" Text="@TensorFlowArchive->'%(TensorFlowArchive.DownloadFile) - %(TensorFlowArchive.LocalSha) - %(TensorFlowArchive.DownloadSha)"/>


<!-- Validate that the downloaded SHAs match the expected checked in SHAs --> <!-- Validate that the downloaded SHAs match the expected checked in SHAs -->
<Error Condition="'%(TensorFlowArchive.LocalSha)' != '%(TensorFlowArchive.DownloadSha)'" Text="Downloaded file '%(TensorFlowArchive.DownloadFile)' has unexpected SHA.%0A expected: %(_downloadedTensorFlowArchive.LocalSha)%0A actual: %(_downloadedTensorFlowArchive.DownloadSha)%0ABuild with /p:UpdateSHA=true if you intentionally changed the URL and wish to update the SHAs, otherwise this could indicate an incomplete download or intercerpted URL and should be examined." />
<Error Condition="'%(TensorFlowArchive.LocalSha)' != '%(TensorFlowArchive.DownloadSha)'" Text="Downloaded file '%(TensorFlowArchive.DownloadFile)' has unexpected SHA.%0A expected: %(TensorFlowArchive.LocalSha)%0A --actual: %(TensorFlowArchive.DownloadSha)%0ABuild with /p:UpdateSHA=true if you intentionally changed the URL and wish to update the SHAs, otherwise this could indicate an incomplete download or intercerpted URL and should be examined." />




<!-- The archives are valid, lets extract them, ensuring an empty directory --> <!-- The archives are valid, lets extract them, ensuring an empty directory -->


Loading…
Cancel
Save