Skip to content

Commit

Permalink
Revert "initial handling of Manifest"
Browse files Browse the repository at this point in the history
This reverts commit 09e0e5b.
  • Loading branch information
apprehensions committed Nov 3, 2023
1 parent 09e0e5b commit ad30359
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 138 deletions.
43 changes: 7 additions & 36 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (b *Binary) Install() error {
return err
}

pm, err := bootstrapper.FetchPackageManifest(&b.Version)
manifest, err := bootstrapper.FetchPackageManifest(&b.Version)
if err != nil {
return err
}
Expand All @@ -280,22 +280,12 @@ func (b *Binary) Install() error {
}

b.Splash.SetMessage("Downloading " + b.Alias)
if err := b.DownloadPackages(&pm); err != nil {
if err := b.DownloadPackages(&manifest); err != nil {
return err
}

b.Splash.SetMessage("Extracting " + b.Alias)
if err := b.ExtractPackages(&pm); err != nil {
return err
}

m, err := bootstrapper.FetchManifest(&b.Version)
if err != nil {
return err
}

b.Splash.SetMessage("Verifying " + b.Alias)
if err := b.VerifyFiles(m); err != nil {
if err := b.ExtractPackages(&manifest); err != nil {
return err
}

Expand All @@ -312,7 +302,7 @@ func (b *Binary) Install() error {
return err
}

if err := state.SavePackageManifest(&pm); err != nil {
if err := state.SavePackageManifest(&manifest); err != nil {
return err
}

Expand All @@ -324,7 +314,7 @@ func (b *Binary) Install() error {
}

func (b *Binary) PerformPackages(pm *bootstrapper.PackageManifest, fn func(bootstrapper.Package) error) error {
pkgsDone := 0
donePkgs := 0
pkgsLen := len(pm.Packages)

return pm.Packages.Perform(func(pkg bootstrapper.Package) error {
Expand All @@ -333,8 +323,8 @@ func (b *Binary) PerformPackages(pm *bootstrapper.PackageManifest, fn func(boots
return err
}

pkgsDone++
b.Splash.SetProgress(float32(pkgsDone) / float32(pkgsLen))
donePkgs++
b.Splash.SetProgress(float32(donePkgs) / float32(pkgsLen))

return nil
})
Expand Down Expand Up @@ -363,25 +353,6 @@ func (b *Binary) ExtractPackages(pm *bootstrapper.PackageManifest) error {
})
}

func (b *Binary) VerifyFiles(m bootstrapper.Manifest) error {
filesLen := len(m)
filesDone := 0

log.Printf("Verifying %d files", filesLen)

for _, f := range m {
err := util.VerifyFileMD5(filepath.Join(b.Dir, f.Path), f.Checksum)
if err != nil {
return err
}

filesDone++
b.Splash.SetProgress(float32(filesDone) / float32(filesLen))
}

return nil
}

func (b *Binary) SetupDxvk() error {
ver, err := state.DxvkVersion()
if err != nil {
Expand Down
65 changes: 0 additions & 65 deletions roblox/bootstrapper/manifest.go

This file was deleted.

37 changes: 0 additions & 37 deletions roblox/bootstrapper/manifest_test.go

This file was deleted.

0 comments on commit ad30359

Please sign in to comment.