Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladimir Moravec
committed
Dec 17, 2013
1 parent
132c1ba
commit 8dcac0f
Showing
7 changed files
with
70 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
class ZyppConfig | ||
SCR_TARGET = '.etc.zypp_conf' | ||
CONFIG_USE_DELTA_RPM = "#{SCR_TARGET}.value.main.\"download.use_deltarpm\"" | ||
CONFIG_USE_DELTA_RPM = Yast::Path.new(".etc.zypp_conf.value.main.\"download.use_deltarpm\"") | ||
|
||
def initialize | ||
@use_deltarpm = true | ||
current_config = get_delta_rpm_config_value | ||
# Default config for delta rpms in zypp.conf is true | ||
@use_delta_rpm = current_config == nil || current_config == 'true' | ||
@use_deltarpm = !['0', 'no', 'false', 'off', '-'].include?(current_config.downcase) if current_config | ||
end | ||
|
||
def use_delta_rpm? | ||
@use_delta_rpm | ||
def use_deltarpm? | ||
@use_deltarpm | ||
end | ||
|
||
def activate_delta_rpm | ||
def activate_deltarpm | ||
Yast::Builtins.y2milestone("Activating delta rpms for online update..") | ||
set_delta_rpm_config_value(true) | ||
end | ||
|
||
def deactivate_delta_rpm | ||
def deactivate_deltarpm | ||
Yast::Builtins.y2milestone("Deactivating delta rpms for online update..") | ||
set_delta_rpm_config_value(false) | ||
end | ||
|
||
private | ||
|
||
def set_delta_rpm_config_value new_value | ||
return if new_value == use_delta_rpm? | ||
Yast::SCR.Write(Yast::Path.new(CONFIG_USE_DELTA_RPM), new_value) | ||
return if new_value == use_deltarpm? | ||
Yast::SCR.Write(CONFIG_USE_DELTA_RPM, new_value) | ||
end | ||
|
||
def get_delta_rpm_config_value | ||
Yast::SCR.Read(Yast::Path.new(CONFIG_USE_DELTA_RPM)) | ||
Yast::SCR.Read(CONFIG_USE_DELTA_RPM) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters