Skip to content

Commit

Permalink
The instsys.parts path is not a UpdateRepository argument anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 13, 2017
1 parent ce4c6d2 commit b6a6d72
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/lib/installation/update_repository.rb
Expand Up @@ -46,11 +46,12 @@ class UpdateRepository
# * :default: Default
# * :user: User defined
ORIGINS = [:default, :user]
# Path to instsys.parts registry
INSTSYS_PARTS_PATH = Pathname("/etc/instsys.parts").freeze


# @return [URI] URI of the repository
attr_reader :uri
# @return [Pathname] Registry of inst-sys updated parts
attr_reader :instsys_parts_path
# @return [Array<Pathname>] local paths of updates fetched from the repo
attr_reader :update_files
# @return [Symbol] Repository origin. @see ORIGINS
Expand Down Expand Up @@ -104,11 +105,7 @@ class CouldNotSquashPackage < FetchError; end
#
# @param uri [URI] Repository URI
# @param origin [Symbol] Repository origin (@see ORIGINS)
# @param instsys_parts_path [Pathname] Path to instsys.parts registry
# TODO: instsys_parts_path should not be a constructor's parameter.
# It should be passed directly to the apply method with a default
# value defined as a constant.
def initialize(uri, origin = :default, instsys_parts_path = Pathname("/etc/instsys.parts"))
def initialize(uri, origin = :default)
Yast.import "Pkg"
Yast.import "Progress"

Expand All @@ -117,7 +114,6 @@ def initialize(uri, origin = :default, instsys_parts_path = Pathname("/etc/insts
@uri = uri
@update_files = []
@packages = nil
@instsys_parts_path = instsys_parts_path
raise UnknownOrigin unless ORIGINS.include?(origin)
@origin = origin
end
Expand Down Expand Up @@ -413,9 +409,9 @@ def next_name(basedir, prefix: "yast_", length: 3)
# @param path [Pathname] Filesystem to mount
# @param mountpoint [Pathname] Mountpoint
#
# @see instsys_parts_path
# @see INSTSYS_PARTS_PATH
def update_instsys_parts(path, mountpoint)
instsys_parts_path.open("a") do |f|
INSTSYS_PARTS_PATH.open("a") do |f|
f.puts "#{path.relative_path_from(Pathname("/"))} #{mountpoint}"
end
end
Expand Down

0 comments on commit b6a6d72

Please sign in to comment.