mirror of
https://github.com/clearlinux/clr-installer.git
synced 2026-09-05 21:21:39 +00:00
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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user