Skip to content

Commit

Permalink
Merge 51d8f4b into 70d6da0
Browse files Browse the repository at this point in the history
  • Loading branch information
wfeldt committed Oct 24, 2022
2 parents 70d6da0 + 51d8f4b commit 2b2b913
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/modules/AddOnProduct.rb
Expand Up @@ -5,6 +5,8 @@
require "packager/product_patterns"
require "y2packager/resolvable"
require "y2packager/repository"
require "uri"
require "yast2/rel_url"

# Yast namespace
module Yast
Expand Down Expand Up @@ -405,6 +407,22 @@ def GetBaseProductURL
# "relurl://./Product_CD1/"
# ) -> "username:password@ftp://www.example.org/dir/Product_CD1/"
def GetAbsoluteURL(base_url, url)
url_parsed = URI(url)

if url_parsed.scheme == "repo"
base_url = InstURL.installInf2Url("")
if base_url.empty?
log.error "no ZyppRepoURL in /etc/install.inf"
else
rel_url = "relurl:" + url_parsed.path
url = Yast2::RelURL.from_installation_repository(rel_url).absolute_url.to_s
log.info("base url + relative path: #{URL.HidePassword(base_url)} + #{url_parsed.path}")
log.info("absolute url: #{URL.HidePassword(url)}")
end

return url
end

if !Builtins.regexpmatch(url, "^relurl://")
Builtins.y2debug("Not a relative URL: %1", URL.HidePassword(url))
return url
Expand Down

0 comments on commit 2b2b913

Please sign in to comment.