Skip to content

Commit

Permalink
use better name for method
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Sep 18, 2014
1 parent 853a1b2 commit 51055f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/bootloader/backup_mbr.rb
Expand Up @@ -22,7 +22,7 @@ def backup_device(device)
# check if file exists
if Yast::SCR.Read(Yast::Path.new(".target.size"), device_file_path) > 0
cleanup_backups(device_file)
change_date = grub_getFileChangeDate(device_file_path)
change_date = formated_file_ctime(device_file_path)
Yast::SCR.Execute(
BASH_PATH,
Yast::Builtins.sformat("/bin/mv %1 %1-%2", device_file_path, change_date)
Expand Down Expand Up @@ -55,7 +55,7 @@ def backup_device(device)
# Get last change time of file
# @param [String] filename string name of file
# @return [String] last change date as YYYY-MM-DD-HH-MM-SS
def grub_getFileChangeDate(filename)
def formated_file_ctime(filename)
stat = Yast::SCR.Read(Yast::Path.new(".target.stat"), filename)
ctime = stat["ctime"] or raise "Cannot get modification time of file #{filename}"
time = DateTime.strptime(ctime.to_s, "%s")
Expand Down

0 comments on commit 51055f8

Please sign in to comment.