Hello community,
here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2015-02-06 10:22:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
and /work/SRC/openSUSE:Factory/.yast2-packager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2015-02-01 12:28:32.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2015-02-06 10:22:05.000000000 +0100
@@ -1,0 +2,14 @@
+Thu Feb 5 07:33:09 UTC 2015 - jsrain@suse.cz
+
+- initialize bootloader during update if proposed from scratch
+ (bnc#899743)
+- 3.1.59
+
+-------------------------------------------------------------------
+Tue Feb 3 09:01:07 UTC 2015 - lslezak@suse.cz
+
+- fixed file:// URL handling (same as dir://) (boo#869399)
+- validate entered URL schema
+- 3.1.58
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-3.1.57.tar.bz2
New:
----
yast2-packager-3.1.59.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.ObIvFq/_old 2015-02-06 10:22:07.000000000 +0100
+++ /var/tmp/diff_new_pack.ObIvFq/_new 2015-02-06 10:22:07.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.57
+Version: 3.1.59
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-packager-3.1.57.tar.bz2 -> yast2-packager-3.1.59.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/package/yast2-packager.changes new/yast2-packager-3.1.59/package/yast2-packager.changes
--- old/yast2-packager-3.1.57/package/yast2-packager.changes 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/package/yast2-packager.changes 2015-02-05 08:43:11.000000000 +0100
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Thu Feb 5 07:33:09 UTC 2015 - jsrain@suse.cz
+
+- initialize bootloader during update if proposed from scratch
+ (bnc#899743)
+- 3.1.59
+
+-------------------------------------------------------------------
+Tue Feb 3 09:01:07 UTC 2015 - lslezak@suse.cz
+
+- fixed file:// URL handling (same as dir://) (boo#869399)
+- validate entered URL schema
+- 3.1.58
+
+-------------------------------------------------------------------
Thu Jan 29 14:45:40 UTC 2015 - jreidinger@suse.com
- remove obsolete legacy patch callbacks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/package/yast2-packager.spec new/yast2-packager-3.1.59/package/yast2-packager.spec
--- old/yast2-packager-3.1.57/package/yast2-packager.spec 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/package/yast2-packager.spec 2015-02-05 08:43:11.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.57
+Version: 3.1.59
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/clients/inst_kickoff.rb new/yast2-packager-3.1.59/src/clients/inst_kickoff.rb
--- old/yast2-packager-3.1.57/src/clients/inst_kickoff.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/clients/inst_kickoff.rb 2015-02-05 08:43:11.000000000 +0100
@@ -236,10 +236,10 @@
# load all network modules
load_network_modules
- # perform actions needed by various bootloaders before packages
- # get updated
- # Bootloader::PreUpdate ();
- # -- this function call does NOTHING!
+ # initialize bootloader
+ # will return immediatly unless bootloader configuration was
+ # proposed from scratch (bnc#899743)
+ WFM.CallFunction("inst_bootloader", WFM.Args)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/AddOnProduct.rb new/yast2-packager-3.1.59/src/modules/AddOnProduct.rb
--- old/yast2-packager-3.1.57/src/modules/AddOnProduct.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/AddOnProduct.rb 2015-02-05 08:43:11.000000000 +0100
@@ -263,8 +263,7 @@
# replaces some already installed add-on or whether it is a new
# installation. Repositories and target have to be initialized.
#
- # @param [Fixnum] source_id
- # @param string "installation" or "update" according the current state
+ # @param [Fixnum] source_id source ID
def AddOnMode(source_id)
all_products = Pkg.ResolvableProperties("", :product, "")
@@ -353,8 +352,7 @@
# as it is (just the relative_url parameter).
#
# @param [String] base_url
- # @param string relative_url
- # @return [String] absolute_url
+ # @param [String] url URL relative to the base
#
# @example
# AddOnProduct::GetAbsoluteURL (
@@ -768,7 +766,7 @@
# set to "true" or "yes". If it has, product is added into list of pruducts
# that need registration. Cached content file is used if possible.
#
- # @param integer source id
+ # @param [Fixnum] src_id source id
def PrepareForRegistration(src_id)
control_file = WorkflowManager.GetCachedWorkflowFilename(:addon, src_id, "");
@@ -881,7 +879,7 @@
# Calls registration client if needed.
#
- # @param integer source id
+ # @param [Fixnum] src_id source id
def RegisterAddOnProduct(src_id)
# FATE #305578: Add-On Product Requiring Registration
# or check the content file
@@ -1453,8 +1451,9 @@
# Installs selected products from repository. If list of prods_to_install
# is empty, all products found are installed.
#
- # @param
- # @return [Boolean] if successful
+ # @param [Array<String>,nil] prods_to_install list of product names to install
+ # @param [Fixnum] src source ID
+ # @return [Boolean] success flag
def InstallProductsFromRepository(prods_to_install, src)
prods_to_install = deep_copy(prods_to_install)
# there are more products at the destination
@@ -1491,9 +1490,9 @@
# Ask for a product medium
#
- # @url medium url (either "cd:///" or "dvd:///")
- # @product_name expected product name
- # @return nil if aborted, otherwise URL with the selected CD device
+ # @param [String] url medium url (either "cd:///" or "dvd:///")
+ # @param [String] product_name expected product name
+ # @return [String,nil] nil if aborted, otherwise URL with the selected CD device
def AskForCD(url, product_name)
parsed = URL.Parse(url)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/CheckMedia.rb new/yast2-packager-3.1.59/src/modules/CheckMedia.rb
--- old/yast2-packager-3.1.57/src/modules/CheckMedia.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/CheckMedia.rb 2015-02-05 08:43:11.000000000 +0100
@@ -152,7 +152,7 @@
end
# Return information printed by checkmedia utility
- # @ret list<string> checkmedia output
+ # @return [Array<String>] checkmedia output
def Info
ret = deep_copy(@output)
@output = []
@@ -170,7 +170,7 @@
# contain a medium). If repository is not CD/DVD it returns
# empty list.
#
- # @return list<string> List of CD/DVD device names
+ # @return [Array<String>] List of CD/DVD device names
def GetReadyCDs
# check whether we are using CD repository
instmode = Linuxrc.InstallInf("InstMode")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/DefaultDesktop.rb new/yast2-packager-3.1.59/src/modules/DefaultDesktop.rb
--- old/yast2-packager-3.1.57/src/modules/DefaultDesktop.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/DefaultDesktop.rb 2015-02-05 08:43:11.000000000 +0100
@@ -281,7 +281,7 @@
end
# Set the default desktop
- # @param desktop a string, one of those desktops defined in control file or nil
+ # @param [String,nil] new_desktop one of those desktops defined in control file or nil
def SetDesktop(new_desktop)
Init()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/InstShowInfo.rb new/yast2-packager-3.1.59/src/modules/InstShowInfo.rb
--- old/yast2-packager-3.1.57/src/modules/InstShowInfo.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/InstShowInfo.rb 2015-02-05 08:43:11.000000000 +0100
@@ -20,7 +20,7 @@
Yast.import "Label"
end
- # @param string info_file (/info.txt" - Copied from inst media to inst-sys by linuxrc)
+ # @param [String] info_file (/info.txt" - Copied from inst media to inst-sys by linuxrc)
def show_info_txt(info_file)
display_info = UI.GetDisplayInfo
size_x = Builtins.tointeger(Ops.get_integer(display_info, "Width", 800))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/OneClickInstallStandard.rb new/yast2-packager-3.1.59/src/modules/OneClickInstallStandard.rb
--- old/yast2-packager-3.1.57/src/modules/OneClickInstallStandard.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/OneClickInstallStandard.rb 2015-02-05 08:43:11.000000000 +0100
@@ -17,7 +17,7 @@
# Converts XML file to a list of maps with all repositories described in the XML content.
#
- # @param XML file
+ # @param [String] filename XML file
# @return [Array >]
#
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/Packages.rb new/yast2-packager-3.1.59/src/modules/Packages.rb
--- old/yast2-packager-3.1.57/src/modules/Packages.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/Packages.rb 2015-02-05 08:43:11.000000000 +0100
@@ -439,7 +439,7 @@
# Checks which products have been selected for removal and modifies
# the warning messages accordingly.
#
- # @param reference to map MakeProposal->Summary
+ # @param [Yast::ArgRef] ret reference to map MakeProposal->Summary
def CheckOldAddOns(ret)
products = Pkg.ResolvableProperties("", :product, "")
products = Builtins.filter(products) do |one_product|
@@ -592,7 +592,7 @@
# Print the installatino proposal summary
# @param [Array<Symbol>] flags a list of symbols, see above
# @param [Boolean] use_cache if true, use previous proposal if possible
- # @returnu a map proposal summary
+ # @return [Hash] a map with proposal summary
def Summary(flags, use_cache)
flags = deep_copy(flags)
if @init_error != nil
@@ -1054,7 +1054,7 @@
end
# Additional kernel packages from control file
- # @return list<string> Additional Kernel packages
+ # @return [Array<String>] Additional Kernel packages
def ComputeAdditionalKernelPackages
final_kernel = Kernel.GetFinalKernel
pos = Builtins.findfirstof(final_kernel, "-")
@@ -1728,7 +1728,7 @@
# Adjusts repository name according to LABEL in content file
# or a first product found on the media (as a fallback).
#
- # @param integer repository ID
+ # @param [Fixnum] src_id repository ID
# @return [Boolean] if successful
#
# @see BNC #481828
@@ -2204,8 +2204,8 @@
# Make a proposal for package selection
#
- # @param force reset (fully resets the proposal and creates a new one)
- # @param re-initialize (soft-reset, doesn't reset resolbavle manually selected by user)
+ # @param [Boolean] force_reset force reset (fully resets the proposal and creates a new one)
+ # @param [Boolean] reinit re-initialize (soft-reset, doesn't reset resolbavle manually selected by user)
#
# @return [Hash] for the API proposal
def Proposal(force_reset, reinit, simple)
@@ -2549,7 +2549,7 @@
# List of packages expected to be installed in order to enable
# remote administration (VNC)
#
- # @return Array<String>
+ # @return [Array<String>] package list
def vnc_packages
packages = VNC_BASE_PACKAGES.dup
# At least one windowmanager must be installed (#427044)
@@ -2562,7 +2562,7 @@
# List of packages expected to be installed in order to use
# a remote X11 server
#
- # @return Array<String>
+ # @return [Array<String>] package list
def remote_x11_packages
packages = REMOTE_X11_BASE_PACKAGES.dup
packages << "yast2-x11" if Mode.autoinst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/ProductLicense.rb new/yast2-packager-3.1.59/src/modules/ProductLicense.rb
--- old/yast2-packager-3.1.57/src/modules/ProductLicense.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/ProductLicense.rb 2015-02-05 08:43:11.000000000 +0100
@@ -106,7 +106,7 @@
# Sets that the license (file) has been already accepted
#
- # @param string filename
+ # @param [String] license_ident file name
def LicenseHasBeenAccepted(license_ident)
if license_ident == nil || license_ident == ""
Builtins.y2error("Wrong license ID '%1'", license_ident)
@@ -411,7 +411,12 @@
end
# Displays License with Help and ( ) Yes / ( ) No radio buttons
- # @param string file with the license
+ # @param [Array<String>] languages list of license translations
+ # @param [Boolean] back enable "Back" button
+ # @param [String] license_language default license language
+ # @param [Hash] licenses licenses (mapping "langugage_code" => "license")
+ # @param [String] id unique license ID
+ # @param [String] caption dialog title
def DisplayLicenseDialogWithTitle(languages, back, license_language, licenses, id, caption)
languages = deep_copy(languages)
@@ -452,7 +457,7 @@
# Removes the temporary directory for licenses
- # @param string temporary directory path
+ # @param [String] tmpdir temporary directory path
def CleanUpLicense(tmpdir)
if tmpdir != nil && tmpdir != "/"
SCR.Execute(
@@ -1094,8 +1099,7 @@
# @param [Boolean] require_agreement means that even if the license (or the very same license)
# has been already accepetd, ask user to accept it again (because of 'going back'
# in the installation proposal).
- # @param [String] id, usually source id but it can be any unique id in UI. Well, of course
- # it must be string.
+ # @param [String] id usually source id but it can be any unique id in UI
def AskLicenseAgreement(src_id, dir, patterns, action, enable_back, base_product, require_agreement, id)
patterns = deep_copy(patterns)
@lic_lang = ""
@@ -1195,11 +1199,11 @@
# Ask user to confirm license agreement
- # @param src_id integer repository to get the license from.
- # If set to 'nil', the license is considered to belong to a base product
# @param [Array<String>] dirs - directories to look for the licenses
# @param [Array<String>] patterns a list of patterns for the files, regular expressions
# with %1 for the language
+ # @param [String] action what to do if the license is declined,
+ # can be "continue", "abort" or "halt"
# @param [Boolean] enable_back sets the back_button status
# @param [Boolean] base_product defines whether it is a base or add-on product
# true means base product, false add-on product
@@ -1581,7 +1585,7 @@
# update license location displayed in the dialog (e.g. after license translation
# is changed)
# @param [String] lang language of the currently displayed license
- # @param [Yast::ArgRef] reference to the list of licenses
+ # @param [Yast::ArgRef] licenses reference to the list of licenses
def update_license_location(lang, licenses)
if location_is_url?(license_file_print) && UI.WidgetExists(:printing_hint)
# name of the license file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/SourceDialogs.rb new/yast2-packager-3.1.59/src/modules/SourceDialogs.rb
--- old/yast2-packager-3.1.57/src/modules/SourceDialogs.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/SourceDialogs.rb 2015-02-05 08:43:11.000000000 +0100
@@ -61,6 +61,10 @@
:download_metadata => N_("&Download repository description files"),
}
+ # @see https://github.com/openSUSE/libzypp/blob/master/zypp/media/MediaManager.h#L1...
+ VALID_URL_SCHEMES = ["ftp", "tftp", "http", "https", "nfs",
+ "nfs4", "cifs", "smb", "cd", "dvd", "iso", "dir", "file", "hd"]
+
def main
Yast.import "Pkg"
Yast.import "UI"
@@ -213,7 +217,7 @@
# label / dialog caption
"dir" => _("Local Directory"),
# label / dialog caption
- "file" => _("Local ISO Image"),
+ "iso" => _("Local ISO Image"),
# label / dialog caption
"http" => _("Server and Directory"),
# label / dialog caption
@@ -525,7 +529,8 @@
Popup.Message(_("URL cannot be empty."))
return false
end
- true
+
+ valid_scheme?(url)
end
# Get widget description map
@@ -822,7 +827,11 @@
# @param [String] key string widget key
def DirInit(key)
parsed = URL.Parse(@_url)
- UI.ChangeWidget(Id(:dir), :Value, Ops.get_string(parsed, "path", ""))
+
+ path = parsed["path"]
+ path = "/" if path.empty?
+
+ UI.ChangeWidget(Id(:dir), :Value, path)
UI.SetFocus(:dir)
# is it a plain directory?
@@ -846,10 +855,15 @@
# Store function of a widget
# @param [String] key string widget key
# @param [Hash] event map which caused settings being stored
- def DirStore(key, event)
- event = deep_copy(event)
+ def DirStore(key, _event)
+ parsed = URL.Parse(@_url)
+
+ # keep file:// scheme if it was used originally
+ scheme = parsed["scheme"] || ""
+ scheme = "dir" if scheme.downcase != "file"
+
parsed = {
- "scheme" => "dir",
+ "scheme" => scheme,
"path" => Convert.to_string(UI.QueryWidget(Id(:dir), :Value))
}
@@ -868,7 +882,7 @@
def IsoStore(key, event)
event = deep_copy(event)
parsed = {
- "scheme" => "file",
+ "scheme" => "iso",
"path" => Convert.to_string(UI.QueryWidget(Id(:dir), :Value))
}
@@ -1815,6 +1829,9 @@
return false
end
end
+ else
+ url = UI.QueryWidget(Id(:complete_url), :Value)
+ return valid_scheme?(url)
end
true
@@ -2162,8 +2179,8 @@
# Handles Ui events in New repository type selection dialog
#
- # @param [String] widget key
- # @param [Hash] event description
+ # @param [String] key widget key
+ # @param [Hash] event event description
# @return [Symbol]
def SelectHandle(key, event)
case event["ID"]
@@ -2240,7 +2257,7 @@
elsif selected == :local_dir
@_url = "dir://"
elsif selected == :local_iso
- @_url = "file://"
+ @_url = "iso://"
elsif selected == :slp
@_url = "slp://"
elsif selected == :comm_repos
@@ -2279,9 +2296,9 @@
current = :hd
elsif @_url == "usb://"
current = :usb
- elsif @_url == "dir://"
+ elsif @_url == "dir://" || @_url == "file://"
current = :local_dir
- elsif @_url == "file://"
+ elsif @_url == "iso://"
current = :local_iso
elsif @_url == "slp://"
current = :slp
@@ -2401,7 +2418,8 @@
"hd" => DiskWidget(),
"usb" => USBWidget(),
"dir" => DirWidget(),
- "file" => IsoWidget(),
+ "file" => DirWidget(),
+ "iso" => IsoWidget(),
"http" => ServerWidget(),
"https" => ServerWidget(),
"ftp" => ServerWidget(),
@@ -2625,6 +2643,16 @@
(Stage.initial ? Popup.ConfirmAbort(:painless) : Popup.ReallyAbort(SourceManager.Modified()))
end
+ def valid_scheme?(url)
+ scheme = URL.Parse(url)["scheme"] || ""
+ scheme.downcase!
+ ret = VALID_URL_SCHEMES.include?(scheme)
+
+ Report.Error(_("URL scheme '%s' is not valid.") % scheme) unless ret
+
+ ret
+ end
+
publish :function => :SetURL, :type => "void (string)"
publish :function => :SetURLType, :type => "void (string, boolean)"
publish :function => :GetURL, :type => "string ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/SourceManager.rb new/yast2-packager-3.1.59/src/modules/SourceManager.rb
--- old/yast2-packager-3.1.57/src/modules/SourceManager.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/SourceManager.rb 2015-02-05 08:43:11.000000000 +0100
@@ -505,7 +505,8 @@
# Parse a URL query (already unescaped) to a map.
# If no equal sign, the value will be nil.
# @param [String] query foo=bar&baz=qux
- # @return $["foo": "bar", "baz": "qux"]
+ # @return [Hash] hash with "param" => "value" mapping,
+ # e.g. ["foo": "bar", "baz": "qux"]
def ParseUrlQuery(query)
q_items = Builtins.splitstring(query, "&")
q_map = Builtins.listmap(q_items) do |q_item|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/src/modules/SourceManagerSLP.rb new/yast2-packager-3.1.59/src/modules/SourceManagerSLP.rb
--- old/yast2-packager-3.1.57/src/modules/SourceManagerSLP.rb 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/src/modules/SourceManagerSLP.rb 2015-02-05 08:43:11.000000000 +0100
@@ -299,8 +299,8 @@
# Initializes the listed SLP services.
#
- # @param [list <map> &] services (reference)
- # @param string regexp for services that should be visible (nil or "" for all)
+ # @param [Yast::ArgRef] services reference to services (Array<Hash>)
+ # @param [String,nil] filter_string regexp for services that should be visible (nil or "" for all)
def InitSLPListFoundDialog(services, filter_string)
filter_string = nil if filter_string == ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/test/Makefile.am new/yast2-packager-3.1.59/test/Makefile.am
--- old/yast2-packager-3.1.57/test/Makefile.am 2015-01-30 17:33:13.000000000 +0100
+++ new/yast2-packager-3.1.59/test/Makefile.am 2015-02-05 08:43:11.000000000 +0100
@@ -1,6 +1,7 @@
TESTS = \
addon_product_test.rb \
packages_test.rb \
+ source_dialogs_test.rb \
space_calculation_test.rb
TEST_EXTENSIONS = .rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.57/test/source_dialogs_test.rb new/yast2-packager-3.1.59/test/source_dialogs_test.rb
--- old/yast2-packager-3.1.57/test/source_dialogs_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-3.1.59/test/source_dialogs_test.rb 2015-02-05 08:43:11.000000000 +0100
@@ -0,0 +1,29 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+
+Yast.import "SourceDialogs"
+
+describe Yast::SourceDialogs do
+ describe "#valid_scheme?" do
+
+ it "returns true for 'https://' URL" do
+ expect(Yast::SourceDialogs.valid_scheme?("https://")).to eq(true)
+ end
+
+ it "returns false for empty URL and reports error" do
+ expect(Yast::Report).to receive(:Error)
+ expect(Yast::SourceDialogs.valid_scheme?("")).to eq(false)
+ end
+
+ it "returns false for 'foo://' URL and reports error" do
+ expect(Yast::Report).to receive(:Error)
+ expect(Yast::SourceDialogs.valid_scheme?("foo://")).to eq(false)
+ end
+
+ it "returns false for 'foo' URL and reports error" do
+ expect(Yast::Report).to receive(:Error)
+ expect(Yast::SourceDialogs.valid_scheme?("foo")).to eq(false)
+ end
+ end
+end
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org