Skip to content

Commit

Permalink
restore the repository setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Sep 4, 2015
1 parent d4cf56c commit a8dd65f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package/yast2-migration.spec
Expand Up @@ -40,7 +40,7 @@ Requires: yast2-packager
Requires: yast2-pkg-bindings
Requires: yast2-ruby-bindings
# new registration with migration support
Requires: yast2-registration >= 3.1.135
Requires: yast2-registration >= 3.1.147
# need recent enough installation for working proposal runner
Requires: yast2-installation >= 3.1.146
Requires: yast2-update
Expand Down
11 changes: 10 additions & 1 deletion src/lib/migration/main_workflow.rb
Expand Up @@ -69,7 +69,7 @@ def run
"ws_start" => "start",
"start" => {
start: "create_pre_snapshot",
restart: "create_post_snapshot"
restart: "migration_finish"
},
"create_pre_snapshot" => {
next: "create_backup"
Expand Down Expand Up @@ -97,6 +97,10 @@ def run
},
# note: the steps after the YaST restart use the new code from
# the updated (migrated) yast2-migration package!!
"migration_finish" => {
abort: :abort,
next: "create_post_snapshot"
},
"create_post_snapshot" => {
next: "finish_dialog"
},
Expand All @@ -118,6 +122,7 @@ def aliases
"restart_yast" => ->() { restart_yast },
# note: the steps after the YaST restart use the new code from
# the updated (migrated) yast2-migration package!!
"migration_finish" => ->() { migration_finish },
"create_post_snapshot" => ->() { create_post_snapshot },
"finish_dialog" => ->() { finish_dialog }
}
Expand Down Expand Up @@ -175,6 +180,10 @@ def create_post_snapshot
:next
end

def migration_finish
Yast::WFM.CallFunction("migration_finish")
end

# check whether snapper is configured
# @return [Boolean] true if snapper is configured
def snapper_configured?
Expand Down
3 changes: 3 additions & 0 deletions src/lib/migration/proposal_client.rb
Expand Up @@ -178,6 +178,9 @@ def disable_repo(link)

log.info "Disabling repository #{repo}"
Pkg.SourceSetEnabled(repo, false)

# disable the old repo permanently to not possibly mess the system later
Pkg.SourceSaveAll
end

# proposal help text
Expand Down
1 change: 1 addition & 0 deletions test/main_workflow_test.rb
Expand Up @@ -39,6 +39,7 @@ def mock_client(name, res)
mock_client("inst_prepareprogress", :next)
mock_client("inst_kickoff", :next)
mock_client("inst_rpmcopy", :next)
mock_client("migration_finish", :next)

allow(Yast::Update).to receive(:clean_backup)
allow(Yast::Update).to receive(:create_backup)
Expand Down

0 comments on commit a8dd65f

Please sign in to comment.