swupd: Clean up unused code

This function has not been used for a long time and can
be misleading when making updates. Dropping.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This commit is contained in:
Mark D Horn
2019-10-08 15:22:26 -07:00
committed by Mark Horn
parent e482042355
commit 372ed41da7
-83
View File
@@ -279,89 +279,6 @@ func (s *SoftwareUpdater) GetStateDir() string {
return s.stateDir
}
// Verify runs "swupd verify" operation
func (s *SoftwareUpdater) Verify(version string, mirror string, verifyOnly bool) error {
args := []string{
"swupd",
"verify",
}
args = s.setExtraFlags(args)
if mirror != "" {
args = append(args, fmt.Sprintf("--url=%s", mirror))
}
args = append(args,
[]string{
fmt.Sprintf("--path=%s", s.rootDir),
fmt.Sprintf("--statedir=%s", s.stateDir),
"--install",
"-m",
version,
"--force",
"--no-scripts",
}...)
err := cmd.RunAndLog(args...)
if err != nil {
return errors.Wrap(err)
}
if mirror != "" {
args = []string{
"swupd",
"mirror",
fmt.Sprintf("--path=%s", s.rootDir),
"--set",
mirror,
}
if s.allowInsecureHTTP {
args = append(args, "--allow-insecure-http")
}
err = cmd.RunAndLog(args...)
if err != nil {
return errors.Wrap(err)
}
}
if verifyOnly {
return nil
}
args = []string{
"swupd",
"bundle-add",
}
if s.skipDiskSpaceCheck {
args = append(args, "--skip-diskspace-check")
}
args = s.setExtraFlags(args)
args = append(args,
fmt.Sprintf("--path=%s", s.rootDir),
fmt.Sprintf("--statedir=%s", s.stateDir),
)
// Remove the 'os-core' bundle as it is already
// installed and will cause a failure
for _, bundle := range CoreBundles {
if bundle != "os-core" {
args = append(args, bundle)
}
}
err = cmd.RunAndLog(args...)
if err != nil {
return errors.Wrap(err)
}
return nil
}
// OSInstall runs "swupd os-install" operation with a bundle list
func (s *SoftwareUpdater) OSInstall(version, printPrefix string, bundles []string) error {
args := []string{