Revert "Make files hash a type for proper JSON serialization"

This reverts commit e138212593.
This commit is contained in:
Andrey Smirnov
2015-02-05 00:27:14 +03:00
parent 3f6491b8a3
commit 8e8ff8ba65
+2 -8
View File
@@ -9,8 +9,6 @@ import (
"strings" "strings"
) )
type Hash uint64
// Package is single instance of Debian package // Package is single instance of Debian package
type Package struct { type Package struct {
// Basic package properties // Basic package properties
@@ -29,7 +27,7 @@ type Package struct {
// Is this udeb package // Is this udeb package
IsUdeb bool IsUdeb bool
// Hash of files section // Hash of files section
FilesHash Hash FilesHash uint64
// Is this >= 0.6 package? // Is this >= 0.6 package?
V06Plus bool V06Plus bool
// Offload fields // Offload fields
@@ -40,10 +38,6 @@ type Package struct {
collection *PackageCollection collection *PackageCollection
} }
func (h *Hash) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%08x\"", *h)), nil
}
// NewPackageFromControlFile creates Package from parsed Debian control file // NewPackageFromControlFile creates Package from parsed Debian control file
func NewPackageFromControlFile(input Stanza) *Package { func NewPackageFromControlFile(input Stanza) *Package {
result := &Package{ result := &Package{
@@ -404,7 +398,7 @@ func (p *Package) Files() PackageFiles {
// UpdateFiles saves new state of files // UpdateFiles saves new state of files
func (p *Package) UpdateFiles(files PackageFiles) { func (p *Package) UpdateFiles(files PackageFiles) {
p.files = &files p.files = &files
p.FilesHash = Hash(files.Hash()) p.FilesHash = files.Hash()
} }
// Stanza creates original stanza from package // Stanza creates original stanza from package