Skip to content

Commit

Permalink
create backup for sowftware management (bnc#882039)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 13, 2014
1 parent 4053d7b commit 316b13a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/modules/RootPart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1797,11 +1797,27 @@ def MountPartitions(root_device_current)
# enter the mount points of the newly mounted partitions
# in the target map of the storage module
AddToTargetMap()
create_backup
end

success
end

# known configuration files that are changed during update, so we need to
# backup them to restore if something goes wrong (bnc#882039)
BACKUP_DIRS = {
"sw_mgmt" => [
"/etc/zypp/repos.d",
"/etc/zypp/services.d",
"/etc/zypp/credentials.d"
]
}
def create_backup
BACKUP_DIRS.each_pair do |name, paths|
Update.create_backup(name, paths)
end
end

# Get architecture of an elf file.
def GetArchOfELF(filename)
bash_out = Convert.to_map(
Expand Down

0 comments on commit 316b13a

Please sign in to comment.