Skip to content

Commit

Permalink
Fixed finishing the packager, improved selfupdate=0
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Aug 25, 2016
1 parent e2040c8 commit 01ea812
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/lib/installation/clients/inst_update_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def main
Installation.finish_restarting!
end

# shortcut - already updated
return :next if installer_updated?
# shortcut - already updated or disabled via boot option
if installer_updated? || disabled_in_linuxrc?
log.info "Self update not needed, skipping"
return :next
end

initialize_progress

Expand All @@ -67,8 +70,6 @@ def main
Yast::Progress.NextStage
end

# initialize packager, we need to load the base product name
# to properly obtain the update URL from the registration server
return :abort unless initialize_packager

# self update disabled or not possible
Expand Down Expand Up @@ -133,14 +134,20 @@ def updates_manager
#
# @return [Boolean] True if it's enabled; false otherwise.
def self_update_enabled?
if Linuxrc.InstallInf("SelfUpdate") == "0" # disabled via Linuxrc
if disabled_in_linuxrc?
log.info("self-update was disabled through Linuxrc")
false
else
initialize_packager
!self_update_urls.empty?
end
end

# disabled via Linuxrc ?
def disabled_in_linuxrc?
Linuxrc.InstallInf("SelfUpdate") == "0"
end

# Return the self-update URLs
#
# @return [Array<URI>] self-update URLs
Expand Down Expand Up @@ -534,6 +541,7 @@ def finish_packager
# false = all repositories, even the disabled ones
Pkg.SourceGetCurrent(false).each { |r| Pkg.SourceDelete(r) }
Pkg.SourceSaveAll
Pkg.SourceFinishAll
Pkg.TargetFinish
end

Expand Down

0 comments on commit 01ea812

Please sign in to comment.