Skip to content

Commit

Permalink
(GH-6) WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Dec 18, 2016
1 parent 19986e7 commit e420a57
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Core/Packages/DataServicePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public string Dependencies
set;
}

public string PackageSource { get; set; }
public string PackageHash { get; set; }
public string PackageHashAlgorithm { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/Core/Packages/IChocolateyServerPackageMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public partial interface IServerPackageMetadata
LastUpdated = p.LastUpdated,
*/

string PackageSource { get; }
string PackageHash { get; }
string PackageHashAlgorithm { get; }
long PackageSize { get; }
Expand Down
7 changes: 7 additions & 0 deletions src/Server/DataServices/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public Package(IPackage package, DerivedPackageData derivedData)
PackageHash = derivedData.PackageHash;
PackageHashAlgorithm = "SHA512";
PackageSize = derivedData.PackageSize;
PackageSource = derivedData.PackageSource;
LastUpdated = derivedData.LastUpdated.UtcDateTime;
Published = derivedData.Created.UtcDateTime;
Path = derivedData.Path;
Expand Down Expand Up @@ -224,6 +225,12 @@ public string Dependencies
set;
}

public string PackageSource
{
get;
set;
}

public string PackageHash
{
get;
Expand Down
1 change: 1 addition & 0 deletions src/Server/Infrastructure/DerivedPackageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class DerivedPackageData
{
public long PackageSize { get; set; }
public string PackageHash { get; set; }
public string PackageSource { get; set; }
public DateTimeOffset LastUpdated { get; set; }
public DateTimeOffset Created { get; set; }
public string Path { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Server/Infrastructure/ServerPackageRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ private IDictionary<IPackage, DerivedPackageData> CreateCache()
{
PackageSize = fileLength,
PackageHash = Convert.ToBase64String(hashBytes),
PackageSource = this.Source,
LastUpdated = _fileSystem.GetLastModified(path),
Created = _fileSystem.GetCreated(path),
Path = path,
Expand Down

0 comments on commit e420a57

Please # to comment.